Flash two firmware in flash and jump from one address to another #nrf52480 #flash


Nikos Karamolegkos
 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos


Carles Cufi
 

Hi Nikos,

 

Maybe you want to look at MCUboot, which supports this out of the box and is integrated with Zephyr?

https://mcuboot.com/

 

https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOTLOADER_MCUBOOT.html#cmdoption-arg-config-bootloader-mcuboot

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: 25 August 2020 15:52
To: users@...
Subject: [Zephyr-users] Flash two firmware in flash and jump from one address to another #flash #nrf52480

 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos


Nikos Karamolegkos
 

Thank you Carles, I would prefer not to use MCUboot. However, I have already checked MCUboot code in order to take some ideas. I am looking for something MCUboot interdependent. For example a function that change the boot address before the reboot.

On 8/25/20 5:22 PM, Cufi, Carles wrote:

Hi Nikos,

 

Maybe you want to look at MCUboot, which supports this out of the box and is integrated with Zephyr?

https://mcuboot.com/

 

https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOTLOADER_MCUBOOT.html#cmdoption-arg-config-bootloader-mcuboot

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: 25 August 2020 15:52
To: users@...
Subject: [Zephyr-users] Flash two firmware in flash and jump from one address to another #flash #nrf52480

 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Nikos Karamolegkos
 

Hello,

Update: I just want to change the boot address (or slot) before the reboot, without using MCUboot. I am looking on zephyr documentation for a mechanism like this but I can not find any utility. Any proposals/ideas?

Thank you

On 8/25/20 8:31 PM, Nikos Karamolegkos wrote:

Thank you Carles, I would prefer not to use MCUboot. However, I have already checked MCUboot code in order to take some ideas. I am looking for something MCUboot interdependent. For example a function that change the boot address before the reboot.

On 8/25/20 5:22 PM, Cufi, Carles wrote:

Hi Nikos,

 

Maybe you want to look at MCUboot, which supports this out of the box and is integrated with Zephyr?

https://mcuboot.com/

 

https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_BOOTLOADER_MCUBOOT.html#cmdoption-arg-config-bootloader-mcuboot

 

Thanks,

 

Carles

 

From: users@... <users@...> On Behalf Of Nikos Karamolegkos via lists.zephyrproject.org
Sent: 25 August 2020 15:52
To: users@...
Subject: [Zephyr-users] Flash two firmware in flash and jump from one address to another #flash #nrf52480

 

Hello, I am using nrf52840-dk module (this is not really important). I would like to write two different firmwares in my device in different addresses (slots). Lets say the first firmware is located at address 0x000 (slot 0) and the second one is located at address 0x0000C000 (slot 1). How can I flash these two firmwares in these two different addresses and how can my application jump from the one address to the other (after reboot)?

Thanks,
Nikos

-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)
-- 
Nikos Karamolegkos
R & D engineer at ICS-FORTH
Telecommunications and Networks Lab (TNL)


Nikos Karamolegkos
 

Hello, after all I am flashing the base firmware (first app) into 0x0 address and then using the CONFIG_FLASH_LOAD_OFFSET=0x20000 to the proj.conf  of the second app I am flashing the second firmware in the 0x20000 address. Therefore, when I press a button from the first app I can jump to the second firmware. The only issue now is that I would like to update the start address to 0x20000 before the "jump" (in this way if I press reset the second app will boot). I have looked to the flash configs of zephyr but I have not found something useful. Any ideas?