I'm using 8MiB external ram with the LPC1788. I use a scatter file to use it as heap. I found out the startup file uses a lot of ZI-data. I think it tries to initialize the external ram. But the ram is setup by a function called by the main. How do I prevent the startup file from initializing the external ram?
; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* ; based on http://www.keil.com/forum/23045/setup-heap-on-external-ram/ LR_IROM1 0x00000000 0x00080000 { ; load region size_region ER_IROM1 0x00000000 0x00080000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } RW_IRAM1 0x10000000 0x00010000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 0x20000000 0x00008000 { .ANY (+RW +ZI) } RW_IRAM3 0xA0000000 0x00800000 { ; use malloc in external ram .ANY (HEAP) ; Object/Section directive, park HEAP in here } }
Sir,
The task must be carried out in SystemInit.
Yes that's right, innit.
Warmest respect,
Mr Trout.
This is the reset handler in the startup file startup_LPC177x_8x.s
Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP
Where should I init the RAM? In system init? Where does the startup file initialize the heap? In __main?
Please consider initialiZing the RAM before entering main.
When you look, you should realiZe that it is the solution to your problem.
Hugs and cuddles,
View all questions in Keil forum