Creating a custom header for bootloader and application, then jumping to the application.

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

Creating a custom header for bootloader and application, then jumping to the application.

429 Views
darshanmk
Contributor I

Hi NXP team,

We are using i.MXRT1170 evkb board for bootloader and application loading, so that once our custom bootloader is executed, it should jump to the application (For ex. LED blinky). We have to add similar 64B of custom header for both bootloader and application

If no header is included, we are successfully able to jump to application. But once we add the custom header for our application, bootloader is failing to jump to the application main. Please help us with this issue.

The default boot header (which includes boot data, IVT, DCD,...) in the Bootloader is unchanged. But we understood that, adding the same default boot header for the application is not required. Correct us if our understanding is wrong.

0 Kudos
Reply
5 Replies

385 Views
mayliu1
NXP Employee
NXP Employee

Hi @darshanmk 

Thank you so much for your interest in our products and for using our community.

In order to support you better, could you provide more information?

1: Your application image start address.

mayliu1_1-1735892105280.png

2: Your project  Debug_memory.ld and cm7_Debug.ld file.

3:Please tell me your APP jump address.

I suggest you can refer to the next link.

RT1060 OTA bootloader ISP and swap rollback usage - NXP Community

Wish it helps you.

BR

mayliu

0 Kudos
Reply

381 Views
darshanmk
Contributor I

Hi @mayliu1 ,

This is the SS of the Bootloader memory.ld file's memory region.

darshanmk_0-1735899952139.png

And below is the SS of our application memory region in memory.ld file;

darshanmk_1-1735900094111.png

this image shows that our application starts from 0x30200000 address in which we are trying to place our application's custom header of 64B. After this from address location 0x30200040 our application program will start.

darshanmk_2-1735900299017.png

Above image shows the header section we have created in the debug.ld file.

APP jump address: 0x30200040 

0 Kudos
Reply

350 Views
mayliu1
NXP Employee
NXP Employee

Hi @darshanmk 

Question:The default boot header (which includes boot data, IVT, DCD,...) in the Bootloader is unchanged. But we understood that, adding the same default boot header for the application is not required. Correct us if our understanding is wrong.

Answer:  Yes, Application not not need the header.

I checked your application address, I think the addresses that I have boxed in the picture should all be the same.

mayliu1_0-1736161034761.png

 

#define APP_IMAGE_START_ADDRESS  0x30200000

For example,  you set  application address as APP_IMAGE_START_ADDRESS  ,  then the jump address should be following code shows (It's only for demo verification. For the actual project, it needs to be in accordance with your design requirements. ). 

farewellBootloader = (void (*)(void))(APP_IMAGE_START_ADDRESS  + 4);

Please try it. I'm looking forward to your good news.

 

BR

mayliu

0 Kudos
Reply

347 Views
darshanmk
Contributor I

Hi @mayliu1 ,

Thanks for the response. I tried the changes mentioned by you and now I'm able to jump to the application from bootloader to our application starting address 0x3020_0000. I want to know if both __base_BOARD_FLASH and __base_Flash is of same address, how they are different from each other? Please clarify regarding these addresses.

Also based on requirement changes, now I tried to start my application from location 0x3020_0040, but the VTOR register is not updating with this location. I did the necessary changes in the memory linker file. I attached the SS of the changes I did for the new requirement.

darshanmk_0-1736171310308.png

Please help me with the issue.

 

0 Kudos
Reply

311 Views
mayliu1
NXP Employee
NXP Employee

Hi @darshanmk 

Thanks for your update information.

The MCUXPresso IDE will automatically generate the debug_memory.ld file.

You can change Flash, Ram size in this window. 

I think this method is more reliable.

mayliu1_0-1736334541807.png

 

Wish it helps you.
If you still have question about it, please kindly let me know.

BR

mayliu

0 Kudos
Reply