test_mcuboot example - not switching

Hello, 

I am looking to have two applications in flash and switch between them using MCU boot using an nRF52832. The ultimate goal is to do BLE MESH DFU into external flash for larger applications but I thought I'd start with a simple switching between two applications already present in flash using MCU boot. 

I have found this Zephyr example in the connect SDK - C:\ncs\v2.3.0-rc1\zephyr\tests\boot

This looks like it'll fulfil my initial task of switching. The application builds successfully, however the MCU does not switch between the the applications.  Example UNCHANGED.

Terminal Log:

****** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
*** Booting Zephyr OS build v3.2.99-ncs2-rc1 ***
Launching primary slot application on nrf52dk_nrf52832
..
..
..

main.c application 1

#include <zephyr/kernel.h>
#include <zephyr/sys/reboot.h>
#include <zephyr/dfu/mcuboot.h>

/* Main entry point */
void main(void)
{
	printk("Launching primary slot application on %s\n", CONFIG_BOARD);
	/* Perform a permanent swap of MCUBoot application */
	boot_request_upgrade(1);
	printk("Secondary application ready for swap, rebooting\n");
	sys_reboot(SYS_REBOOT_COLD);
}

main.c application 2

#include <zephyr/kernel.h>

/* Main entry point */
void main(void)
{
    while(1){
	printk("Swapped application booted on %s\n\n\n\n", CONFIG_BOARD);
    }
}

Any thought?

Parents
  • Hi shahin97,

    Rather than the secondary application not being flashed, it looks to me that the only thing in your flash memory is actually the first application. The green area above is likely some configuration data.

    This project use sysbuild, which the VS Code extension does not handle very well. To build it, you need to follow the instruction here:
    Sysbuild (System build) — Zephyr Project Documentation (nordicsemi.com).

    That being said, in my test, even with all the images built and flashed, the sample would still not work. The main application can detect the app to be swapped, but MCUboot cannot boot into the new app for some reasons. I am not 100% certain why at the moment.

    Before we proceed any further, I notice you mentioning that this experiment is to get Bluetooth Mesh DFU to work somehow. I understand that you are talking about the nRF5 SDK for Mesh DFU solution. It is a completely different SDK. Do you have a plan to mix the SDKs together somehow?

    Hieu

Reply
  • Hi shahin97,

    Rather than the secondary application not being flashed, it looks to me that the only thing in your flash memory is actually the first application. The green area above is likely some configuration data.

    This project use sysbuild, which the VS Code extension does not handle very well. To build it, you need to follow the instruction here:
    Sysbuild (System build) — Zephyr Project Documentation (nordicsemi.com).

    That being said, in my test, even with all the images built and flashed, the sample would still not work. The main application can detect the app to be swapped, but MCUboot cannot boot into the new app for some reasons. I am not 100% certain why at the moment.

    Before we proceed any further, I notice you mentioning that this experiment is to get Bluetooth Mesh DFU to work somehow. I understand that you are talking about the nRF5 SDK for Mesh DFU solution. It is a completely different SDK. Do you have a plan to mix the SDKs together somehow?

    Hieu

Children
Related