How do I run from BOARD_SDRAM on MIMXRT1020-EVK?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I run from BOARD_SDRAM on MIMXRT1020-EVK?

7,541 Views
rshipman
Contributor V

Hi,

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:
-target-download
Error message from debugger back end:
Load failed
Failed to execute MI command:
-target-download
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

24 Replies

1,324 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Paul Laroide,

   Please take easy!

   I will test it on my MIMXRT1020-EVK board about the SDRAM function, then give you reply later, please give me more time, thanks a lot for your understanding!

Have a great day,
Kerry

0 Kudos

1,314 Views
BlackNight
NXP Employee
NXP Employee

At project creation time there is an option for this:

pastedImage_1.png

I hope this helps,

Erich

0 Kudos

408 Views
rshipman
Contributor V

One more thing:

I've been using the iled_blinky demo: I set XIP_BOOT_HEADER_DCD_ENABLE=1 and ran it (because I couldn't see a way to get the DCD code to compile in using MCUXpresso settings). I can see the dcd set at 0x600010xx etc (although tbh I had expected to see that at 0x2010xx), but I cannot debug 0x80000000 etc. I'm using the Rt1020 EVK and SDK with MCUXpresso and debugging via the debug USB port using LinkServer. The demos run fine out of the box, but I just cannot get SDRAM to initalise for the life or me. Or at least I cannot get the debugger to read it. I just get question marks. What have I missed?

Any help would be greatly appreciated.

0 Kudos

408 Views
rshipman
Contributor V

Hi,

Thank you for the great response.

So if I understand you correctly…

I first load the led_blinky SDK demo that has been modified to use SDRAM for data (or something) - so that it still resides in XIP but will set up the SDRAM? Then I download my other image to SDRAM and use the soft reset facility to run it?

Ultimately I want to be able to load an image into flash, get the bootloader or something to load that into SDRAM and then run it from there. Is this possible? I’d rather have instructions that describe how to do this please? Sorry for not making that clear earlier.

(Ironically the reason I was trying to load the SDRAM directly was because of the first paragraph in this article: https://community.nxp.com/docs/DOC-340655. (“so the application can be downloaded directly to the SDRAM for debugging”), which made it sound like an easy task before trying to do it the ‘harder’ way. The article is for a different board, but I assumed I could do the same thing for the 1020. I just don’t know how.)

As for debug, I am currently connected to the RT1020 EVK board via the debug USB port (which is connected to a Windows 10 pc with MCUXpresso running). I am using the standard MCUXpresso LinkServer DAPLink probe when I debug.

In fact everything is a pretty standard out of the box set up, apart from the few settings I need to change to get it to run from SDRAM.

Any help is much appreciated.

Kind regards