AnsweredAssumed Answered

How do I run from BOARD_SDRAM on MIMXRT1020-EVK?

Question asked by rshipman on Sep 9, 2019
Latest reply on Apr 23, 2020 by Andre marcus


I've installed MCUXpresso IDE v11.0.0 and SDK_2.x_EVK-MIMXRT1020.

I am connected via the USB debug port to a MIMXRT1020-EVK eval board.

I have loaded and run various demos successfully such as demo_apps/hello_world and iled_blinky using the default settings etc.

What I'm trying to do is run a demo straight from BOARD_SDRAM.

How can I do this (e.g. in MCUXpresso)? What settings do I need to change? Do I need to make changes to the code as well?


I'm struggling to find anything in the various documents that tell me precisely how to do this, or tell me what actually is going on when the default demos above are loaded. (I have the MCUXpresso user guide and the i.MX RT1020 Processor Reference Manual among others.) Is there a basic 'just for beginners' set of tutorials that describe what exactly is going on when a demo is loaded and executed please? I can see the info in the .ld linker files, the auto generated code, and the various places in the code that refer to the vector tables and memory sections and so on, but I don't yet know how this all ties together, which bits are included or not, or how and where MCUXpresso makes the changes (e.g. what settings affect what bit of code).


This is what I have changed so far:

I select 'Link to RAM' and move BOARD_SDRAM up as the second item in the memory configuration list after BOARD_FLASH. Everything else is the same as the default SDK demo settings. After building, the linker tells me that everything is going to be in BOARD_SDRAM, all other memories have zero bytes in them.


BOARD_FLASH: 0 GB 8 MB 0.00%
BOARD_SDRAM: 26212 B 32 MB 0.08%
SRAM_DTC: 0 GB 64 KB 0.00%
SRAM_ITC: 0 GB 64 KB 0.00%
SRAM_OC: 0 GB 128 KB 0.00%


I tried loading/running this but I get an error:


Error in final launch sequence:

Failed to execute MI command:
Error message from debugger back end:
Load failed
Failed to execute MI command:
Error message from debugger back end:
Load failed


I expected an error of some sort, because I don't know how the boot loader would know to boot from this image in SDRAM. E.g. how and where should I load the IVT table etc? Do I still need to load something into flash that tells boot loader to run from SDRAM?


Is there an easy way to get MCUXpresso to do this please? Or do I need to start editing code and creating separate binary files to load in various places?


Also I'm not entirely sure I understand the different between the two boot configurations serial and internal. As I understand it: MCUXpresso is able to load new code onto the board with the internal setting enabled. So the program gets loaded into flash and the boot loader is made to run from it. In serial mode the boot code comes from the serial channel, so does that mean MCUXpresso first loads the program into flash and then a separate binary to be used by the boot loader?


Also how does MCUXpresso actually invoke the boot loader to start running?


Sorry for the rambling questions. I am basically a complete beginner to MCUXpresso and eclipse generally and to the ARM Mx core chips. (I know these questions probably look stupid.)


Thanks for your help.

Kind regards