SDRAM
I work on lpc246.
I create a section placed on a sdram starting on 0xa0000000 and allocate all the data , bss, and rodata of a specific file to that section.
I compile and link the program and all is ok.
When I try to start a debug session using jtag , I receive the following error during the execution of reset script named FlashReset():
"Memory erase operation failed: no driver installed for memory range"
I suppose that the script try to zeroes the sdram, but wrong because the memory controller is not initialised.
1) What I have to do to avoid the access to the sdram memory before the program starts?
2) Where I have to put my code to initialize the sdram before the crt.s file copy and zero somthing into the sdram?
thanks
-
Regarding the "Memory erase operation failed: no driver installed for memory range" error, see http://rowley.zendesk.com/entries/45571-no-driver-installed-for-memory-range-error-message - For more information on LIBMEM and loaders see http://www.rowleydownload.co.uk/documentation.latest/arm/libmem.htm and http://www.rowleydownload.co.uk/documentation.latest/arm/libmem_loader.htm
If you want to write an application that boots from FLASH and uses external SDRAM then you probably don't want to download to SDRAM at all. For .bss this is simply a case of setting the "Load" attribute in the placement file to "No". For .data (and .rodata if you want that in RAM as well) you will need to set up a "load" and a "run" section. The default FLASH placement files we ship all setup "load" and "run" sections for .data.
You would normally configure SDRAM in your startup code so that it is configured before crt0.s initialises .bss and copies .data.
-
OK I saw that into the crt0.s file there is a place in which is possible to initialize the secondary memory section (this is into the piece of code between
#ifdef INITIALIZE_SECONDARY_SECTIONS) and #endif
Now I suppose that the SDRAM has to be initialized before this piece of code.
Is There a specific place into the crt0.s or into the _Startuo.s files to initialize the SDRAM?
-
My experience is to add the configuration code in the _Startup.s code just before b _start. In the application note about SDRAM, there are sample codes in C for that. I rewrite it in Assembly language, and it is for the AT91SAM7SE-EK demo board from Atmel. After that, check with the Memory Map file and Section Placement file to make sure when building the project, some code will be put in the external SDRAM. Also, it is able to put some test code for SDRAM, like to write some data to a sequence of address and read them later. It should be OK if the SDRAM parameters are properly set up.
Please sign in to leave a comment.
Comments
5 comments