Custom board based on nrf5340 CLAA not working after flashing the application

Hi,

I designed a custom PCB with the nrf5340 CLAA chip and am testing out the board. I want to flash a simple project of lighting up the on-board LED (the LED is connected to P1.07 in my board design). In nrf connect SDK in VS Code, I was able to create a custom board for nrf5340 QKAA (I was told this is fine for CLAA too), add the GPIO pin P1.07 in the DeviceTree, build the project without errors and flash the code to my board via JLink successfully. However, the LED is not lighted up. When I tried to debug, the process always stops at the step “Starting target CPU…” and won’t let me proceed.

I also tried to control the LED directly using JLink.exe via command line (I am using a windows machine because I encountered more issues on mac). I could connect to the chip in JLink. However, I was not able to write the values directly to the registers to light up the LED either. I wrote the values but when I checked the memory at the address, it was still 0. I checked the soldering of my board physically and they are all connected. I measured RESET and Power and they are both around 3.3V. Is there anything that you think I should try to solve this issue? Is there anything specific I should do to flash the code for the first time? (E.g. the chip is initially locked/protected so we can’t write to its memory directly for the first time?) Any advice would be appreciated. Thanks!

  • Hi

    If it's a brand new/fresh SoC there shouldn't be any lock/protection on it, and flashing it should be pretty straight forward. What are you using to program it, an nRF53 DK or similar, or a J-Link debugger? Have you been able to flash a similar project onto a DK to test that the firmware works correctly there, or are you gunning straight for the custom board? Per the product specification there shouldn't be anything special about the P1.07, so it just seems the board hasn't been flashed correctly.

    You can try running an nrfjprog --recover command from the command line, but if you can't detect the board in the first place my guess is there's something wrong with the HW, so perhaps a HW review would be the first step here. You can either create a separate private ticket for that or we can make this ticket Private so you can share schematics and gerber files here.

    Best regards,

    Simon

  • Hi Simonr,

    Thanks for your reply. I am using a J-Link debugger to program it. I don't have a DK to test on so I directly program on my custom board. I am using the SDK v2.9.1 and the corresponding toolchain in nRF Connect SDK in VS Code to program the board. The build and flash process all showed successful message and did not get any errors.

    Actually, I can detect the board after plugging in the J-Link to my laptop. The power on the board is also measured to be 3.3V. 

    I will talk with my collaborators to see whether we can share our schematics and gerber files. Thanks!

    Best,

    Ke

  • Hi

    You can detect the board, if so, can you upload a full log when you try to flash the board so we can see what's happening when trying to flash the board?

    Best regards,

    Simon

  • Hi again Ke

    As Edvin suggested in the HW review ticket, please try following his suggestion to disable the DCDC regulator as per the instructions in this ticket. Note that you're using the one of the newer SDKs, so please start out with the new way of setting it. You can start following the guide from "Then you are using an NCS version where the new way of setting this applies."

    For your questions in the other thread, yes these changes will also apply to custom boards and custom board files. Also note that if the board doesn't get detected enabling the DCDC regulator for a design without the necessary components present might result in the board not working as expected, so you should make these changes and test on a new nRF5340 SoC/custom board design.

    Best regards,

    Simon

  • Hi Simon,

    Thanks for getting back to me. I was able to try what Edvin suggested in the private ticket to set the DCDC regulators off but unfortunately it did not solve my problem. The LED is still not working, I am not able to directly write to registers and I am not able to debug as well. 

    Just want to mention that I am using a TPS62743 Buck Converter on another board which is connected to the board I uploaded in the private ticket to convert the voltage from the Lipo battery to 3.3V. And the output voltage is indeed measured to be 3.3V. I followed the recommended decoupling for nRF5340 CLAA chip, Config 2, when I designed the board. Hence, I think I do have inductors and capacitors connected to Pin A9 (DCCD) and B6 (DCC) which I believe are related to the usage of APP and NET DCDC regulators, as shown in the schematic I uploaded in the private ticket. Hence, I am only disabling the High-Voltage regulator by adding the lines below into a file called nrf5340_platform_nrf5340_cpuapp_ns.overlap in my application folder:

    &vregh {
        status = “disabled”;
    };

    Please note that I also tried disabling all three DCDC regulators but the result turns out to be the same. When I build my project, I set the board target to be nrf5340_platform/nrf5340/cpuapp/ns which I created from the board of nRF5340 in nRF Connect and it is able to build successfully. I am attaching my entire application folder at the end so that you can see my board definition.

    As you can see, I am setting P1.07 high in the main.c:

    #include <stdio.h>
    #include <zephyr/kernel.h>
    #include <zephyr/drivers/gpio.h>
    
    
    /* The devicetree node identifier for the "led0" alias. */
    #define LED0_NODE DT_ALIAS(led0)
    
    /*
     * A build error on this line means your board is unsupported.
     * See the sample documentation for information on how to fix this.
     */
    static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
    
    int main(void) {
        if (!device_is_ready(led.port)) {
            return 0;
        }
        gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
        gpio_pin_set_dt(&led, 1);
    
        return 1;
    }

    I configured this GPIO pin via DeviceTree which can be seen in nrf5340_platform_nrf5340_cpuapp_ns.dts:

    /dts-v1/;
    #include <nordic/nrf5340_cpuappns_qkaa.dtsi>
    #include "nrf5340_platform-pinctrl.dtsi"
    
    / {
    	model = "Custom Board auto generated by nRF Connect for VS Code (CPUAPP Non-Secure)";
    	compatible = "arm,nrf5340-platform-cpuapp-ns";
    
    	chosen {
    		zephyr,sram = &sram0_ns;
    		zephyr,flash = &flash0;
    		zephyr,code-partition = &slot0_ns_partition;
    	};
    
    	leds {
    		compatible = "gpio-leds";
    		led0: led_0 {
    			gpios = <&gpio1 7 0>;
    			label = "led0";
    		};
    	};
    
    	aliases {
    		led0 = &led0;
    	};
    };
    
    #include "nrf5340_platform-cpuapp_partitioning.dtsi"
    #include "nrf5340_platform-shared_sram.dtsi"
    
    &gpio0 {
    	status = "okay";
    };
    
    &gpio1 {
    	status = "okay";
    };
    
    &gpiote {
    	status = "okay";
    };
    

    I was able to build and flash the application to my board but it is not executing. Below is my full build and flash log:

    * Executing task: nRF Connect: Generate config nrf5340_platform/nrf5340/cpuapp/ns for d:\nrf_connect\blinky
    
    Building blinky
    C:\WINDOWS\system32\cmd.exe /d /s /c "west build --build-dir d:/nrf_connect/blinky/build d:/nrf_connect/blinky --pristine --board nrf5340_platform/nrf5340/cpuapp/ns -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=d:/nrf_connect/blinky"
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.9.1/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340_platform, qualifiers: nrf5340/cpuapp/ns
    Parsing C:/ncs/v2.9.1/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'D:/nrf_connect/blinky/build/_sysbuild/empty.conf'
    Merged configuration 'D:/nrf_connect/blinky/build/_sysbuild/empty.conf'
    Configuration saved to 'D:/nrf_connect/blinky/build/zephyr/.config'
    Kconfig header saved to 'D:/nrf_connect/blinky/build/_sysbuild/autoconf.h'
    --
    ****************************
    * Running CMake for blinky *
    ****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: D:/nrf_connect/blinky
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.9.1/zephyr/.cache
    -- Zephyr version: 3.7.99 (C:/ncs/v2.9.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf5340_platform, qualifiers: nrf5340/cpuapp/ns
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b620d30767/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/b620d30767/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: D:/nrf_connect/blinky/boards/arm/nrf5340_platform/nrf5340_platform_nrf5340_cpuapp_ns.dts
    -- Generated zephyr.dts: D:/nrf_connect/blinky/build/blinky/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: D:/nrf_connect/blinky/build/blinky/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: D:/nrf_connect/blinky/build/blinky/zephyr/dts.cmake
    Parsing C:/ncs/v2.9.1/zephyr/Kconfig
    Loaded configuration 'D:/nrf_connect/blinky/boards/arm/nrf5340_platform/nrf5340_platform_nrf5340_cpuapp_ns_defconfig'
    Merged configuration 'D:/nrf_connect/blinky/prj.conf'
    Merged configuration 'D:/nrf_connect/blinky/build/blinky/zephyr/.config.sysbuild'
    Configuration saved to 'D:/nrf_connect/blinky/build/blinky/zephyr/.config'
    Kconfig header saved to 'D:/nrf_connect/blinky/build/blinky/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    =========== Generating psa_crypto_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== End psa_crypto_config ===============
    =========== Generating psa_crypto_library_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== End psa_crypto_library_config ===============
    -- Setting build type to 'MinSizeRel' as none was specified.
    CMake Warning at C:/ncs/v2.9.1/zephyr/CMakeLists.txt:952 (message):
    No SOURCES given to Zephyr library: drivers__console
    
    Excluding target from build.
    
    
    CMake Warning at C:/ncs/v2.9.1/zephyr/CMakeLists.txt:952 (message):
    No SOURCES given to Zephyr library: drivers__serial
    
    Excluding target from build.
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/nrf_connect/blinky/build/blinky
    Dropping partition 'nonsecure_storage' since it is empty.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/nrf_connect/blinky/build
    -- west build: building application
    [4/213] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (C:/ncs/v2.9.1/zephyr), build: v3.7.99-ncs2-1
    [5/213] Generating ../../tfm/CMakeCache.txt
    CMake Warning at cmake/version.cmake:31 (message):
    TFM_VERSION_MANUAL mismatches to actual TF-M version. Please update
    TFM_VERSION_MANUAL in cmake/version.cmake
    Call Stack (most recent call first):
    CMakeLists.txt:13 (include)
    
    
    -- Found Git: C:/ncs/toolchains/b620d30767/mingw64/bin/git.exe (found version "2.37.3.windows.1")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found version "3.12.4") found components: Interpreter
    -- Found Python3: C:/ncs/toolchains/b620d30767/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.9.1/zephyr/.cache
    -- Configuring done
    -- Generating done
    -- Build files have been written to: D:/nrf_connect/blinky/build/blinky/tfm
    [129/133] Linking C executable bin\tfm_s.axf
    Memory region Used Size Region Size %age Used
    FLASH: 32048 B 32 KB 97.80%
    RAM: 10284 B 32 KB 31.38%
    [12/213] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/tfm_ioctl_core_api.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/tfm_ioctl_core_ns_api.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/config_nordic_nrf_spe.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/driver/Driver_Common.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/driver/Driver_Flash.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/driver/Driver_USART.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/startup.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/startup_nrf5340.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/nrfx_glue.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/pal_plat_test.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/pal_plat_test.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/startup.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/target_cfg.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/nrfx_config.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/CMakeLists.txt
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/native_drivers
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/native_drivers/mpu_armv8m_drv.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/native_drivers/mpu_armv8m_drv.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/native_drivers/spu.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/native_drivers/spu.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/cmsis_drivers
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/cmsis_drivers/Driver_Flash.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/cmsis_drivers/Driver_USART.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/common
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/common/cmsis.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/common/nrf-pinctrl.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/common/nrfx_glue.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/common/nrfx_log.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/common/tfm_hal_platform_common.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/nrfx
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/nrfx/nrfx.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/include
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/include/tfm_ioctl_core_api.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/include/tfm_platform_hal_ioctl.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/src
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/src/tfm_ioctl_core_ns_api.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/src/tfm_ioctl_core_s_api.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/services/src/tfm_platform_hal_ioctl.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/tests
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/core/tests/tfm_tests_config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/linker_scripts/tfm_common_ns.ld
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/nrfx_config_nrf5340_application.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/CMakeLists.txt
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/cpuarch.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/tests
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/tests/psa_arch_tests_config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/partition
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/partition/flash_layout.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/common/nrf5340/partition/region_defs.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/CMakeLists.txt
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/cpuarch.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/../common/config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/tests
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/tests/psa_arch_tests_config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/tests/tfm_tests_config.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/bin
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/bin/tfm_s.axf
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/bin/tfm_s.bin
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/bin/tfm_s.elf
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/bin/tfm_s.hex
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/bin/tfm_s.map
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/lib/s_veneers.o
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/client.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/error.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa_manifest/sid.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/config_impl.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/tfm_veneers.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/tfm_ns_interface.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/tfm_ns_client_ext.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/config_tfm.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/config_base.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/tfm_psa_call_pack.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/framework_feature.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/build_info.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_adjust_auto_enabled.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_adjust_config_key_pair_types.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_adjust_config_synonyms.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_compat.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_driver_common.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_driver_contexts_composites.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_driver_contexts_key_derivation.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_driver_contexts_primitives.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_extra.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_legacy.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_platform.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_se_driver.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_sizes.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_struct.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_types.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto_values.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/psa/crypto.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/mbedtls/build_info.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/mbedtls/config_psa.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/nrf-config.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/nrf-psa-crypto-config.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/tfm_platform_api.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/tfm_tz_psa_ns_api.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/os_wrapper
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/os_wrapper/common.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/include/os_wrapper/mutex.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/os_wrapper
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/os_wrapper/tfm_ns_interface_bare_metal.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/os_wrapper/tfm_ns_interface_rtos.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/tfm_crypto_api.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/interface/src/tfm_platform_api.c
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/config/cp_check.cmake
    ----- Installing platform NS -----
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile/cmsis_armclang_a.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile/cmsis_clang_a.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile/cmsis_cp15.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile/cmsis_gcc_a.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile/cmsis_iccarm_a.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/a-profile/irq_ctrl.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/cmsis_compiler.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/cmsis_version.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_ca.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm0.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm0plus.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm1.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm23.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm3.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm33.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm35p.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm4.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm52.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm55.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm7.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_cm85.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_sc000.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_sc300.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/core_starmc1.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/armv7m_cachel1.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/armv7m_mpu.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/armv81m_pac.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/armv8m_mpu.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/armv8m_pmu.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/cmsis_armclang_m.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/cmsis_clang_m.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/cmsis_gcc_m.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/cmsis_iccarm_m.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/m-profile/cmsis_tiarmclang_m.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/ext/cmsis/Include/tz_context.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/boot_hal.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/cmsis_override.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/exception_info.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/fatal_error.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/mbedtls_entropy_nv_seed_config.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/region.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_attest_hal.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_defs.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_device_header.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_interrupt.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_isolation.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_its.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_its_encryption.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_mailbox.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_multi_core.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_platform.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_hal_ps.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_platform_system.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_boot_seed.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_config.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_crypto_keys.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_crypto_nv_seed.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_defs.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_device_id.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_ns.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_nv_counters.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_otp.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_provisioning.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_rotpk.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/tfm_plat_test.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/CMakeLists.txt
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/cmake/toolchain_ns_GNUARM.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/cmake/toolchain_ns_ARMCLANG.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/cmake/toolchain_ns_IARARM.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/platform/include/fih.h
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/cmake/spe_export.cmake
    -- Installing: D:/nrf_connect/blinky/build/blinky/tfm/api_ns/cmake/set_extensions.cmake
    [213/213] Linking C executable zephyr\zephyr.elf
    Memory region Used Size Region Size %age Used
    FLASH: 19792 B 992 KB 1.95%
    RAM: 5856 B 416 KB 1.37%
    IDT_LIST: 0 GB 32 KB 0.00%
    Generating files from D:/nrf_connect/blinky/build/blinky/zephyr/zephyr.elf for board: nrf5340_platform
    [10/10] Generating ../merged.hex
    * Terminal will be reused by tasks, press any key to close it.
    
    * Executing task: nRF Connect: Flash: blinky/blinky (active)
    
    Flashing blinky to 801035505
    C:\WINDOWS\system32\cmd.exe /d /s /c "west flash -d d:\nrf_connect\blinky\build --domain blinky --dev-id 801035505"
    
    -- west flash: rebuilding
    [0/5] Performing build step for 'blinky'
    [0/14] Performing build step for 'tfm'
    ninja: no work to do.
    [2/5] No install step for 'blinky'
    [3/5] Completed 'blinky'
    [4/5] cmd.exe /C "cd /D D:\nrf_connect\blinky\build\_sysbuild && C:\ncs\toolchains\b620d30767\opt\bin\cmake.exe -E true"
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: reset after flashing requested
    -- runners.nrfjprog: Flashing file: D:\nrf_connect\blinky\build\merged.hex
    [ #################### ] 2.137s | Erase file - Done erasing
    [ #################### ] 0.461s | Program file - Done programming
    [ #################### ] 0.287s | Verify file - Done verifying
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 801035505 flashed successfully.
    * Terminal will be reused by tasks, press any key to close it.

    Then I tried to connect to the board via JLink.exe via command line and turn on the LED by directing setting P1.07 to high:

    w4 0x50004514, 0x00000080  # DIRSET (set as output)
    w4 0x5000450C, 0x00000080  # PIN_CNF[7] - Standard output, no pull
    w4 0x50004504, 0x00000080  # OUTSET (drive high)

    I can connect to the board. However, after writing to the registers, when I read the values again, they are all zeros so the setting seems to fail:

    J-Link>mem32 0x50004514,1
    50004514 = 00000000
    J-Link>mem32 0x5000450C,1
    5000450C = 00000000
    J-Link>mem32 0x50004504,1
    50004504 = 00000000

    One thing I noticed is that some of my other GPIO pins are high even if I do not set them high, for example the ones I connected to the castellated holes: P0.16, P0.15, P0.13 and P0.03. I am not sure whether this indicates any issues with my application or my board design.

    Thank you so much for your help! Please let me know if you think there is anything else I can try to get my board working. Looking forward to your reply.

    7317.blinky.zip

Related