This post relates to getting the flashloader built and loaded/running on RT1064 using sdphost.
Our end goal is to customise the flashloader with some added functionality (as part of the
provisioning workflow). So the first step is getting the SDK flashloader example working.
I can debug load/run the flashloader from mcuxpresso, but when I try to load the binary using sdphost, it resets the CPU. Here is the .sb file I am using to create the bootable image.
options {
flags = 0x00;
startAddress = 0x20000000;
ivtOffset = 0x400;
initialLoadSize = 0x2000;
#entryPointAddress = 0x20002000;
}
sources {
elfFile = extern(0);
}
section (0)
{
}
=====
I create the image using the command:
elftosb.exe -f imx -V -c imx-unsigned.bd -o ivt_1064_flashloader.bin Debug/evkmimxrt1064_flashloader.axf
I load the image using the commands:
./sdphost.exe -u 0x1fc9,0x0135 -V -- write-file 0x20000000 ivt_1064_flashloader.bin
./sdphost.exe -u 0x1fc9,0x0135 -V -- jump-address 0x20000400
Subsequently, the CPU resets.
I have tried attaching the debugger (just before running sdphost commands) and the debugger halts on main, but I can't get it to halt on Reset_Handler. It looks like the reset handler is not run, as data is not properly initialized and the system resets after a CPU exception. However, I can see that the reset handler address is valid in both the ivt and the arm vector table. (In contrast the reset handler is clearly run when I load the program using mcuxpresso debugging.)
Here is a partial dump of ivt_1064_flashloader.bin
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000400 00d1 4020 24a1 2000 0000 0000 0000 0000
0000410 0420 2000 0400 2000 0000 0000 0000 0000
0000420 0000 2000 3b88 0001 0000 0000 0000 0000
0000430 0000 0000 0000 0000 0000 0000 0000 0000
*
0002000 e600 2020 24a1 2000 24ed 2000 bd8d 2000
0002010 24e9 2000 24e9 2000 24e9 2000 0000 0000
0002020 0000 0000 0000 0000 0000 0000 24f5 2000
I'd appreciate it if anyone can direct me how to get the flashloader example working with sdphost. Thanks.
Peter