Jump into FLASH XiP user code from Flashloader

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

Jump into FLASH XiP user code from Flashloader

Jump to solution
1,902 Views
antoinezen
Contributor III

Hi,

For various reasons (continus integration being one of them), we like to develop for the iMXRT1050 family without using the MCUXpresso IDE. We like to work old fashion from the command line, using makefile, gdb over openocd and text editor.

From now, I was able to program an image into the external flash (the Hyperflash to be precise) on the MIMXRT1050-EVK devbard using the "elftosb -f imx ...", "elftosb -f kinetix ...", "sdphost ...", "blhost..." way using the "Flashloader_RT1050_1.1" package. But this requires to change the boot mode to "Serial Downloader" by changing the DIP swiches on SW7. If I want the run the application, I have to un-plug the board, change the DIP swiches on SW7 again and re-plug the board. Then my application is running fine, but this is not very suitable for the development, as one can easily understand.

I have tried to start the application using the "blhost -u -- execute ..." command but with no success. I have tried to give various address such a flash start, IVT table address, vector table address, or Reset handler address, but none of this works. 

It there i way to jump into user code that lie in flash from the flashloader ? Does the flashloader firmware leaves the FlexSPI initialized after the " receive-sb-file" command ?

0 Kudos
1 Solution
1,436 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Antoine Zen-Ruffinen,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'm afraid that it's unavailable to jump to the XIP code in the external memory from the flashloader via command.
Hope this is clear.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
1,436 Views
nickdolling
Contributor IV

Can you do it the other way? ie leave SW7 in the normal position and jump into the bootloader from your application, then load the new firmware as you are, and then just reset the processor (at which point it would restart into your application)?

Nick

0 Kudos
1,437 Views
antoinezen
Contributor III

It is more or less what I am doing now. I'm now loading the flashloader into RAM using OpenOCD and jumping into it using a OpenOCD command. Finding the proper the proper address to jump to was a bit tricky, I had to reverse engineer the IVT and vector table from the flashloader image.

For the one interested, the whole command I use to jump-start the flashloader is :

   openocd -f nxp_mimxrt1050-evk.cfg -c init -c "reset halt" -c "load_image ivt_flashloader.bin 0x20000000" -c "resume 0x20014b91" -c "exit"

Jumping into it from the application can be also possible, but then the application would have to contains the flashlaoder image and to copy it to RAM first as the flashlaoder image is linked to RAM.

I think i would be easyier to implement a proper In application programming than doing this.

0 Kudos
1,437 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Antoine Zen-Ruffinen,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'm afraid that it's unavailable to jump to the XIP code in the external memory from the flashloader via command.
Hope this is clear.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos