NRF5 SDK to zephyr migration (via BLE data transfer - MBR, mcuboot, application direct write to flash and run update process)


Md. Touhiduzzaman Turja <zaman.turja@...>
 

Scenario:
NRF5 SDK based firmware is running in the nrf52840.
We need to migrate the system to zephyr via BLE.

What we want to do:
The idea is to get MBR, zephyr mcuboot and zephyr application hex via BLE.

First, get data and write zephyr application hex from image1 address.

Second, get data and write zephyr mcuboot hex from mcuboot1 address.

Third, get data, erase 1 page from 0 address and write the MBR from 0 address.

And after a reboot the system will swap/update mcuboot1 to mcuboot, then mcuboot will swap/update image1 to image0.

In that process, some parts of NRF5 SDK based firmware may stay in the flash as garbage, we are expecting these area will be erased while there is any overwrite in the future. Or we may plan to erase these after doing some calculation.

Here,
We created additional mcuboot1 section for mcuboot upgrade feature, which part will be handled by new MBR.

Now the questions are:

Is the process seems good ? or there is better way to do the migration ?

Is there any other way to migrate from NRF5 SDK based firmware to zephyr firmware already ?

Is there any other way to update mcuboot already ?

where is the location of the vectors for mcuboot and application is defined ? can we do it in MBR section ? how ?


--
Thanking You,
SOLshare Website

Md. Touhiduzzaman Turja 
Firmware and Communications Engineer
Mob. +880 (173) 83 42 290 

Facebook Twitter LinkedIn Instagram YouTube

SOLshare - Zayed Sustainability Prize 2022: Energy Winner 2022
SOLshare - Earthshot Prize Finalist 2021Fix Our Climate
SOLshare - Free Electrons Award 2018: Best Energy Startup
SOLshare - LM Tower (2nd Floor), Ka/87, Joar Shahara Bazar Road, Vatara, Dhaka - 1229, Bangladesh.
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential or privileged material. Any review, retransmission, dissemination, or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please notify the sender and delete the material from your computer.


McCrae, Jamie
 

Hi,
Is this all packaged up as a single image/transfer or multiple? If multiple, what happens if the device is rebooting during the transfer and it has overwrote part of the nRF5 softdevice?
There is no short answer to this, I think a better place to ask this question and get advice would be directly from nordic themselves on https://devzone.nordicsemi.com/
Thanks,
Jamie

On Sun, 2023-02-19 at 15:09 +0600, Md. Touhiduzzaman Turja via lists.zephyrproject.org wrote:

Scenario:

NRF5 SDK based firmware is running in the nrf52840.
We need to migrate the system to zephyr via BLE.

What we want to do:
The idea is to get MBR, zephyr mcuboot and zephyr application hex via BLE.

First, get data and write zephyr application hex from image1 address.

Second, get data and write zephyr mcuboot hex from mcuboot1 address.

Third, get data, erase 1 page from 0 address and write the MBR from 0 address.

And after a reboot the system will swap/update mcuboot1 to mcuboot, then mcuboot will swap/update image1 to image0.

In that process, some parts of NRF5 SDK based firmware may stay in the flash as garbage, we are expecting these area will be erased while there is any overwrite in the future. Or we may plan to erase these after doing some calculation.

Here,
We created additional mcuboot1 section for mcuboot upgrade feature, which part will be handled by new MBR.

Now the questions are:

Is the process seems good ? or there is better way to do the migration ?

Is there any other way to migrate from NRF5 SDK based firmware to zephyr firmware already ?

Is there any other way to update mcuboot already ?

where is the location of the vectors for mcuboot and application is defined ? can we do it in MBR section ? how ?




Md. Touhiduzzaman Turja <zaman.turja@...>
 

Assume, we have a solution to this scenario - >
" what happens if the device is rebooting during the transfer and it has overwrote part of the nRF5 softdevice? "

Can you provide information to this question, below-> where is the location of the vectors for mcuboot and application is defined ? can we do it in MBR section ? how ?