I am having a bit of a difficulty with the external SDRAM on the OM13098 board (LPC54628).
My application is basically an event recorder, that samples a fixed amount of input data for a certain time, and stores them to SD card afterwards. For size reasons, I want to store the input data in SDRAM.
My first, less elegant approach was to assign a fixed address (0xA000.0000) to a pointer variable.
That works partially, but I'm having some strange problems.
The input data (several channels) are gathered via ADC interrupt, and written to the SDRAM buffer.
If I step into the interrupt handler, I can see plausible values, and they are written to the proper SDRAM addresses (checked in the debugger).
If I step over the data collection function (which just enables the trigger for timer & ADC, and waits for a ready flag), the SDRAM buffer is empty afterwards, i.e. contains the all-zero initialisation values (check the "Memory" view in the debugger, set to the given address).
Respective data types are all "volatile".
To debug and test other parts, I use the internal RAM temporarily, which is filled to 80% ...
And, checking the MCUXpresso help, there seems a more elegant way I currently explore.
When including cr_section_macros.h, I can use the sections provided in the linker script, which already include the SDRAM.
Since the SDRAM does not "exist" during startup, I need the __NOINIT macro, I suppose.
So, something like this:
__NOINIT(BOARD_SDRAM) uint16_t my_buffer[SIZE];
Confusingly, the map file contains (empty) sections for SD_RAM code and data which are not ".noinit".
Wouldn't such initialisations fail catastrophically if no EMC/SDRAM init preceded the startup memory initialisation ?
Perhaps someone experienced with the MCUXpresso toolchain can shed some light on this issue.
Thanks,
Frank.