Issue Running DFU Sample on Custom Board with nRF5340 SDK v3.0.2

I'm trying to run the DFU sample l9_e5_sol on a custom board using the nRF5340 and SDK version 3.0.2.

My goal is to perform DFU over BLE using external flash. However, before getting to that, I'm facing an issue that occurs even without enabling external flash.

I added the following configuration fragments to prj.conf:

# Debug
CONFIG_DEBUG=y
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_DEBUG_OPTIMIZATIONS=y

# LOG and RTT
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_RTT_CONSOLE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_MODE_IMMEDIATE=y

# Clock
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y
CONFIG_SOC_ENABLE_LFXO=n

My custom board does not have an external low-frequency clock (LFXO), so I intend to synthesize it from the high-frequency clock (HFCLK).

The project builds and flashes successfully, but it seems the code doesn't actually run on the MCU. I don't see any RTT logs, and when I try to start a debug session, the debug task finishes immediately.

Interestingly, when I run the same code with the same configuration fragments on an nRF54L15 DK, I'm able to perform BLE DFU without any problems.

Does anyone have any suggestions on what might be wrong or how I can further debug this issue?

Thanks in advance for your help!

Parents
  • Hi, 

    My goal is to perform DFU over BLE using external flash. However, before getting to that, I'm facing an issue that occurs even without enabling external flash.

    Try to also add the setting in mcuboot.conf file under the sysbuild folder.

    Regards,
    Amanda H.

  • Hello Amanda,

    Thanks for your reply — your previous suggestion worked for me.

    Now I’m trying to run the same sample using my custom project structure and external memory. I’m using an mx25r64 with the same pinout as on the nRF5340DK.

    When I enable the fragment

    SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y,
    my code doesn’t seem to run on the MCU, since neither RTT nor debug mode on app show any activity. However, when I set.
     
    SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n,

    I’m able to run DFU successfully.

    Running the debug mode on mcu_boot, the code stop on loader.c:

            for (slot = 0; slot < BOOT_NUM_SLOTS; slot++) {
                fa_id = flash_area_id_from_multi_image_slot(image_index, slot);
                rc = flash_area_open(fa_id, &BOOT_IMG_AREA(state, slot));
                assert(rc == 0);
    
                if (rc != 0) {
                    BOOT_LOG_ERR("Failed to open flash area ID %d (image %d slot %d): %d, "
                                 "cannot continue", fa_id, image_index, (int8_t)slot, rc);
                                 
                    FIH_PANIC; <== Stoped here
                }
            }

    Could you please review my code to check if there are any gaps or misconfigurations I may have missed?

    Thanks in advance for your support.l9_e5_sol.zip

Reply
  • Hello Amanda,

    Thanks for your reply — your previous suggestion worked for me.

    Now I’m trying to run the same sample using my custom project structure and external memory. I’m using an mx25r64 with the same pinout as on the nRF5340DK.

    When I enable the fragment

    SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y,
    my code doesn’t seem to run on the MCU, since neither RTT nor debug mode on app show any activity. However, when I set.
     
    SB_CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=n,

    I’m able to run DFU successfully.

    Running the debug mode on mcu_boot, the code stop on loader.c:

            for (slot = 0; slot < BOOT_NUM_SLOTS; slot++) {
                fa_id = flash_area_id_from_multi_image_slot(image_index, slot);
                rc = flash_area_open(fa_id, &BOOT_IMG_AREA(state, slot));
                assert(rc == 0);
    
                if (rc != 0) {
                    BOOT_LOG_ERR("Failed to open flash area ID %d (image %d slot %d): %d, "
                                 "cannot continue", fa_id, image_index, (int8_t)slot, rc);
                                 
                    FIH_PANIC; <== Stoped here
                }
            }

    Could you please review my code to check if there are any gaps or misconfigurations I may have missed?

    Thanks in advance for your support.l9_e5_sol.zip

Children
Related