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
  • 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

  • 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