How to change one boot sector to the other one ?

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

How to change one boot sector to the other one ?

727 Views
1329306846
Contributor III

Hello everyone,

       There are some problems puzzled me recently. Really hope someone can help me. As we know, we can store many boot sector in the flash memory. I have two applications in the MCU. Sometimes I want to change one application to the other one , that is to say that  I should change one boot sector to the other boot sector. But now I don't have a appropriate way to realize it .

       Thany you very much!捕获1.PNG

4 Replies

554 Views
1329306846
Contributor III

   Hi,thank you for your reply! I know that a state machine searches for valid RCHW[BOOT_ID] sequentially from block 0 to block 7.I just want know how to change BOOT_ID to run different application, when I have two BOOT_ID and not erase the other BOOT_ID.

  In my application , I have used two BOOT_ID, one is used for Bootloader, one is for application . How can I  realize that Bootloader change into application,except for erase one of the BOOT_ID.Can I  through resetvector realize it ?

0 Kudos

554 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

I should work a bit differently - The bootloader is supposed to be executed after each reset. At the beginning of bootloader, the bootloader should check startup condition (state of a pin, content of some word in flash or whatever else...). Then, based on the condition, the bootloader can continue in its execution or the user application should be started.

However you may use for instance second BOOT_ID for the case only application is programmed (supposing first BOOT_ID is erased as bootloader is not programmed). And if both BOOT_IDs are programmed (bootloader on first place, application on second place), bootloader will be loaded as first place (i.e. block 0) takes precedence.

Another point is that multiple RCHWs can be use as safety feature - if block 0 is invalid (for instance due to ECC error), block 1 is attempted to be loaded and so on

554 Views
1329306846
Contributor III

      Thank you for your reply !  I 'm very agree with you. Now, in the practice,what I want to do is same with what you have said.

MCU excutes bootloader  after each reset. At the beginning of bootloader, the bootloader should check startup condition . Then, based

on the condition, the bootloader can continue in its execution or the user application should be started.  

     Now , the key is that when the  startup condition is satisfied, how can I change bootloader to user application. I have tried stared user application through application start address, but I have failed. Do you have some suggestions ?

    The MCU what I used is MPC5675k. Really hope you can give me some tips or examples!

0 Kudos

554 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, a state machine searches for valid RCHW[BOOT_ID] sequentially from block 0 to block 7. First valid boot ID is used to boot the microcontroller. That's all.