Second stage XIP bootloader for iMX RT1060

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

Second stage XIP bootloader for iMX RT1060

Jump to solution
823 Views
pm_2552
Contributor III

I am trying to find an example of second stage bootloader based on XIP flash and supports updating and booting the application.

I came across these three resources but I am not able to test them for one or the other reason:
1. Appnote: AN12604 Implement second bootloader on i.MXRT10xx series
Related example: sw12604
https://www.nxp.com/docs/en/application-note-software/AN12604SW.zip
I could not find this example in MCU SDK.
Question:
1.1: Is this supported with MCUXpresso or is there any default example that is similar to the second stage bootloader mentioned in the app note?
1.2: Could you please help with the instructions to build this example?

2. SBL and SFW appnote: https://www.nxp.com/docs/en/application-note/AN13460.pdf and https://www.nxp.com/docs/en/user-guide/MCUOTASBLSFWUG.pdf
2.1: I could not find the instructions to build this on a MAC. Is the support only for Windows and Linux host?
2.2: Any default example in SDK for SBL and SFW?

3. ota_bootloader example is not present in the latest SDK 2.14.0 but was there in 2.7.0 as mentioned here: https://community.nxp.com/t5/i-MX-RT/How-to-run-evkmimxrt1060-lwip-httpssrv-ota-freertos/m-p/977955

3.1: Are there know problems in the example because of which it is removed?
3.2: Is the functionality of ota_bootloader demonstrated in some other default examples in SDK?

I would really appreciate the answers to these questions.
P.S. I am aware of FlashLoader example but I am not sure if that can be used as my intended second stage bootloader because of the following reasons:(Please correct me if I am missing the essence of Flashloader)
1. Flashloader is used to communicate with host and allows flashing bootable images to the boot devices(in my case External FLash for XIP) and Flashloader itself runs in RAM
2. I have to first flash flashloader and boot the device in serial loader mode by means of boot switches. After this the blhost utility can be used to communicate to the board over uart/hid to flash the firmware.
3. Flashloader can not be used as SBL where ROM bootloader starts the execution of second stage bootloader and then second stage bootloader does some verification of the firmware and lets the application run if the verification passes.

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
782 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @pm_2552 

    Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

    Answer your questions:

1. Appnote: AN12604 Implement second bootloader on i.MXRT10xx series
Related example: sw12604
https://www.nxp.com/docs/en/application-note-software/AN12604SW.zip
I could not find this example in MCU SDK.
Question:
1.1: Is this supported with MCUXpresso or is there any default example that is similar to the second stage bootloader mentioned in the app note?
1.2: Could you please help with the instructions to build this example?

=>Answer: I checked the AN12604 software package, it is the IAR project, if you need the MCUXPresso IDE project, you can import it based on the SDK.

About the function, it is the UART and USB method to download the app and jump to the app, you can consider it is the flashloader which is located in the flash which is used as the secondary bootloader.

About the instructions to build, you can use the IAR IDE to build the project directly, I find it contains RT1020, RT1050, RT1060 code:

kerryzhou_0-1691993695878.png

2. SBL and SFW appnote: https://www.nxp.com/docs/en/application-note/AN13460.pdf and https://www.nxp.com/docs/en/user-guide/MCUOTASBLSFWUG.pdf
2.1: I could not find the instructions to build this on a MAC. Is the support only for Windows and Linux host?
2.2: Any default example in SDK for SBL and SFW?

=>Answer: As I know, it is mainly based on the windows, you can use the windows to build it.

For the SBL and SFW, not in the SDK, it has it's own app and package.

Please go to this linker:

SBL Repository https://github.com/NXPmicro/sbl

 SFW Repository https://github.com/NXPmicro/sfw

 

3. ota_bootloader example is not present in the latest SDK 2.14.0 but was there in 2.7.0 as mentioned here: https://community.nxp.com/t5/i-MX-RT/How-to-run-evkmimxrt1060-lwip-httpssrv-ota-freertos/m-p/977955

3.1: Are there know problems in the example because of which it is removed?
3.2: Is the functionality of ota_bootloader demonstrated in some other default examples in SDK?

=>Answer: Not exactly, it is still in the SDK, just name changed.

Please check this code:

\SDK_2_13_1_EVK-MIMXRT1060\boards\evkmimxrt1060\mcuboot_opensource

 

I would really appreciate the answers to these questions.
P.S. I am aware of FlashLoader example but I am not sure if that can be used as my intended second stage bootloader because of the following reasons:(Please correct me if I am missing the essence of Flashloader)
1. Flashloader is used to communicate with host and allows flashing bootable images to the boot devices(in my case External FLash for XIP) and Flashloader itself runs in RAM
2. I have to first flash flashloader and boot the device in serial loader mode by means of boot switches. After this the blhost utility can be used to communicate to the board over uart/hid to flash the firmware.
3. Flashloader can not be used as SBL where ROM bootloader starts the execution of second stage bootloader and then second stage bootloader does some verification of the firmware and lets the application run if the verification passes.

=>Answer:In fact, it is determined by your requirement, the SBL is more rich function, include the flashloader's USB, UART bootloader, also sdcard, enet, wifi etc.

If you just need the UART and USB, you can use the SDK mcuboot_opensource project.

 

Wish it helps you!

Best Regards,

kerry

 

 

View solution in original post

5 Replies
734 Views
pm_2552
Contributor III

I have a follow up question

Which bootloader would you suggest if I do not need the UART and USB downloads? The main feature I am looking for is the ability to verify the application image before running the application and XIP.

Also I want to flash my application and bootloader through Jlink. So I do not need the USB/UART support.

0 Kudos
709 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @pm_2552 ,

  So, which detail bootloader function you want if you don't need the UART and USB to download the code?

  I think, if you don't need any other interface to download code, why you need the bootloader, you can use the JLINK download app directly.

Best Regards,

Kerry

0 Kudos
705 Views
pm_2552
Contributor III

Hello @kerry

I need the bootloader to act as a secondary bootloader. This secondary bootloader will verify the primary or secondary image before executing that image.
It is needed to ensure that a valid image is being booted up from the flash. Also its needed for OTA. To test and revert if the new image is not good. Or to execute the new image if the test passes. Basically for the remap functionality offered by RT106x devices.

0 Kudos
702 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @pm_2552 ,

  If OTA, I suggest you use the SBL +SFW.

  If you meet any issues, please help to create the new question post, thanks.

Wish it helps you!

Kerry

0 Kudos
783 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @pm_2552 

    Thank you for your interest in the NXP MIMXRT product, I would like to provide service for you.

    Answer your questions:

1. Appnote: AN12604 Implement second bootloader on i.MXRT10xx series
Related example: sw12604
https://www.nxp.com/docs/en/application-note-software/AN12604SW.zip
I could not find this example in MCU SDK.
Question:
1.1: Is this supported with MCUXpresso or is there any default example that is similar to the second stage bootloader mentioned in the app note?
1.2: Could you please help with the instructions to build this example?

=>Answer: I checked the AN12604 software package, it is the IAR project, if you need the MCUXPresso IDE project, you can import it based on the SDK.

About the function, it is the UART and USB method to download the app and jump to the app, you can consider it is the flashloader which is located in the flash which is used as the secondary bootloader.

About the instructions to build, you can use the IAR IDE to build the project directly, I find it contains RT1020, RT1050, RT1060 code:

kerryzhou_0-1691993695878.png

2. SBL and SFW appnote: https://www.nxp.com/docs/en/application-note/AN13460.pdf and https://www.nxp.com/docs/en/user-guide/MCUOTASBLSFWUG.pdf
2.1: I could not find the instructions to build this on a MAC. Is the support only for Windows and Linux host?
2.2: Any default example in SDK for SBL and SFW?

=>Answer: As I know, it is mainly based on the windows, you can use the windows to build it.

For the SBL and SFW, not in the SDK, it has it's own app and package.

Please go to this linker:

SBL Repository https://github.com/NXPmicro/sbl

 SFW Repository https://github.com/NXPmicro/sfw

 

3. ota_bootloader example is not present in the latest SDK 2.14.0 but was there in 2.7.0 as mentioned here: https://community.nxp.com/t5/i-MX-RT/How-to-run-evkmimxrt1060-lwip-httpssrv-ota-freertos/m-p/977955

3.1: Are there know problems in the example because of which it is removed?
3.2: Is the functionality of ota_bootloader demonstrated in some other default examples in SDK?

=>Answer: Not exactly, it is still in the SDK, just name changed.

Please check this code:

\SDK_2_13_1_EVK-MIMXRT1060\boards\evkmimxrt1060\mcuboot_opensource

 

I would really appreciate the answers to these questions.
P.S. I am aware of FlashLoader example but I am not sure if that can be used as my intended second stage bootloader because of the following reasons:(Please correct me if I am missing the essence of Flashloader)
1. Flashloader is used to communicate with host and allows flashing bootable images to the boot devices(in my case External FLash for XIP) and Flashloader itself runs in RAM
2. I have to first flash flashloader and boot the device in serial loader mode by means of boot switches. After this the blhost utility can be used to communicate to the board over uart/hid to flash the firmware.
3. Flashloader can not be used as SBL where ROM bootloader starts the execution of second stage bootloader and then second stage bootloader does some verification of the firmware and lets the application run if the verification passes.

=>Answer:In fact, it is determined by your requirement, the SBL is more rich function, include the flashloader's USB, UART bootloader, also sdcard, enet, wifi etc.

If you just need the UART and USB, you can use the SDK mcuboot_opensource project.

 

Wish it helps you!

Best Regards,

kerry