AnsweredAssumed Answered

J-Link: program Flash and SDRAM at startup of a debug session

Question asked by Giuseppe Modugno on Feb 16, 2020
Latest reply on Mar 13, 2020 by Omar Anguiano

I have a board with LPC1788, an external SDRAM, an external SPI Flash (connected with a standard SPI peripheral, not SPIFI) and a TFT 480x272 display.


All the bimap images don't fit in the internal Flash, so my idea is to save them in the external SPI Flash and copy them at startup to SDRAM, from address 0xA008 0000. The framebuffer is at address 0xA000 0000, that is the initial address of SDRAM after initialization.


In the MCUXpresso MCU Settings window, I added a "fake" Flash memory section that starts at 0xA008 (it's fake, because it isn't a Flash, but a SDRAM). So the build process generates a .hex file with two areas: internal Flash (0x0000) and external SDRAM (0xA008).


I already have a USB bootloader that is able to read the .hex and write to internal Flash (0x0000...) and SPI Flash (0xA008...). This works good, but I can't use this approach for debugging, because USB bootloader is too slow.


I'm trying to find a way to instruct IDE to program 0xA008..., already present in the output file of the linking process. I know this isn't normally possible, because SDRAM isn't initialized at reset. Is there a way to initialize SDRAM and write it at debug startup, together with internal Flash?


Do you suggest another better approach?