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
  • Do you also update the mcuboot.overlay and mcuboot.conf?

    Could you provide the simple project for your ble dfu app?

  • Hi Amanda,

    Thanks for your reply, and sorry for the late response.

    Although my custom board is based on the nRF5340DK, I forgot that my external memory is an MX25R8035F (8 Mbit) instead of the MX25R6435F (64 Mbit) used on the DK. My apologies for that oversight.

    I tried to update the .dts for my memory, but I ran into same issues.
    Following your recommendation, I ran the spi_flash sample to verify the behavior of my external memory.

    Here is the relevant part of my nrf5340dk.overlay:

    / {
      chosen {
     /delete-property/ zephyr,ipc_shm;
     /delete-property/ nordic,pm-ext-flash;
     nordic,pm-ext-flash = &mx25r80;
      };
    };
    
    &mx25r64 {
      status = "disabled";
    };
    
    &qspi {
    	status = "okay";
    	pinctrl-0 = <&qspi_default>;
    	pinctrl-1 = <&qspi_sleep>;
    	pinctrl-names = "default", "sleep";
    	mx25r80: mx25r8035f@0 {
    		compatible = "nordic,qspi-nor";
    		reg = <0>;
    		/* MX25R80 supports only pp and pp4io */
    		writeoc = "pp4io";
    		/* MX25R80 supports all readoc options */
    		readoc = "read4io";
    		sck-frequency = <8000000>;
    		// size = <0x800000>;
    		size-in-bytes = <0x800000>; 
    		jedec-id = [c2 28 14];
    		sfdp-bfp = [
    			e5 20 f1 ff  ff ff 7f 00  44 eb 08 6b  08 3b 04 bb
    			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
    			10 d8 00 ff  23 72 f5 00  82 ed 04 b7  44 83 38 44
    			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
    		];
    		has-dpd;
    		t-enter-dpd = <10000>;
    		t-exit-dpd = <35000>;
    	};
    };


    When I change the sample defines to:
    #define SPI_FLASH_TEST_REGION_OFFSET 0x1000 // or any multiples of 4096 | default value sample was 0xff000

    the sample runs perfectly.
    *** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
    *** Using Zephyr OS v4.0.99-f791c49f492c ***
    
    mx25r8035f@0 SPI flash testing
    ==========================
    
    Perform test on single sector
    Test 1: Flash erase
    Flash erase succeeded!
    
    Test 2: Flash write...Code


    I’m now trying to add this new node to my DFU BLE app. When I configure it in my nrf5340dk_nrf5340_cpuapp.overlay and on my mcuboot.overlay:
    &mx25r80 {
    	status = "okay";
    };
    
    / {
    	chosen {
    		nordic,pm-ext-flash = &mx25r80;
    	};
    };


    But, I get the error:
    devicetree error: /home/santos/Desktop/l9_e5_sol/l9_e5_sol/sysbuild/mcuboot.overlay:1 (column 1): parse error: undefined node label 'mx25r80'
    CMake Error at /home/santos/ncs/v3.0.2/zephyr/cmake/modules/dts.cmake:305 (execute_process):
      execute_process failed command indexes:
      
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      /home/santos/ncs/v3.0.2/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:18 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: mcuboot
    
      Location: /home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /home/santos/ncs/v3.0.2/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/santos/Desktop/l9_e5_sol/l9_e5_sol/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: /home/santos/ncs/toolchains/7cbc0036f4/usr/local/bin/cmake -DWEST_PYTHON=/home/santos/ncs/toolchains/7cbc0036f4/usr/local/bin/python3.12 -B/home/santos/Desktop/l9_e5_sol/l9_e5_sol/build -GNinja -DBOARD=nrf5340dk/nrf5340/cpuapp -S/home/santos/ncs/v3.0.2/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/santos/Desktop/l9_e5_sol/l9_e5_sol
    
    Why isn’t my new node being recognized in my mcuboot.overlay?

    I’ve attached this project to the final ticket.

    Tanks in advance.

    3482.l9_e5_sol.zip

Reply
  • Hi Amanda,

    Thanks for your reply, and sorry for the late response.

    Although my custom board is based on the nRF5340DK, I forgot that my external memory is an MX25R8035F (8 Mbit) instead of the MX25R6435F (64 Mbit) used on the DK. My apologies for that oversight.

    I tried to update the .dts for my memory, but I ran into same issues.
    Following your recommendation, I ran the spi_flash sample to verify the behavior of my external memory.

    Here is the relevant part of my nrf5340dk.overlay:

    / {
      chosen {
     /delete-property/ zephyr,ipc_shm;
     /delete-property/ nordic,pm-ext-flash;
     nordic,pm-ext-flash = &mx25r80;
      };
    };
    
    &mx25r64 {
      status = "disabled";
    };
    
    &qspi {
    	status = "okay";
    	pinctrl-0 = <&qspi_default>;
    	pinctrl-1 = <&qspi_sleep>;
    	pinctrl-names = "default", "sleep";
    	mx25r80: mx25r8035f@0 {
    		compatible = "nordic,qspi-nor";
    		reg = <0>;
    		/* MX25R80 supports only pp and pp4io */
    		writeoc = "pp4io";
    		/* MX25R80 supports all readoc options */
    		readoc = "read4io";
    		sck-frequency = <8000000>;
    		// size = <0x800000>;
    		size-in-bytes = <0x800000>; 
    		jedec-id = [c2 28 14];
    		sfdp-bfp = [
    			e5 20 f1 ff  ff ff 7f 00  44 eb 08 6b  08 3b 04 bb
    			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
    			10 d8 00 ff  23 72 f5 00  82 ed 04 b7  44 83 38 44
    			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
    		];
    		has-dpd;
    		t-enter-dpd = <10000>;
    		t-exit-dpd = <35000>;
    	};
    };


    When I change the sample defines to:
    #define SPI_FLASH_TEST_REGION_OFFSET 0x1000 // or any multiples of 4096 | default value sample was 0xff000

    the sample runs perfectly.
    *** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
    *** Using Zephyr OS v4.0.99-f791c49f492c ***
    
    mx25r8035f@0 SPI flash testing
    ==========================
    
    Perform test on single sector
    Test 1: Flash erase
    Flash erase succeeded!
    
    Test 2: Flash write...Code


    I’m now trying to add this new node to my DFU BLE app. When I configure it in my nrf5340dk_nrf5340_cpuapp.overlay and on my mcuboot.overlay:
    &mx25r80 {
    	status = "okay";
    };
    
    / {
    	chosen {
    		nordic,pm-ext-flash = &mx25r80;
    	};
    };


    But, I get the error:
    devicetree error: /home/santos/Desktop/l9_e5_sol/l9_e5_sol/sysbuild/mcuboot.overlay:1 (column 1): parse error: undefined node label 'mx25r80'
    CMake Error at /home/santos/ncs/v3.0.2/zephyr/cmake/modules/dts.cmake:305 (execute_process):
      execute_process failed command indexes:
      
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      /home/santos/ncs/v3.0.2/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:18 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: mcuboot
    
      Location: /home/santos/ncs/v3.0.2/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /home/santos/ncs/v3.0.2/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /home/santos/ncs/v3.0.2/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/santos/Desktop/l9_e5_sol/l9_e5_sol/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: /home/santos/ncs/toolchains/7cbc0036f4/usr/local/bin/cmake -DWEST_PYTHON=/home/santos/ncs/toolchains/7cbc0036f4/usr/local/bin/python3.12 -B/home/santos/Desktop/l9_e5_sol/l9_e5_sol/build -GNinja -DBOARD=nrf5340dk/nrf5340/cpuapp -S/home/santos/ncs/v3.0.2/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/santos/Desktop/l9_e5_sol/l9_e5_sol
    
    Why isn’t my new node being recognized in my mcuboot.overlay?

    I’ve attached this project to the final ticket.

    Tanks in advance.

    3482.l9_e5_sol.zip

Children
Related