Secondary Bootloader + Dual Image Setup

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

Secondary Bootloader + Dual Image Setup

1,023 Views
maknxp
Contributor I

We have a secondary bootloader, put in Flash Bank1 IFR0 region (0x0100_8000 to 0x100FFFF). The BOOT_SRC within CMPA is set to 2 for transferring control to Secondary Bootloader from BOOTROM on Power-Up. It works correctly. We can transfer the control to Main Application residing at address 0x0000_0000.

We would like to have DUAL Main Application setup and not quite sure how exactly it works. We would like to store a Second copy Main Application at 0x0008_0000. Essentially, first one is at 0x0000_0000, can grow up to 0x0007_FFFF and second one is at 0x0008_0000 which can grow up to 0x000F_FFFF, occupying 512 KB each.

We understood about the Flash Remap feature. which is programming FLASH_REMAP_SIZE from CMPA to kind of partition the on chip flash. We also understood that the selection of the image will be decided by BOOTROM code.

In our case the, the boot process also have our secondary bootloader as mentioned above and it is the one which always executes after BOOTROM. The question is how to use the Dual Main Application (on On-chip Flash and REMAP feature) with Secondary Bootloader (on Bank1Ifr0).

Labels (2)
0 Kudos
Reply
3 Replies

215 Views
klt4xc
Contributor I

thanks for the information!

0 Kudos
Reply

3 Views
klt4xc
Contributor I

Taking a closer look at that NXP forum discussion on implementing a secondary bootloader with a dual image setup, the core issue is how to properly manage firmware updates while ensuring the device can still boot if something goes wrong. The setup described involves storing two application images and using a secondary bootloader to decide which one to run, typically based on integrity checks or version control. The key takeaway is that the bootloader must contain clear logic to validate images and safely switch between them when needed, rather than relying on external triggers. This kind of structured decision-making is essential for maintaining system stability during updates. In a similar way, systems that use voice to text ai also depend on processing input data through defined logic to produce accurate and reliable outputs, showing how important well-designed evaluation flows are across different types of technology.

0 Kudos
Reply

1,009 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @maknxp 

In your secondary bootloader, you need to read the version numbers of both images and then decide which one to launch.
By the way, which NXP MCU are you using?
 
Thank you.
 
BR
Alice
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2342645%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESecondary%20Bootloader%20%2B%20Dual%20Image%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342645%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3EWe%20have%20a%20secondary%20bootloader%2C%20put%20in%20Flash%20Bank1%20IFR0%20region%20(0x0100_8000%20to%200x100FFFF).%20The%20BOOT_SRC%20within%20CMPA%20is%20set%20to%202%20for%20transferring%20control%20to%20Secondary%20Bootloader%20from%20BOOTROM%20on%20Power-Up.%20It%20works%20correctly.%20We%20can%20transfer%20the%20control%20to%20Main%20Application%20residing%20at%20address%200x0000_0000.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EWe%20would%20like%20to%20have%20DUAL%20Main%20Application%20setup%20and%20not%20quite%20sure%20how%20exactly%20it%20works.%20We%20would%20like%20to%20store%20a%20Second%20copy%20Main%20Application%20at%200x0008_0000.%20Essentially%2C%20first%20one%20is%20at%200x0000_0000%2C%20can%20grow%20up%20to%200x0007_FFFF%20and%20second%20one%20is%20at%200x0008_0000%20which%20can%20grow%20up%20to%200x000F_FFFF%2C%20occupying%20512%20KB%20each.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EWe%20understood%20about%20the%20Flash%20Remap%20feature.%20which%20is%20programming%20FLASH_REMAP_SIZE%20from%20CMPA%20to%20kind%20of%20partition%20the%20on%20chip%20flash.%20We%20also%20understood%20that%20the%20selection%20of%20the%20image%20will%20be%20decided%20by%20BOOTROM%20code.%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EIn%20our%20case%20the%2C%20the%20boot%20process%20also%20have%20our%20secondary%20bootloader%20as%20mentioned%20above%20and%20it%20is%20the%20one%20which%20always%20executes%20after%20BOOTROM.%20The%20question%20is%20how%20to%20use%20the%20Dual%20Main%20Application%20(on%20On-chip%20Flash%20and%20REMAP%20feature)%20with%20Secondary%20Bootloader%20(on%20Bank1Ifr0).%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2342645%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EBoot%20ROM%7CBooting%20%7C%20Flash%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMCXN%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2342986%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Secondary%20Bootloader%20%2B%20Dual%20Image%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2342986%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F184664%22%20target%3D%22_blank%22%3E%40maknxp%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3EIn%20your%20secondary%20bootloader%2C%20you%20need%20to%20read%20the%20version%20numbers%20of%20both%20images%20and%20then%20decide%20which%20one%20to%20launch.%3CBR%20%2F%3EBy%20the%20way%2C%20which%20NXP%20MCU%20are%20you%20using%3F%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EThank%20you.%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3EBR%3C%2FDIV%3E%0A%3CDIV%3EAlice%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2360072%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Secondary%20Bootloader%20%2B%20Dual%20Image%20Setup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2360072%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ethanks%20for%20the%20information!%3C%2FP%3E%3C%2FLINGO-BODY%3E