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

Secure Bootloader With SES

Hi

 I am using SDK 14.2 secure bootloader with IAR and SES build. My IAR project is working with DFU upgradation but my SES Hex file is not working

Procedure Followed:

 1. Create Privatekey.pem file using nrfutil

2. add publickey in source file of IAR and SES workspace

3. Compile binary

4. load softdevice and bootloader binary in nrf52

5. using nrfutil create Application.zip file of application version 4 ,dfu application.zip is working in IAR bootloader build binary not with ses

Issue facing:

  In nrfconnect,dfu process is going ,and able to see application sent successfully .But nrf52 in bootloader mode itself .it is not switch into application mode. in SES build bootloader. In IAR binary ,application mode and dfu mode switching is working.

Please help me to solve this problem .

Parents
  • Hi,

    I've not encountered this problem with SES. Are you testing with the *_debug project (\examples\dfu\bootloader_secure_ble\pca10040_debug)? In that case, can you share the full debug log so I can take a closer look? 

  • Hi

     Please find the  attached  bootloader log in RTT viewer and nrf connect log ..

     

     0> <info> dfu_req_handling: Valid Data Execute
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 2
     0> <info> dfu_req_handling: Doing postvalidate
     0> <info> dfu_req_handling: Current bank is bank 0
     0> <info> dfu_req_handling: Running SD version check ============== 
     0> <info> dfu_req_handling: Successfully ran the postvalidation check!
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 3
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 4
     0> <debug> app: Sending Response: [0x4, 0x1]
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 3
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 2
     0> <debug> dfu_req_handling: Response sent.
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
     0> <debug> nrf_dfu_flash: This operation had a callback, calling back to 0x000753B5.
     0> <debug> dfu_req_handling: All flash operations have completed.
     0> <debug> dfu_req_handling: Starting reset timer.
     0> <debug> dfu_req_handling: Attempting to reset the device.
     0> <debug> app: In nrf_dfu_transports_close
     0> <debug> app: num transports: 1
     0> <debug> app: Shutting down BLE transport.
     0> <debug> app: Disconnecting.
     0> <debug> app: BLE transport shut down.
     0> <debug> app: After nrf_dfu_transports_init
     0> <debug> dfu_req_handling: Reset.
     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> app: in weak nrf_dfu_init_user
     0> <debug> app: In real nrf_dfu_init
     0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> app: Initializing the clock.
     0> <debug> app: Enter nrf_dfu_continue
     0> <debug> app: Valid App
     0> <debug> app: Application sent bootloader request
     0> <debug> app: In nrf_dfu_transports_init
     0> <debug> app: num transports: 1
     0> <debug> app: Initializing BLE DFU transport
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: Error code - sd_softdevice_vector_table_base_set: 0x00000000
     0> <debug> app: Enabling SoftDevice.
     0> <warning> nrf_sdh_ble: RAM starts at 0x20002830, can be adjusted to 0x20002180.
     0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xDE80.
     0> <debug> app: SoftDevice enabled.
     0> <debug> app: nrf_dfu_settings_adv_name_is_valid FALSE
     0> <debug> app: Regular adv name
     0> <debug> app: #### Advertising NO BONDING ####
     0> <debug> app: Finished initializing BLE DFU transport
     0> <debug> app: After nrf_dfu_transports_init
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=true)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
     0> <debug> app: Waiting for events
     0> <debug> app: Received: BLE_GAP_EVT_CONN_PARAM_UPDATE
     0> <debug> app: conn_sup_timeout: 2000
     0> max_conn_interval: 6
     0> min_conn_interval: 6
     0> slave_latency 0
     0> <debug> app: Received: BLE_GAP_EVT_CONN_PARAM_UPDATE
     0> <debug> app: conn_sup_timeout: 2000
     0> max_conn_interval: 39
     0> min_conn_interval: 39
     0> slave_latency 0
     0> <debug> app: DFU reset due to inactivity timeout.
     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> app: in weak nrf_dfu_init_user
     0> <debug> app: In real nrf_dfu_init
     0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> app: Initializing the clock.
     0> <debug> app: Enter nrf_dfu_continue
     0> <debug> app: Valid App
     0> <debug> app: Application sent bootloader request
     0> <debug> app: In nrf_dfu_transports_init
     0> <debug> app: num transports: 1
     0> <debug> app: Initializing BLE DFU transport
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: Error code - sd_softdevice_vector_table_base_set: 0x00000000
     0> <debug> app: Enabling SoftDevice.
     0> <warning> nrf_sdh_ble: RAM starts at 0x20002830, can be adjusted to 0x20002180.
     0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xDE80.
     0> <debug> app: SoftDevice enabled.
     0> <debug> app: nrf_dfu_settings_adv_name_is_valid FALSE
     0> <debug> app: Regular adv name
     0> <debug> app: #### Advertising NO BONDING ####
     0> <debug> app: Finished initializing BLE DFU transport
     0> <debug> app: After nrf_dfu_transports_init
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=true)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
     0> <debug> app: Waiting for events
    

Reply
  • Hi

     Please find the  attached  bootloader log in RTT viewer and nrf connect log ..

     

     0> <info> dfu_req_handling: Valid Data Execute
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 1
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 2
     0> <info> dfu_req_handling: Doing postvalidate
     0> <info> dfu_req_handling: Current bank is bank 0
     0> <info> dfu_req_handling: Running SD version check ============== 
     0> <info> dfu_req_handling: Successfully ran the postvalidation check!
     0> <debug> nrf_dfu_settings: Writing settings...
     0> <debug> nrf_dfu_settings: Erasing old settings at: 0x0007F000
     0> <debug> nrf_dfu_flash: nrf_fstorage_erase(addr=0x0x0007F000, len=1 pages), queue usage: 3
     0> <debug> nrf_dfu_flash: nrf_fstorage_write(addr=0x0007F000, len=0x1B8 bytes), queue usage: 4
     0> <debug> app: Sending Response: [0x4, 0x1]
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 3
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 2
     0> <debug> dfu_req_handling: Response sent.
     0> <debug> nrf_dfu_flash: Flash erase success: addr=0x0007F000, pending 1
     0> <debug> nrf_dfu_flash: Flash write success: addr=0x0007F000, pending 0
     0> <debug> nrf_dfu_flash: This operation had a callback, calling back to 0x000753B5.
     0> <debug> dfu_req_handling: All flash operations have completed.
     0> <debug> dfu_req_handling: Starting reset timer.
     0> <debug> dfu_req_handling: Attempting to reset the device.
     0> <debug> app: In nrf_dfu_transports_close
     0> <debug> app: num transports: 1
     0> <debug> app: Shutting down BLE transport.
     0> <debug> app: Disconnecting.
     0> <debug> app: BLE transport shut down.
     0> <debug> app: After nrf_dfu_transports_init
     0> <debug> dfu_req_handling: Reset.
     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> app: in weak nrf_dfu_init_user
     0> <debug> app: In real nrf_dfu_init
     0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> app: Initializing the clock.
     0> <debug> app: Enter nrf_dfu_continue
     0> <debug> app: Valid App
     0> <debug> app: Application sent bootloader request
     0> <debug> app: In nrf_dfu_transports_init
     0> <debug> app: num transports: 1
     0> <debug> app: Initializing BLE DFU transport
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: Error code - sd_softdevice_vector_table_base_set: 0x00000000
     0> <debug> app: Enabling SoftDevice.
     0> <warning> nrf_sdh_ble: RAM starts at 0x20002830, can be adjusted to 0x20002180.
     0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xDE80.
     0> <debug> app: SoftDevice enabled.
     0> <debug> app: nrf_dfu_settings_adv_name_is_valid FALSE
     0> <debug> app: Regular adv name
     0> <debug> app: #### Advertising NO BONDING ####
     0> <debug> app: Finished initializing BLE DFU transport
     0> <debug> app: After nrf_dfu_transports_init
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=true)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
     0> <debug> app: Waiting for events
     0> <debug> app: Received: BLE_GAP_EVT_CONN_PARAM_UPDATE
     0> <debug> app: conn_sup_timeout: 2000
     0> max_conn_interval: 6
     0> min_conn_interval: 6
     0> slave_latency 0
     0> <debug> app: Received: BLE_GAP_EVT_CONN_PARAM_UPDATE
     0> <debug> app: conn_sup_timeout: 2000
     0> max_conn_interval: 39
     0> min_conn_interval: 39
     0> slave_latency 0
     0> <debug> app: DFU reset due to inactivity timeout.
     0> <info> app: Inside main
     0> <debug> app: In nrf_bootloader_init
     0> <debug> app: in weak nrf_dfu_init_user
     0> <debug> app: In real nrf_dfu_init
     0> <debug> nrf_dfu_settings: Running nrf_dfu_settings_init(sd_irq_initialized=false).
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=false)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
     0> <debug> app: Initializing the clock.
     0> <debug> app: Enter nrf_dfu_continue
     0> <debug> app: Valid App
     0> <debug> app: Application sent bootloader request
     0> <debug> app: In nrf_dfu_transports_init
     0> <debug> app: num transports: 1
     0> <debug> app: Initializing BLE DFU transport
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: vector table: 0x00073000
     0> <debug> app: Error code - sd_softdevice_vector_table_base_set: 0x00000000
     0> <debug> app: Enabling SoftDevice.
     0> <warning> nrf_sdh_ble: RAM starts at 0x20002830, can be adjusted to 0x20002180.
     0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xDE80.
     0> <debug> app: SoftDevice enabled.
     0> <debug> app: nrf_dfu_settings_adv_name_is_valid FALSE
     0> <debug> app: Regular adv name
     0> <debug> app: #### Advertising NO BONDING ####
     0> <debug> app: Finished initializing BLE DFU transport
     0> <debug> app: After nrf_dfu_transports_init
     0> <debug> nrf_dfu_flash: Calling nrf_dfu_flash_init(sd_irq_initialized=true)...
     0> <debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
     0> <debug> app: Waiting for events
    

Children
Related