This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MCUboot not running application code on the nRF5340 DK board

Dear Concern,

work environment : nRF Connect SDK , nRF5340 DK board and Segger Embedded Studio

sample code : fade_led (using for my testing purpose)

Added immutable bootloader and upgradable bootloader to fade_led application as shown in below through segger embedded studio.

Project -> Configure nRF Connect SDK Project -> menuconfig -> modules -> nrf -> Nordic NRF Connect -> Bootloader -> Select the “Use Secure Bootloader “

Project -> Configure nRF Connect SDK Project -> menuconfig -> bootoptions ->select the “MCU bootloader support.”

I got bootloader messages on the console but application is not running.

Test 1 : Application running without immutable bootloader and upgradable bootloader.

Test 2: Application running with immutable bootloader also

Test 3: Application not running with upgradable bootloader (MCUboot)

Test 4: Application not running with immutable bootloader and upgradable bootloader.

Note : It seems to be MCUboot bootloader is not running the application. 

please let me know the solution for this issue.

Thanks & Regards,

Srinivas

  • Hi!

    Can you try to append the configurations in the prj.conf file and then reopen the project? We have seen some issues with SES not building child images correctly. These are the configurations:

    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_SECURE_BOOT=y

    Please report back your results.

    Best regards,
    Carl Richard

  • Hi,

    Thank you so much for your quick reply.

    Method 1: please check below steps for your information

    step 1:

    I have included CONFIG_BOOTLOADER_MCUBOOT=y and CONFIG_SECURE_BOOT=y in prj.conf file as per your suggestion.

    step 2:

    Disabled below configuration :

    Project -> Configure nRF Connect SDK Project -> menuconfig -> modules -> nrf -> Nordic NRF Connect -> Bootloader -> Select the “Use Secure Bootloader “

    Project -> Configure nRF Connect SDK Project -> menuconfig -> bootoptions ->select the “MCU bootloader support.”

    step 3: 

    compiled code through segger Embedded studio . code compiled without errors but bootloader not configured . only fade_led application compiled.

    NOTE : It seems to be prj.conf file not consider when compile with segger embedded studio.

    Method 2: please check below steps for your information

    step 1: windows command prompt opened as an administrator.

    step 2: windows environment variables created as per project requirement

    step 3: enter below command in the command terminal 

    west build --board nrf5340dk_nrf5340_cpuapp C:/Nordic/v1.5.0/zephyr/samples/basic/fade_led -- -DCONFIG_SECURE_BOOT=y -DCONFIG_BOOTLOADER_MCUBOOT=y

    step 4:  As per my observation, compiled code successfully (with immutable bootloader, mcuboot and application) without any errors.

    step 5: Able to see merged.hex file in C:\v1.5.0\build\zephyr

    step 6 : flashed code into nRF 5340 DK board.

    step 7: As per my observation, bootloader and application running on the board.

    NOTE : It seems to be working when compiled code through command in command prompt. 

    please check below logs for your information.

    -- west build: building application
    [0/184] Generating extra provision key files
    [1/184] Generating signing key
    [3/184] Creating public key from private key used for signing
    [4/184] Creating data to be provisioned to the Bootloader, storing to provision.hex
    [77/184] Performing build step for 'b0_subimage'
    [138/143] Linking C executable zephyr\zephyr_prebuilt.elf
    Memory region Used Size Region Size %age Used
    FLASH: 28344 B 32 KB 86.50%
    SRAM: 4584 B 504 KB 0.89%
    IDT_LIST: 56 B 2 KB 2.73%
    [143/143] Linking C executable zephyr\zephyr.elf
    [162/184] Linking C executable zephyr\zephyr_prebuilt.elf
    Memory region Used Size Region Size %age Used
    FLASH: 31016 B 441856 B 7.02%
    SRAM: 8112 B 504 KB 1.57%
    IDT_LIST: 72 B 2 KB 3.52%
    [173/184] Performing build step for 'mcuboot_subimage'
    [251/256] Linking C executable zephyr\zephyr_prebuilt.elf
    Memory region Used Size Region Size %age Used
    FLASH: 40820 B 48 KB 83.05%
    SRAM: 26380 B 504 KB 5.11%
    IDT_LIST: 72 B 2 KB 3.52%
    [256/256] Linking C executable zephyr\zephyr.elf
    [181/184] Creating signature of application
    [182/184] Creating validation for zephyr.hex, storing to
    [184/184] Generating zephyr/merged.hex

    please suggest me, how can i compile fade_led code with immutable bootloader and mcuboot in segger Embedded Studio. It is more help to me for further proceeding in my project.

    please let me know, if you need any more details from my side. 

    Thanks & Regards,

    Srinivas Rao.

  • Hi again, Srinivas!

    In your "method 1" you should not disable the two bootloaders in menuconfig (step. 2). This will disable MCUBoot and Secure Boot for the whole project, even if they are enabled in the "prj.conf". You should only need to reopen the project and build after the configuration has been added to prj.conf.

    The configuration used by Segger Embedded Studio is generated from prj.conf. You can read more about how to properly configuring your application in the documentation.

    Best regards,
    Carl Richard

  • Hi Carl,

    Thank you so much for your support . 

    I am able to compile code through Segger embedded studio and west command also.

    Thanks & Regards,

    Srinivas.

  • Hello again,

    I'm glad to hear that!

    Best regards,
    Carl Richard

Related