This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hello,
I'm trying to use a DxRAM 2-5 combination as the heap for CPU2, but malloc is returning a null pointer every time.
In the sysconfig/MEMCFG for CPU1 I have Dx RAM 2-5 configured to have CPU2 as the controller for the section, in the sysconfig/CMD for CPU2 I have a DxRAM memory combination of DxRAM 2-5 called DATA and sysmem Load Memory of DATA.
The MCUCNF1 register for CPU1 is set to 0x3C, but on CPU2 it is set to 0x00.
I get the same result if I use a memory combination of just D2RAM called cpu2Heap and declare this sysmem Load Memory, so it seems that the issue is with the memory combination.
Are there any configuration steps I've missed, or are memory combinations not able to be used in this way?
Thanks,
Alex
Alex,
Sorry for late reply. I want to get a clarification on this. You mentioned global RAM but in the name you have DxRAM which is not global RAM. Is that typo ? On CPU2 we only have D4 and D5 RAM. All other Dx RAM are for CPU1 only so please check if you are choosing correct configuration.
Regards,
Vivek Singh
Hi Vivek,
Thanks for getting back to me on this!
I used the "Ask a related question" feature from a question about Global Shared Ram, my question is just about the use of a DxRAM combination as sysmem on CPU2.
My understanding was that CPU2 could be assigned by CPU1 to be the controller of DxRAM2-5 using the sysconfig:
Have I misunderstood this?
Thanks,
Alex
HI Alex,
Have I misunderstood this?
No, you are correct. D2-D5 can be mapped to CPU2. Can you share the address for D2-D5 memory in the generated linker cmd file ?
Vivek Singh
This is the address and length of the D2-5 memory combination:
cpu2Heap : origin = 0x01A000, length = 0x008000
.sysmem : > cpu2Heap
That does not look correct. Please see below snapshot from Memory Map of device datasheet.
Can you try updating it as per this memory map and see if this helps.
Vivek Singh
Ah, you're absolutely right!
It looks like the CPU2 syscfg uses CPU1 memory addresses when forming memory combinations.
Thanks for your help!