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

SPU NRF53 not run non secure app

No available samples initiate the non-secure CPU (CONFIG_SPM = y)
the secure cpu is loop!

Zephyr master
NRF master


Help me please!

The test consists of running a simple hello world on cpuns nrf5340pdk.

Thank you.

*** Booting Zephyr OS build v2.3.0-rc1-ncs1-1452-g53bfa7b0256a ***
Flash regions Domain Permissions
00 01 0x00000 0x08000 Secure rwxl
02 63 0x08000 0x100000 Non-Secure rwxl

Non-secure callable region 0 placed in flash region 1 with size 32.

SRAM region Domain Permissions
00 07 0x00000 0x10000 Secure rwxl
08 63 0x10000 0x80000 Non-Secure rwxl

Peripheral Domain Status
00 NRF_P0 Non-Secure OK
01 NRF_CLOCK Non-Secure OK
02 NRF_RTC0 Non-Secure OK
03 NRF_RTC1 Non-Secure OK
04 NRF_NFCT Non-Secure OK
05 NRF_NVMC Non-Secure OK
06 NRF_UARTE1 Non-Secure OK
07 NRF_UARTE2 Secure SKIP
08 NRF_TWIM2 Non-Secure OK
09 NRF_SPIM3 Non-Secure OK
10 NRF_TIMER0 Non-Secure OK
11 NRF_TIMER1 Non-Secure OK
12 NRF_TIMER2 Non-Secure OK
13 NRF_SAADC Non-Secure OK
14 NRF_PWM0 Non-Secure OK
15 NRF_PWM1 Non-Secure OK
16 NRF_PWM2 Non-Secure OK
17 NRF_PWM3 Non-Secure OK
18 NRF_IPC Non-Secure OK
19 NRF_VMC Non-Secure OK
20 NRF_FPU Non-Secure OK
21 NRF_EGU1 Non-Secure OK
22 NRF_EGU2 Non-Secure OK
23 NRF_DPPIC Non-Secure OK
24 NRF_GPIOTE1 Non-Secure OK
25 NRF_REGULATORS Non-Secure OK

SPM: NS image at 0x8000
SPM: NS MSP at 0x20014a70
SPM: NS reset vector at 0xa869
SPM: prepare to jump to Non-Secure image.
*** Booting Zephyr OS build v2.3.0-rc1-ncs1-1452-g53bfa7b0256a ***
Flash regions Domain Permissions
00 01 0x00000 0x08000 Secure rwxl
02 63 0x08000 0x100000 Non-Secure rwxl

Non-secure callable region 0 placed in flash region 1 with size 32.

SRAM region Domain Permissions
00 07 0x00000 0x10000 Secure rwxl
08 63 0x10000 0x80000 Non-Secure rwxl

Peripheral Domain Status
00 NRF_P0 Non-Secure OK
01 NRF_CLOCK Non-Secure OK
02 NRF_RTC0 Non-Secure OK
03 NRF_RTC1 Non-Secure OK
Parents
  • I was able to make SPM work on the nRF53 DK and NCS v1.3.0, I did the following:

    • cd zephyr/samples/hello_world
    • west build -b nrf5340pdk_nrf5340_cpuappns && west flash

    Try running nrfjprog --eraseall first if this doesn't work

    Best regards,

    Simon

  • not yet Simon!

    roberto@G5:~/nordic_zephyr/zephyr/samples/hello_world$ west build -b nrf5340pdk_nrf5340_cpuappns && west flash
    -- west build: generating a build system
    Including boilerplate (Zephyr base): /home/roberto/nordic_zephyr/zephyr/cmake/app/boilerplate.cmake
    -- Application: /home/roberto/nordic_zephyr/zephyr/samples/hello_world
    -- Zephyr version: 2.3.99 (/home/roberto/nordic_zephyr/zephyr)
    -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.2") found components: Interpreter 
    -- Board: nrf5340pdk_nrf5340_cpuappns
    ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found toolchain: zephyr (/home/roberto/zephyr-sdk-0.11.4)
    -- Found west: /home/roberto/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Found dtc: /home/roberto/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/roberto/nordic_zephyr/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuappns.dts
    nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:56.42-68.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
    nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:330.19-336.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
    nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:540.31-541.5: Warning (unique_unit_address_if_enabled): /reserved-memory/image@20000000: duplicate unit-address (also used in node /reserved-memory/image_s@20000000)
      also defined at nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:560.14-562.3
    -- Generated zephyr.dts: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/include/generated/devicetree_unfixed.h
    Parsing /home/roberto/nordic_zephyr/zephyr/Kconfig
    Loaded configuration '/home/roberto/nordic_zephyr/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuappns_defconfig'
    Merged configuration '/home/roberto/nordic_zephyr/zephyr/samples/hello_world/prj.conf'
    Configuration saved to '/home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/.config'
    Kconfig header saved to '/home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.0
    -- The CXX compiler identification is GNU 9.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/roberto/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Cache files will be written to: /home/roberto/.cache/zephyr
    Changed board to secure nrf5340pdk_nrf5340_cpuapp (NOT NS)
    
    === child image spm - nrf5340pdk_nrf5340_cpuapp begin ===
    Including boilerplate (Zephyr base): /home/roberto/nordic_zephyr/zephyr/cmake/app/boilerplate.cmake
    -- Application: /home/roberto/nordic_zephyr/nrf/samples/spm
    -- Zephyr version: 2.3.99 (/home/roberto/nordic_zephyr/zephyr)
    -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.2") found components: Interpreter 
    -- Board: nrf5340pdk_nrf5340_cpuapp
    -- Found toolchain: zephyr (/home/roberto/zephyr-sdk-0.11.4)
    -- Found west: /home/roberto/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Found dtc: /home/roberto/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/roberto/nordic_zephyr/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuapp.dts
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:56.42-68.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:330.19-336.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:578.31-579.5: Warning (unique_unit_address_if_enabled): /reserved-memory/image@20000000: duplicate unit-address (also used in node /reserved-memory/image_s@20000000)
      also defined at nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:598.14-600.3
    -- Generated zephyr.dts: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/spm/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/spm/zephyr/include/generated/devicetree_unfixed.h
    Parsing /home/roberto/nordic_zephyr/zephyr/Kconfig
    Loaded configuration '/home/roberto/nordic_zephyr/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/roberto/nordic_zephyr/nrf/samples/spm/prj.conf'
    Configuration saved to '/home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/spm/zephyr/.config'
    Kconfig header saved to '/home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/spm/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.0
    -- The CXX compiler identification is GNU 9.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/roberto/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Cache files will be written to: /home/roberto/.cache/zephyr
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/spm
    === child image spm - nrf5340pdk_nrf5340_cpuapp end ===
    
    Changed board to secure nrf5340pdk_nrf5340_cpuapp (NOT NS)
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build
    -- west build: building application
    [1/146] Preparing syscall dependency handling
    
    [7/146] Performing build step for 'spm_subimage'
    [1/137] Preparing syscall dependency handling
    
    [132/137] Linking C executable zephyr/zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:         32 KB        32 KB    100.00%
                SRAM:        3880 B        64 KB      5.92%
            IDT_LIST:          40 B         2 KB      1.95%
    [137/137] Linking C executable zephyr/zephyr.elf
    [139/146] Linking C executable zephyr/zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       12900 B       992 KB      1.27%
                SRAM:        3976 B       384 KB      1.01%
            IDT_LIST:          56 B         2 KB      2.73%
    [146/146] Generating zephyr/merged_domains.hex
    -- west flash: rebuilding
    [0/9] Performing build step for 'spm_subimage'
    ninja: no work to do.
    [1/2] cd /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/cmake/flash && /usr/bin/cmake -E echo
    
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/merged.hex
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0x8000.
    Erasing page at address 0x9000.
    Erasing page at address 0xA000.
    Erasing page at address 0xB000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 960181693 flashed successfully.
    roberto@G5:~/nordic_zephyr/zephyr/samples/hello_world$ nrfjprog --recover
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.
    roberto@G5:~/nordic_zephyr/zephyr/samples/hello_world$ nrfjprog --eraseall
    Erasing user available code and UICR flash areas.
    Applying system reset.
    roberto@G5:~/nordic_zephyr/zephyr/samples/hello_world$ west build -b nrf5340pdk_nrf5340_cpuappns && west flash
    [0/9] Performing build step for 'spm_subimage'
    ninja: no work to do.
    -- west flash: rebuilding
    [0/9] Performing build step for 'spm_subimage'
    ninja: no work to do.
    [1/2] cd /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/cmake/flash && /usr/bin/cmake -E echo
    
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: Flashing file: /home/roberto/nordic_zephyr/zephyr/samples/hello_world/build/zephyr/merged.hex
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0x8000.
    Erasing page at address 0x9000.
    Erasing page at address 0xA000.
    Erasing page at address 0xB000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 960181693 flashed successfully.
    

    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x80000   Non-Secure      rwxl                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK                                 
    13 NRF_SAADC            Non-Secure      OK                                 
    14 NRF_PWM0             Non-Secure      OK                                 
    15 NRF_PWM1             Non-Secure      OK                                 
    16 NRF_PWM2             Non-Secure      OK                                 
    17 NRF_PWM3             Non-Secure      OK                                 
    18 NRF_IPC              Non-Secure      OK                                 
    19 NRF_VMC              Non-Secure      OK                                 
    20 NRF_FPU              Non-Secure      OK                                 
    21 NRF_EGU1             Non-Secure      OK                                 
    22 NRF_EGU2             Non-Secure      OK                                 
    23 NRF_DPPIC            Non-Secure      OK                                 
    24 NRF_GPIOTE1          Non-Secure      OK                                 
    25 NRF_REGULATORS       Non-Secure      OK                                 
                                                                               
    SPM: NS image at 0x8000                                                    
    SPM: NS MSP at 0x20010648                                                  
    SPM: NS reset vector at 0x8e31                                             
    SPM: prepare to jump to Non-Secure image.                                  
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-1446-g26216d1f7e09  ***        
    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x80000   Non-Secure      rwxl                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK                                 
    13 NRF_SAADC            Non-Secure      OK                                 
    14 NRF_PWM0             Non-Secure      OK                                 
    15 NRF_PWM1             Non-Secure      OK                                 
    16 NRF_PWM2             Non-Secure      OK                                 
    17 NRF_PWM3             Non-Secure      OK                                 
    18 NRF_IPC              Non-Secure      OK                                 
    19 NRF_VMC              Non-Secure      OK                                 
    20 NRF_FPU              Non-Secure      OK                                 
    21 NRF_EGU1             Non-Secure      OK                                 
    22 NRF_EGU2             Non-Secure      OK                                 
    23 NRF_DPPIC            Non-Secure      OK                                 
    24 NRF_GPIOTE1          Non-Secure      OK                                 
    25 NRF_REGULATORS       Non-Secure      OK                                 
                                                                               
    SPM: NS image at 0x8000                                                    
    SPM: NS MSP at 0x20010648                                                  
    SPM: NS reset vector at 0x8e31                                             
    SPM: prepare to jump to Non-Secure image.                                  
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-1446-g26216d1f7e09  ***        
    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x80000   Non-Secure      rwxl                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK            

  • Simon, I redid all the installation of the ncs, use a new board and the results are the same! Secure CPU loop!

  • roberto@G5:~/ncs/zephyr/samples/hello_world$ west build -b nrf5340pdk_nrf5340_cpuappns && west flash
    -- west build: generating a build system
    Including boilerplate (Zephyr base): /home/roberto/ncs/zephyr/cmake/app/boilerplate.cmake
    -- Application: /home/roberto/ncs/zephyr/samples/hello_world
    -- Zephyr version: 2.3.99 (/home/roberto/ncs/zephyr)
    -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west: /home/roberto/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Board: nrf5340pdk_nrf5340_cpuappns
    ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found toolchain: zephyr (/home/roberto/zephyr-sdk-0.11.4)
    -- Found dtc: /home/roberto/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/roberto/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuappns.dts
    nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:55.42-67.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@40000000/kmu@39000)
    nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:329.19-335.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@40000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@40000000/power@5000)
    nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:539.31-540.5: Warning (unique_unit_address_if_enabled): /reserved-memory/image@20000000: duplicate unit-address (also used in node /reserved-memory/image_s@20000000)
      also defined at nrf5340pdk_nrf5340_cpuappns.dts.pre.tmp:559.14-561.3
    -- Generated zephyr.dts: /home/roberto/ncs/zephyr/samples/hello_world/build/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/roberto/ncs/zephyr/samples/hello_world/build/zephyr/include/generated/devicetree_unfixed.h
    Parsing /home/roberto/ncs/zephyr/Kconfig
    Loaded configuration '/home/roberto/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuappns_defconfig'
    Merged configuration '/home/roberto/ncs/zephyr/samples/hello_world/prj.conf'
    Configuration saved to '/home/roberto/ncs/zephyr/samples/hello_world/build/zephyr/.config'
    Kconfig header saved to '/home/roberto/ncs/zephyr/samples/hello_world/build/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.0
    -- The CXX compiler identification is GNU 9.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/roberto/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Cache files will be written to: /home/roberto/.cache/zephyr
    Changed board to secure nrf5340pdk_nrf5340_cpuapp (NOT NS)
    
    === child image spm -  begin ===
    Including boilerplate (Zephyr base): /home/roberto/ncs/zephyr/cmake/app/boilerplate.cmake
    -- Application: /home/roberto/ncs/nrf/samples/spm
    -- Zephyr version: 2.3.99 (/home/roberto/ncs/zephyr)
    -- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.2") found components: Interpreter 
    -- Found west: /home/roberto/.local/bin/west (found suitable version "0.7.2", minimum required is "0.7.1")
    -- Board: nrf5340pdk_nrf5340_cpuapp
    -- Found toolchain: zephyr (/home/roberto/zephyr-sdk-0.11.4)
    -- Found dtc: /home/roberto/zephyr-sdk-0.11.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/roberto/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuapp.dts
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:55.42-67.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/flash-controller@39000: duplicate unit-address (also used in node /soc/peripheral@50000000/kmu@39000)
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:329.19-335.3: Warning (unique_unit_address_if_enabled): /soc/peripheral@50000000/clock@5000: duplicate unit-address (also used in node /soc/peripheral@50000000/power@5000)
    nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:577.31-578.5: Warning (unique_unit_address_if_enabled): /reserved-memory/image@20000000: duplicate unit-address (also used in node /reserved-memory/image_s@20000000)
      also defined at nrf5340pdk_nrf5340_cpuapp.dts.pre.tmp:597.14-599.3
    -- Generated zephyr.dts: /home/roberto/ncs/zephyr/samples/hello_world/build/spm/zephyr/zephyr.dts
    -- Generated devicetree_unfixed.h: /home/roberto/ncs/zephyr/samples/hello_world/build/spm/zephyr/include/generated/devicetree_unfixed.h
    Parsing /home/roberto/ncs/zephyr/Kconfig
    Loaded configuration '/home/roberto/ncs/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340pdk_nrf5340_cpuapp_defconfig'
    Merged configuration '/home/roberto/ncs/nrf/samples/spm/prj.conf'
    Configuration saved to '/home/roberto/ncs/zephyr/samples/hello_world/build/spm/zephyr/.config'
    Kconfig header saved to '/home/roberto/ncs/zephyr/samples/hello_world/build/spm/zephyr/include/generated/autoconf.h'
    -- The C compiler identification is GNU 9.2.0
    -- The CXX compiler identification is GNU 9.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/roberto/zephyr-sdk-0.11.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Cache files will be written to: /home/roberto/.cache/zephyr
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/roberto/ncs/zephyr/samples/hello_world/build/spm
    === child image spm -  end ===
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/roberto/ncs/zephyr/samples/hello_world/build
    -- west build: building application
    [1/145] Preparing syscall dependency handling
    
    [7/145] Performing build step for 'spm_subimage'
    [1/137] Preparing syscall dependency handling
    
    [132/137] Linking C executable zephyr/zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:         32 KB        32 KB    100.00%
                SRAM:        3960 B        64 KB      6.04%
            IDT_LIST:          40 B         2 KB      1.95%
    [137/137] Linking C executable zephyr/zephyr.elf
    [139/145] Linking C executable zephyr/zephyr_prebuilt.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       14728 B       992 KB      1.45%
                SRAM:        4056 B       384 KB      1.03%
            IDT_LIST:          56 B         2 KB      2.73%
    [145/145] Generating zephyr/merged.hex
    -- west flash: rebuilding
    [0/9] Performing build step for 'spm_subimage'
    ninja: no work to do.
    [1/2] cd /home/roberto/ncs/zephyr/samples/hello_world/build/zephyr/cmake/flash && /usr/bin/cmake -E echo
    
    -- west flash: using runner nrfjprog
    Using board 960181693
    -- runners.nrfjprog: Flashing file: /home/roberto/ncs/zephyr/samples/hello_world/build/zephyr/merged.hex
    Parsing hex file.
    Erasing page at address 0x0.
    Erasing page at address 0x1000.
    Erasing page at address 0x2000.
    Erasing page at address 0x3000.
    Erasing page at address 0x4000.
    Erasing page at address 0x5000.
    Erasing page at address 0x6000.
    Erasing page at address 0x7000.
    Erasing page at address 0x8000.
    Erasing page at address 0x9000.
    Erasing page at address 0xA000.
    Erasing page at address 0xB000.
    Applying system reset.
    Checking that the area to write is not protected.
    Programming device.
    Applying pin reset.
    -- runners.nrfjprog: Board with serial number 960181693 flashed successfully.
    

    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x8cre    rwxl                                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK                                 
    13 NRF_SAADC            Non-Secure      OK                                 
    14 NRF_PWM0             Non-Secure      OK                                 
    15 NRF_PWM1             Non-Secure      OK                                 
    16 NRF_PWM2             Non-Secure      OK                                 
    17 NRF_PWM3             Non-Secure      OK                                 
    18 NRF_IPC              Non-Secure      OK                                 
    19 NRF_VMC              Non-Secure      OK                                 
    20 NRF_FPU              Non-Secure      OK                                 
    21 NRF_EGU1             Non-Secure      OK                                 
    22 NRF_EGU2             Non-Secure      OK                                 
    23 NRF_DPPIC            Non-Secure      OK                                 
    24 NRF_GPIOTE1          Non-Secure      OK                                 
    25 NRF_REGULATORS       Non-Secure      OK                                 
                                                                               
    SPM: NS image at 0x8000                                                    
    SPM: NS MSP at 0x20010698                                                  
    SPM: NS reset vector at 0x9121                                             
    SPM: prepare to jump to Non-Secure image.                                  
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-2407-g91d81dc7e0ce  ***        
    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x80000   Non-Secure      rwxl                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK                                 
    13 NRF_SAADC            Non-Secure      OK                                 
    14 NRF_PWM0             Non-Secure      OK                                 
    15 NRF_PWM1             Non-Secure      OK                                 
    16 NRF_PWM2             Non-Secure      OK                                 
    17 NRF_PWM3             Non-Secure      OK                                 
    18 NRF_IPC              Non-Secure      OK                                 
    19 NRF_VMC              Non-Secure      OK                                 
    20 NRF_FPU              Non-Secure      OK                                 
    21 NRF_EGU1             Non-Secure      OK                                 
    22 NRF_EGU2             Non-Secure      OK                                 
    23 NRF_DPPIC            Non-Secure      OK                                 
    24 NRF_GPIOTE1          Non-Secure      OK                                 
    25 NRF_REGULATORS       Non-Secure      OK                                 
                                                                               
    SPM: NS image at 0x8000                                                    
    SPM: NS MSP at 0x20010698                                                  
    SPM: NS reset vector at 0x9121                                             
    SPM: prepare to jump to Non-Secure image.                                  
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-2407-g91d81dc7e0ce  ***        
    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x80000   Non-Secure      rwxl                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK                                 
    13 NRF_SAADC            Non-Secure      OK                                 
    14 NRF_PWM0             Non-Secure      OK                                 
    15 NRF_PWM1             Non-Secure      OK                                 
    16 NRF_PWM2             Non-Secure      OK                                 
    17 NRF_PWM3             Non-Secure      OK                                 
    18 NRF_IPC              Non-Secure      OK                                 
    19 NRF_VMC              Non-Secure      OK                                 
    20 NRF_FPU              Non-Secure      OK                                 
    21 NRF_EGU1             Non-Secure      OK                                 
    22 NRF_EGU2             Non-Secure      OK                                 
    23 NRF_DPPIC            Non-Secure      OK                                 
    24 NRF_GPIOTE1          Non-Secure      OK                                 
    25 NRF_REGULATORS       Non-Secure      OK                                 
                                                                               
    SPM: NS image at 0x8000                                                    
    SPM: NS MSP at 0x20010698                                                  
    SPM: NS reset vector at 0x9121                                             
    SPM: prepare to jump to Non-Secure image.                                  
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-2407-g91d81dc7e0ce  ***        
    Flash regions           Domain          Permissions                        
    00 01 0x00000 0x08000   Secure          rwxl                               
    02 63 0x08000 0x100000  Non-Secure      rwxl                               
                                                                               
    Non-secure callable region 0 placed in flash region 1 with size 32.        
                                                                               
    SRAM region             Domain          Permissions                        
    00 07 0x00000 0x10000   Secure          rwxl                               
    08 63 0x10000 0x80000   Non-Secure      rwxl                               
                                                                               
    Peripheral              Domain          Status                             
    00 NRF_P0               Non-Secure      OK                                 
    01 NRF_CLOCK            Non-Secure      OK                                 
    02 NRF_RTC0             Non-Secure      OK                                 
    03 NRF_RTC1             Non-Secure      OK                                 
    04 NRF_NFCT             Non-Secure      OK                                 
    05 NRF_NVMC             Non-Secure      OK                                 
    06 NRF_UARTE1           Non-Secure      OK                                 
    07 NRF_UARTE2           Secure          SKIP                               
    08 NRF_TWIM2            Non-Secure      OK                                 
    09 NRF_SPIM3            Non-Secure      OK                                 
    10 NRF_TIMER0           Non-Secure      OK                                 
    11 NRF_TIMER1           Non-Secure      OK                                 
    12 NRF_TIMER2           Non-Secure      OK                                 
    13 NRF_SAADC            Non-Secure      OK                                 
    14 NRF_PWM0             Non-Secure      OK                                 
    15 NRF_PWM1             Non-Secure      OK                                 
    16 NRF_PWM2             Non-Secure      OK                                 
    17 NRF_PWM3             Non-Secure      OK                                 
    18 NRF_IPC              Non-Secure      OK                                 
    19 NRF_VMC              Non-Secure      OK                                 
    20 NRF_FPU              Non-Secure      OK                                 
    21 NRF_EGU1             Non-Secure      OK                                 
    22 NRF_EGU2             Non-Secure      OK                                 
    23 NRF_DPPIC            Non-Secure      OK                                 
    24 NRF_GPIOTE1          Non-Secure      OK                                 
    25 NRF_REGULATORS       Non-Secure      OK                                 
                                                                               
    SPM: NS image at 0x8000                                                    
    SPM: NS MSP at 0x20010698                                                  
    SPM: NS reset vector at 0x9121                                             
    SPM: prepare to jump to Non-Secure image.                                  
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-2407-g91d81dc7e0ce  ***  

  • Based on this log from the initial post:

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1-1452-g53bfa7b0256a ***
    It does not seem like you're using the correct version of NCS/Zephyr. I'm getting the following:

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***

    Try updating to NCS v1.3.0.

    If you've installed it manually:

    cd zephyr/nrf
    git checkout v1.3.0
    west update

    You could also install NCS v1.3.0 using the Toolchain Manager.

    Try this and see if you're errors goes away.

    Best regards,

    Simon

  • Hi Simon, 

    keep getting error!

    I get bus fault!

    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***        
    Flash regions           Domain          Permissions     
    00 01 0x00000 0x08000   Secure          rwxl            
    02 63 0x08000 0x100000  Non-Secure      rwxl            
                                                            
    Non-secure callable region 0 placed in flash region 1 w.
                                                            
    SRAM region             Domain          Permissions     
    00 07 0x00000 0x10000   Secure          rwxl            
    08 63 0x10000 0x80000   Non-Secure      rwxl            
                                                            
    Peripheral              Domain          Status          
    00 NRF_P0               Non-Secure      OK              
    01 NRF_CLOCK            Non-Secure      OK              
    02 NRF_RTC0             Non-Secure      OK              
    03 NRF_RTC1             Non-Secure      OK              
    04 NRF_NVMC             Non-Secure      OK              
    05 NRF_UARTE1           Non-Secure      OK              
    06 NRF_UARTE2           Secure          SKIP            
    07 NRF_TWIM2            Non-Secure      OK              
    08 NRF_SPIM3            Non-Secure      OK              
    09 NRF_TIMER0           Non-Secure      OK              
    10 NRF_TIMER1           Non-Secure      OK              
    11 NRF_TIMER2           Non-Secure      OK              
    12 NRF_SAADC            Non-Secure      OK              
    13 NRF_PWM0             Non-Secure      OK              
    14 NRF_PWM1             Non-Secure      OK              
    15 NRF_PWM2             Non-Secure      OK              
    16 NRF_PWM3             Non-Secure      OK              
    17 NRF_IPC              Non-Secure      OK              
    18 NRF_VMC              Non-Secure      OK              
    19 NRF_FPU              Non-Secure      OK              
    20 NRF_EGU1             Non-Secure      OK              
    21 NRF_EGU2             Non-Secure      OK              
    22 NRF_DPPIC            Non-Secure      OK              
    23 NRF_GPIOTE1          Non-Secure      OK              
    24 NRF_REGULATORS       Non-Secure      OK              
                                                            
    SPM: NS image at 0x8000                                 
    SPM: NS MSP at 0x20010630                               
    SPM: NS reset vector at 0x8f21                          
    SPM: prepare to jump to Non-Secure image.               
    *** Booting Zephyr OS build v2.3.0-rc1-ncs1  ***        
    Flash regions           Domain          Permissions     
    00 01 0x00000 0x08000   Secure          rwxl            
    02 63 0x08000 0x100000  Non-Secure      rwxl            
                                                            
    Non-secure callable region 0 placed in flash region 1 w.
                                                            
    SRAM region             Domain          Permissions     
    00 07 0x00000 0x10000   Secure          rwxl            
    08 63 0x10000 0x80000   Non-Secure      rwxl            
                                                            
    Peripheral              Domain          Status          
    00 NRF_P0               Non-Secure      OK              
    01 NRF_CLOCK            Non-Secure      OK              
    02 NRF_RTC0             Non-Secure      OK              
    03 NRF_RTC1             Non-Secure      OK              
    04 NRF_NVMC             Non-Secure      OK              
    05 NRF_UARTE1           Non-Secure      OK              
    06 NRF_UARTE2           Secure          SKIP            
    07 NRF_TWIM2            Non-Secure      OK              
    08 NRF_SPIM3            Non-Secure      OK              
    09 NRF_TIMER0           Non-Secure      OK              
    10 NRF_TIMER1           Non-Secure      OK              
    11 NRF_TIMER2           Non-Secure      OK              
    12 NRF_SAADC            Non-Secure      OK              
    13 NRF_PWM0             Non-Secure      OK              
    14 NRF_PWM1             Non-Secure      OK              
    15 NRF_PWM2             Non-Secure      OK              
    16 NRF_PWM3             Non-Secure      OK              
    17 NRF_IPC              Non-Secure      OK              
    18 NRF_VMC              Non-Secure      OK              
    19 NRF_FPU              Non-Secure      OK              
    20 NRF_EGU1             Non-Secure      OK              
    21 NRF_EGU2             Non-Secure      OK              
    22 NRF_DPPIC            Non-Secure      OK              
    23 NRF_GPIOTE1          Non-Secure      OK              
    24 NRF_REGULATORS       Non-Secure      OK              
                                                            
    SPM: NS image at 0x8000                                 
    SPM: NS MSP at 0x20010630                               
    SPM: NS reset vector at 0x8f21                          
    SPM: prepare to jump to Non-Secure image.               
    

    Bus Fault

  • That is strange. Eariler I told you to run rfjprog --eraseall first. Could you instead run nrfjprog -f NRF53 --eraseall, to specify that the flash in the application core should get erasesd.

    Could you test this file?

    merged.hex

    Then run the following commands:

    nrfjprog -f NRF53 --eraseall
    nrfjprog -f NRF53 --program merged.hex
    
    nrfjprog --pinreset

    If that doesn't work, could you upload the file zephyr\samples\hello_world\build\zephyr\merged.hex, and I can test it on my board.

    Best regards,

    Simon

Reply
  • That is strange. Eariler I told you to run rfjprog --eraseall first. Could you instead run nrfjprog -f NRF53 --eraseall, to specify that the flash in the application core should get erasesd.

    Could you test this file?

    merged.hex

    Then run the following commands:

    nrfjprog -f NRF53 --eraseall
    nrfjprog -f NRF53 --program merged.hex
    
    nrfjprog --pinreset

    If that doesn't work, could you upload the file zephyr\samples\hello_world\build\zephyr\merged.hex, and I can test it on my board.

    Best regards,

    Simon

Children
  • Hi Simon! tks for the answer!

    FYI nrfjprog -f NRF53 --eraseall no effect, I have been using --recover to clear the flash and the UCR!

    Your merged.hex doesn't work either!

    I found a flaw in the jump to the correct block of the flash, to get around this in this case I am changing the file spm.c line 38 from:
    ((NON_SECURE_APP_ADDRESS) / (FLASH_SECURE_ATTRIBUTION_REGION_SIZE))
    for:
    ((NON_SECURE_APP_ADDRESS) / (FLASH_SECURE_ATTRIBUTION_REGION_SIZE) -1)

    but it gives me problems when I start MCUBOOT!

    I need to implement FOTA and I need MCUBOOT to work!

    another test I did was with the NCS V1.2.0 version, it seems to work, but the development of my sw depends on some features already implemented in the latest version!

    0572.hello_world.zip

  • This ticket was marked as "Verified" and it was removed from my queue, and that is the reson I haven't answered you. I will look into this.

Related