I need to run a RAM app on an imx rt 1024, through JLink.
What works
I have a simple SDK example (blink) which is compiled to SRAM (0x20000000 on the imx rt). When I launch that project from the IDE, it runs. I can verify in the debugger that it's running in SRAM.
After I stop debugging (app remains running) I can go in JLink commander and execute
reset
loadfile myapp.axf 0x20000000 noreset
halt
setpc 0x20000000
go
And the app runs again, from SRAM. When I enter halt
I can see that PC is running somewhere in the 0x20000000
region of SRAM.
What doesn't work
When I
- power off the board,
- and power it again,
- connect via JLink,
- and enter the same commands as above
I always end up in the internal bootloader. The app never runs.
Why....
I have googled so much, and all I can find is that it "should work" exactly the way I am doing it. I am 100% sure that the binary (.axf) is good. When I launch from MCUxpresso the exact same binary is used.
I also used arm-none-eabi-objcopy
to extract the .bin file, but it makes no difference. It works when I launched the project from the IDE. It never works when I powered cycled the board.
Who can help me out? What is the magical command I am missing?