MCUBOOT with serial

I am trying to get MCUBOOT working with project based on the Audio_DK  base, where we need to do firmware update over UART/Serial interface. 

I have added the following to the prj.conf 

CONFIG_BOOTLOADER_MCUBOOT=y

#use external flash chip
CONFIG_AUDIO_DFU=2

I have configured the flash chip, and now the project tries to build the mcuboot  however I get the following errors:
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 2076 bytes
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj): in function `k_sleep':
D:/Projects/Remington/reach-handpiece-wksp/handpiece-fw/reach_hp/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:135: undefined reference to `z_impl_k_sleep'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: D:/Projects/Remington/reach-handpiece-wksp/handpiece-fw/reach_hp/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:135: undefined reference to `z_impl_k_sleep'
c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj):(.rodata.spi_nor_config_0+0x0): undefined reference to `__device_dts_ord_151'

Any suggestions or documentation how to move forward? 
Parents
  • Hi, 

    c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'
    c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: region `FLASH' overflowed by 2076 bytes

    See this answer

    c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj): in function `k_sleep':
    D:/Projects/Remington/reach-handpiece-wksp/handpiece-fw/reach_hp/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:135: undefined reference to `z_impl_k_sleep'
    c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: D:/Projects/Remington/reach-handpiece-wksp/handpiece-fw/reach_hp/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:135: undefined reference to `z_impl_k_sleep'

    Sees missing this overlay-mcuboot_external_flash.conf

    c:/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj):(.rodata.spi_nor_config_0+0x0): undefined reference to `__device_dts_ord_151'

    Seems missing this overlay-dfu_external_flash.overlay

    I followed this course https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/topic/exercise-1-dfu-over-uart/ to modify the v2.6.1 nrf5340_audio and here is my test project nrf5340_audio_UART_recovery.7z  for UART Serial recovery. It will get into UART recovery mode by holding BTN4 while resetting the Audio DK. Then LED1 will light on Blue to indicate the Audio DK gets into the recovery mode.  

    Regards,
    Amanda H.

  • I am using 2.6.1 

    The first issue was that the the overlay-mcuboot_external_flash.conf was not being used. I had to put a mcuboot.conf in the child_image directory and copy the configuration over to this file.  I assume this might be a "feature" of the more recent zephyr/ncs....   

    The second issue is we were using the hci-ipc for the second core, which used all the flash and did not leave enough room for the b0n bootloader.  I had to change configuration, remove logging, etc until I got size down where the b0n would fit.  

    The third issue was after all this the processor would not boot.  This appeared to be because the external flash chip was configured wrong.  As it turns out the overlay, in dfu/conf/overlay-dfu_esternal_flash.overlay, was being used and was setup wrong. 

    Now I have the application compiling and booting again.  I am now trying to figure out how to configure the serial recovery mode.  For this project we are not doing OTA but only serial firmware update.  There seems to be little information on how from the application to boot into the serial recovery mode.  Additionally just to make things hard, the console UART is not the same UART we want to use for serial recovery. 


Reply
  • I am using 2.6.1 

    The first issue was that the the overlay-mcuboot_external_flash.conf was not being used. I had to put a mcuboot.conf in the child_image directory and copy the configuration over to this file.  I assume this might be a "feature" of the more recent zephyr/ncs....   

    The second issue is we were using the hci-ipc for the second core, which used all the flash and did not leave enough room for the b0n bootloader.  I had to change configuration, remove logging, etc until I got size down where the b0n would fit.  

    The third issue was after all this the processor would not boot.  This appeared to be because the external flash chip was configured wrong.  As it turns out the overlay, in dfu/conf/overlay-dfu_esternal_flash.overlay, was being used and was setup wrong. 

    Now I have the application compiling and booting again.  I am now trying to figure out how to configure the serial recovery mode.  For this project we are not doing OTA but only serial firmware update.  There seems to be little information on how from the application to boot into the serial recovery mode.  Additionally just to make things hard, the console UART is not the same UART we want to use for serial recovery. 


Children
Related