I want to store the variables of my code in the External SDRAM,So I've made these change to Target tab of Options window :
1. Default box for off-chip RAM1 is checked (Base Address: 0xA0000000 Size:0x10000000 2. Default box for on-chip IRAM1 is unchecked (both with unchecked No Init checkbox)
Also, I’ve edited the startup_LPC177x_8x in this order:
Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT SDRAMInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =SDRAMInit BLX R0 LDR R0, =__main BLX R0 ENDP
But when I debug, as you can see in picture above, program line stops at ‘SystemInit’ line Please notice that when Internal Memory is selected as default, there is no problem with accessing to Ext SDRAM in main.c code and it’s possible to read & write from SDRAM correctly. (for example, I checked the address 0xA0000001)
I want my MCU to be Initialized with Ext SDRAM or at best with both of them (Internal & External) but it’s not possible yet. Do I have to change the SystemInit config? How can I solve this issue?
Thanks In Advance
In main.c code I’ve included the "sdram_k4s561632j.h" header file and in int main() function, exactly also after defining some volatile variables, I’ve use SDRAMInit(); Also in startup_LPC177x_8x.s , as I mentioned before , I’ve added these lines to the code:
. . . IMPORT SDRAMInit . . LDR R0, =SDRAMInit BLX R0 . .
Do you I need add something else to my code, for Initializing EMC? lpc177x_8x_emc.c exist in my project , without any error. Thanks Per Westermark