Hi,
I use the LPC17788 microcontroller and the IS42S16800F SDRAM on my board. I want to access SDRAM as heap. To do this, I first entered the Target Options and specify the external ram range for RAM1 from the Target Settings Dialog. Start address : 0xA0000000 Size : 0x40000 (Normally my SDRAM size is larger. I only want to use that much space to heap.) Then I un-checked the "Use Memory Layout from Target Dialog" option in the Linker settings tab and clicked the edit button to edit the scatter file. In the scatter file, I've edited the RAM1 part as follows. RW_RAM1 0xA0000000 0x40000 { .ANY (HEAP) } Then I set the Heap Size in my startup_LPC177x_8x.s file to 0x00040000. Heap_Size EQU 0x00040000
When I checked the map file, I saw heap as I defined it.
To test, I define a pointer and allocate memory with malloc and check the address of my pointer. I see it as 0x00020005 while waiting for the address shown by my pointer to start with 0xA00 .... When I try the same process when my heap field is defined as the internal ram area of my microcontroller, I see my pointer's address correctly. I initializie the external ram at the beginning of my program. When I define a buffer in the external ram, I can successfully write and read to it. So I think there is no problem with my external ram initialization.
How I can use external ram as heap ? How can I fix the problem I'm talking about ?