Start address of partition memory and acces to a partition memory - VxWorks
This is a discussion on Start address of partition memory and acces to a partition memory - VxWorks ; Hello,
I am creating a partition memory like it :
void *part;
PART_ID partition;
part = malloc(size);
partition = memPartCreate(partition,sizeof(part));
I would know how I ca write in this partition memory or how I can know
start address of this ...
-
Start address of partition memory and acces to a partition memory
Hello,
I am creating a partition memory like it :
void *part;
PART_ID partition;
part = malloc(size);
partition = memPartCreate(partition,sizeof(part));
I would know how I ca write in this partition memory or how I can know
start address of this partition.
I am using a PPC440Gx and vxWorks6.4.
Thanks for your help
-
Re: Start address of partition memory and acces to a partition memory
Hello Nicolas,
It is somewhat unconventional to create a memory partition out of the
system's memory (i.e. via malloc()). Are you sure this is what you
really want to do?
Anyways, you have made a mistake in the usage of the memPartCreate()
API. Your code example should read as follows (I renamed 'part' into
'part_base_addr' for clarity):
void * part_base_addr;
PART_ID partition;
part_base_addr = malloc (size);
partition = memPartCreate (part_base_addr, size);
The start address of the partition is the value returned by malloc().
You are supposed to allocate blocks from the partition (using
memPartAlloc()) and then you can simply write at the address of those
blocks as you would do with blocks allocated with malloc().
Hope this helps,
--
PAD
-
Re: Start address of partition memory and acces to a partition memory
Hello,
I want to create a test on a partition of my SDRAM. For this, I want
to allocate a partition memory for this and only for this.
Thanks
-
Re: Start address of partition memory and acces to a partition memory
On Jul 24, 11:20 pm, nicolas.min...@googlemail.com wrote:
> I want to create a test on a partition of my SDRAM. For this, I want
> to allocate a partition memory for this and only for this.
Ok. I am assuming here that the SDRAM bank is not used for the OS
heap. In this case all you need to do is this:
partition = memPartCreate (,
partition>);
Of course your SDRAM bank has to be described to the system via the
BSP's sysPhysMemDesc[] array.
Cheers,
--
PAD
-
Re: Start address of partition memory and acces to a partition memory
Hello,
Sorry but I am a new user of vxWorks and I don't really understand
what you want to say by "Of course your SDRAM bank has to be described
to the system via the BSP's sysPhysMemDesc[] array"?
If I use an evaluation board supported by vxWorks with the delivered
BSP, could I think that the SDRAM bank is already defined in the BSP's
sysPhysMemDesc[] array?
For more help, I use an AMCC Taishan evaluation board with a Power PC
440Gx. I keep an eye on the sysPhysMemDesc array and I don't see
anything about the SDRAM bank.
Please, could you help me by describing how to define this in the
sysPhysMemDesc array?
Thanks
Nicolas Minier
-
Re: Start address of partition memory and acces to a partition memory
Hello Nicolas,
The sysPhysMemDesc[] array is a data structure usually defined in the
BSP's sysLib.c file that describes the various memory areas available
on the board. One and only one of the entries corresponds to the
physical memory used by VxWorks for its text, data, heap, etc.
Additional entries describing physical memory banks can appear in the
sysPhysMemDesc[] array and are therefore known to the OS but they are
not, by default, used by VxWorks for its heap.
Once such physical memory is described via an entry in the
sysPhysMemDesc[] array it is possible to use API such memPartCreate()
and memPartAddToPool() to make use of it.
I recommend that you read the VxWorks BSP Developer's Guide where the
array is described, and also the VxWorks Architecture Supplement where
specific usage scenarios of this arrays are discussed.
Hope this helps,
--
PAD