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

NRF5340 FOTA, system reset after pairing

Hi,

I am trying to evaluate nRF5340 FOTA update via Bluetooth.  I started with the Bluetooth/peripheral code sample as the basis for my project.  I modified the project per notes found in a previous DevZone post nRF5340 FOTA upgrade over Bluetooth and Working with nRF5340 notes for the nRF SDK v1.4.0.

The application will boot and advertise on bluetooth.  The bootloader appears to operate correctly as it will boot to a new image if I write an app_moved_test_update.hex file to the nRF5340 using the nrfjprog tool.

When I try to connect to the nRF5340 using Device Manager on an Android 8.1 phone, the nRF5340 will crash and reset after pairing.  The following is data captured from the serial port of the nRF5340 showing system boot, pairing passkey, error codes and subsequent reboot.

    
*** Booting Zephyr OS build v2.4.0-ncs1  ***                                    
[00:00:00.256,317] <inf> mcuboot: Starting bootloader                           
[00:00:00.262,451] <inf> mcuboot: Primary image: magic=unset, swap_type=0x1, cop
y_done=0x3, image_ok=0x3                                                        
[00:00:00.272,430] <inf> mcuboot: Boot source: none                             
[00:00:00.277,862] <inf> mcuboot: Swap type: none                               
[00:00:00.473,754] <inf> mcuboot: Bootloader chainload address offset: 0xc000   
[00:00:00.481,384] <inf> mcuboot: Jumping to the first image slot               
*** Booting Zephyr OS build v2.4.0-ncs1  ***                                    
LED0 GPIO initialized                                                           
[00:00:00.009,826] <inf> fs_nvs: 2 Sectors of 4096 bytes                        
[00:00:00.009,857] <inf> fs_nvs: alloc wra: 0, f88                              
[00:00:00.009,857] <inf> fs_nvs: data wra: 0, a8                                
[00:00:00.024,688] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.024,688] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)               
[00:00:00.024Completed : bt_enable()                                            
Bluetooth initialized                                                           
,688] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version 
207.3932Advertising successfully started                                        
Completed : bt_ready()                                                          
Completed : bt_conn_cb_register()                                               
Completed : bt_conn_auth_cb_register()                                          
Completed : btfunctions_init()                                                  
Completed : os_mgmt_register_group()                                            
Completed : btfunctions_start_smp_bluetooth()                                   
Application CPU main loop initialized                                           
 Build 3617359889                                                               
[00:00:00.025,238] <wrn> bt_hci_core: ECC HCI commands not available            
[00:00:00.025,238] <inf> bt_hci_core: No ID address. App must call settings_load
()                                                                              
[00:00:00.056,732] <inf> bt_hci_core: Identity: f5:ce:76:b2:87:8f (random)      
[00:00:00.056,732] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x2123, m
anufacturer 0x0059                                                              
[00:00:00.056,732] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0x2123     
Connected                                                                       
Passkey for 7f:10:fb:88:66:24 (random): 143912                                  
ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:
375                                                                             
        k_sem_take failed with err -11                                          
[00:01:36.461,547] <err> os: r0/a1:  0x00000003  r1/a2:  0x0099b000  r2/a3:  0x0
0000001                                                                         
[00:01:36.461,547] <err> os: r3/a4:  0x00010769 r12/ip:  0x00000000 r14/lr:  0x0
00151d5                                                                         
[00:01:36.461,547] <err> os:  xpsr:  0x61000000                                 
[00:01:36.461,547] <err> os: Faulting instruction address (r15/pc): 0x000151e0  
[00:01:36.461,578] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0     
[00:01:36.461,578] <err> os: Current thread: 0x20000c80 (unknown)               
[00:01:36.507,019] <err> fatal_error: Resetting system                          
*** Booting Zephyr OS build v2.4.0-ncs1  ***                                    
[00:00:00.256,317] <inf> mcuboot: Starting bootloader                           
[00:00:00.262,451] <inf> mcuboot: Primary image: magic=unset, swap=0x1, copy_don
e=0x3, image_ok=0x3                                                             
[00:00:00.27200:00 <inf> mcuboot: Boot source: none                             
[00:00:00.277,862] <inf> mcuboot: Swap type: none                               
[00:00:00.473,693] <inf> mcuboot: Bootloader chainload address offset: 0xc000   
[00:00:00.481,353] <inf> mcuboot: Jumping to the first image slot               
*** Booting Zephyr OS build v2.4.0-ncs1  ***                                    
LED0 GPIO initialized                                                           
[00:00:00.009,826] <inf> fs_nvs: 2 Sectors of 4096 bytes                        
[00:00:00.009,826] <inf> fs_nvs: alloc wra: 0, f78                              
[00:00:00.009,857] <inf> fs_nvs: data wra: 0, c8                                
[00:00:00.024,597] <inf> bt_hci_core: HW Platform: Nordic Semiconductor (0x0002)
[00:00:00.024,597] <inf> bt_hci_core: HW Variant: nRF53x (0x0003)               
[00:00:00.02Completed : bt_enable()                                             
Bluetooth initialized                                                           
4,597] <inf> bt_hci_core: Firmware: Standard Bluetooth controller (0x00) Version
 207.3932 Build 3617359889                                                      
[00:00:00.025,146] <wrn> bt_hci_core: ECC HCI commands not available            
[00:00:00.025,146] <inf> bt_hci_core: No ID address. App must call settings_load
()                                                                              
[00Advertising successfully started                                             
Completed : bt_ready()                                                          
Completed : bt_conn_cb_register()                                               
Completed : bt_conn_auth_cb_register()                                          
Completed : btfunctions_init()                                                  
Completed : os_mgmt_register_group()                                            
Completed : btfunctions_start_smp_bluetooth()                                   
Application CPU main loop initialized                                           
:00:00.056,610] <inf> bt_hci_core: Identity: f5:ce:76:b2:87:8f (random)         
[00:00:00.056,640] <inf> bt_hci_core: HCI: version 5.2 (0x0b) revision 0x2123, m
anufacturer 0x0059                                                              
[00:00:00.056,640] <inf> bt_hci_core: LMP: version 5.2 (0x0b) subver 0x2123 

On each boot there is a warning for ECC HCI commands not available and a message of No ID address.  App must call settings_load  ( see lines 28 & 29 ).  Do either of these indicate a condition that could lead to the fault?  What needs to be done to eliminate those messages on boot?

Have you seen this type of fault before?

Do you have a complete known good nRF5340 FOTA project that has been tested with Device Manager on Android 8 that I could use as a comparison?

Thank you for your help.

Doug Young

Parents
  • I was able to perform FOTA (Bluetooth) using an nRF5340 PDK v0.7.0 and the smp_svr sample (NCS v1.4.0), with the nRF Connect Device Manager app on a Galaxy S8+

    I did the following:

    • cd into C:\Users\Simon\ncs\v1.4.0\zephyr\samples\subsys\mgmt\mcumgr\smp_svr
    • Connect the nRF5340 PDK to the computer and turn it on
    • Run west build -b nrf5340pdk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-bt.conf && cd build && west flash
    • Add CONFIG_BOOTLOADER_MCUBOOT=y to <..>/zephyr/samples/hello_world/prj.conf
    • cd into zephyr/samples/hello_world
    • Run west build -b nrf5340pdk_nrf5340_cpuapp -d build_dfu
    • Transfer <..>/zephyr/samples/hello_world/build_dfu/zephyr/app_update.bin to the phone
    • Install and open the nRF Connect Device Manager app on the phone, then connect to the nRF5340 which should be advertising with the name "Zephyr"
    • Perform a Firmware Upgrade using the app_update.bin file
    • You should see the following log from a serial terminal (e.g. Termite) from the nRF5340 if the DFU update was successful:

    *** Booting Zephyr OS build v2.4.0-ncs1  ***
    [00:00:00.393,157] [1B][0m<inf> mcuboot: Starting bootloader[1B][0m
    [00:00:00.399,322] [1B][0m<inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3[1B][0m
    [00:00:00.409,362] [1B][0m<inf> mcuboot: Boot source: none[1B][0m
    [00:00:00.414,825] [1B][0m<inf> mcuboot: Swap type: none[1B][0m
    [00:00:00.625,457] [1B][0m<inf> mcuboot: Bootloader chainload address offset: 0x10000[1B][0m
    [00:00:00.633,209] [1B][0m<inf> mcuboot: Jumping to the first image slot[1B][0m
    *** Booting Zephyr OS build v2.4.0-ncs1  ***
    
    
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.005,889] [1B][0m<inf> littlefs: LittleFS version 2.2, disk version 2.0[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,072] [1B][0m<inf> littlefs: FS at NRF_FLASH_DRV_NAME:0xfa000 is 6 0x1000-byte blocks with 512 cycle[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,103] [1B][0m<inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,195] [1B][1;31m<err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:997: Corrupted dir pair at {0x0, 0x1}[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,195] [1B][1;33m<wrn> littlefs: can't mount (LFS -84); formatting[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.183,441] [1B][0m<inf> littlefs: /lfs mounted[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.184,173] [1B][0m<inf> smp_sample: build time: Dec 21 2020 12:10:12[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.200,561] [1B][0m<inf> smp_bt_sample: Bluetooth initialized[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.204,833] [1B][0m<inf> smp_bt_sample: Advertising successfully started[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:07:20.533,905] [1B][0m<inf> smp_bt_sample: Connected[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[1B][1;32muart:~$ [1B][m*** Booting Zephyr OS build v2.4.0-ncs1  ***
    [00:00:00.257,781] [1B][0m<inf> mcuboot: Starting bootloader[1B][0m
    [00:00:00.263,946] [1B][0m<inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3[1B][0m
    [00:00:00.273,986] [1B][0m<inf> mcuboot: Boot source: none[1B][0m
    [00:00:00.279,449] [1B][0m<inf> mcuboot: Swap type: test[1B][0m
    [00:00:14.912,750] [1B][0m<inf> mcuboot: Bootloader chainload address offset: 0x10000[1B][0m
    [00:00:14.920,532] [1B][0m<inf> mcuboot: Jumping to the first image slot[1B][0m
    *** Booting Zephyr OS build v2.4.0-ncs1  ***
    Hello World! nrf5340pdk_nrf5340_cpuapp

Reply
  • I was able to perform FOTA (Bluetooth) using an nRF5340 PDK v0.7.0 and the smp_svr sample (NCS v1.4.0), with the nRF Connect Device Manager app on a Galaxy S8+

    I did the following:

    • cd into C:\Users\Simon\ncs\v1.4.0\zephyr\samples\subsys\mgmt\mcumgr\smp_svr
    • Connect the nRF5340 PDK to the computer and turn it on
    • Run west build -b nrf5340pdk_nrf5340_cpuapp -- -DOVERLAY_CONFIG=overlay-bt.conf && cd build && west flash
    • Add CONFIG_BOOTLOADER_MCUBOOT=y to <..>/zephyr/samples/hello_world/prj.conf
    • cd into zephyr/samples/hello_world
    • Run west build -b nrf5340pdk_nrf5340_cpuapp -d build_dfu
    • Transfer <..>/zephyr/samples/hello_world/build_dfu/zephyr/app_update.bin to the phone
    • Install and open the nRF Connect Device Manager app on the phone, then connect to the nRF5340 which should be advertising with the name "Zephyr"
    • Perform a Firmware Upgrade using the app_update.bin file
    • You should see the following log from a serial terminal (e.g. Termite) from the nRF5340 if the DFU update was successful:

    *** Booting Zephyr OS build v2.4.0-ncs1  ***
    [00:00:00.393,157] [1B][0m<inf> mcuboot: Starting bootloader[1B][0m
    [00:00:00.399,322] [1B][0m<inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3[1B][0m
    [00:00:00.409,362] [1B][0m<inf> mcuboot: Boot source: none[1B][0m
    [00:00:00.414,825] [1B][0m<inf> mcuboot: Swap type: none[1B][0m
    [00:00:00.625,457] [1B][0m<inf> mcuboot: Bootloader chainload address offset: 0x10000[1B][0m
    [00:00:00.633,209] [1B][0m<inf> mcuboot: Jumping to the first image slot[1B][0m
    *** Booting Zephyr OS build v2.4.0-ncs1  ***
    
    
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.005,889] [1B][0m<inf> littlefs: LittleFS version 2.2, disk version 2.0[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,072] [1B][0m<inf> littlefs: FS at NRF_FLASH_DRV_NAME:0xfa000 is 6 0x1000-byte blocks with 512 cycle[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,103] [1B][0m<inf> littlefs: sizes: rd 16 ; pr 16 ; ca 64 ; la 32[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,195] [1B][1;31m<err> littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:997: Corrupted dir pair at {0x0, 0x1}[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.006,195] [1B][1;33m<wrn> littlefs: can't mount (LFS -84); formatting[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.183,441] [1B][0m<inf> littlefs: /lfs mounted[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.184,173] [1B][0m<inf> smp_sample: build time: Dec 21 2020 12:10:12[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.200,561] [1B][0m<inf> smp_bt_sample: Bluetooth initialized[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:00:00.204,833] [1B][0m<inf> smp_bt_sample: Advertising successfully started[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[1B][1;32muart:~$ [1B][m[1B][8D[1B][J[00:07:20.533,905] [1B][0m<inf> smp_bt_sample: Connected[1B][0m
    [1B][1;32muart:~$ [1B][m[1B][8D[1B][J[1B][1;32muart:~$ [1B][m*** Booting Zephyr OS build v2.4.0-ncs1  ***
    [00:00:00.257,781] [1B][0m<inf> mcuboot: Starting bootloader[1B][0m
    [00:00:00.263,946] [1B][0m<inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3[1B][0m
    [00:00:00.273,986] [1B][0m<inf> mcuboot: Boot source: none[1B][0m
    [00:00:00.279,449] [1B][0m<inf> mcuboot: Swap type: test[1B][0m
    [00:00:14.912,750] [1B][0m<inf> mcuboot: Bootloader chainload address offset: 0x10000[1B][0m
    [00:00:14.920,532] [1B][0m<inf> mcuboot: Jumping to the first image slot[1B][0m
    *** Booting Zephyr OS build v2.4.0-ncs1  ***
    Hello World! nrf5340pdk_nrf5340_cpuapp

Children
No Data
Related