REQUEST AN IOS VERSION DFU UPGRADE PROCESS

DFU is now implemented on ipads and iphones, as well as on Android phones, and the app platform is nRF Connect. The problem is that the firmware upgrade can be achieved normally with an Android phone; The ipad can connect and read data, but it can't use the DFU function; iPhones can't connect to Bluetooth; Observe the log information in the process of iPad DFU, and observe <debug> nrf_dfu_validation: CRC check of app failed. What is the reason for such a sentence as Return 1? And the IPAD can establish a connection with the firmware bluetooth, but the iphone15 can't establish a connection, what could be the problem?

The version of SDK is 17.0.2;
The following is the information for the wrong printing:

  1. 00> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    00>
    00> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    00>
    00> <info> app: Inside main
    00>
    00> <debug> app: In nrf_bootloader_init
    00>
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00>
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00>
    00> <debug> nrf_dfu_settings: Using settings page.
    00>
    00> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00>
    00> <info> app: No firmware to activate.
    00>
    00> <debug> nrf_dfu_validation: CRC check of app failed. Return 1
    00>
    00> <debug> app: App is valid
    00>
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    00>
    00> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    00>
    00> <info> app: Inside main
    00>
    00> <debug> app: In nrf_bootloader_init
    00>
    00> <debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
    00>
    00> <debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
    00>
    00> <debug> nrf_dfu_settings: Using settings page.
    00>
    00> <debug> nrf_dfu_settings: Copying forbidden parts from backup page.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <debug> app: Enter nrf_bootloader_fw_activate
    00>
    00> <info> app: No firmware to activate.
    00>
    00> <debug> app: App is valid
    00>
    00> <info> nrf_dfu_settings: Backing up settings page to address 0x7E000.
    00>
    00> <debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
    00>
    00> <debug> app: Running nrf_bootloader_app_start with address: 0x00001000
    00>
    00> <debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
    00>
Parents
  • Hello,

    00> <debug> nrf_dfu_validation: CRC check of app failed. Return 1

    The debug message indicates that the computed checksum of the application does not match the expected checksum stored in the bootloader settings page. However, the bootloader is allowed to boot the image anyway, as you are using the debug variant of the bootloader, which sets the NRF_DFU_DEBUG flag. This suggests that the application image was altered after the DFU was completed. It's strange that this only happens with iOS/ipadOS and not Android. 

    Can you read out the flash after completing DFU with Android and iOS to compare the differences? You can do this with nrfjprog.

    $ nrfjprog --memrd <application start address> --n <size of application image in bytes> > app_image.txt

    Best regards,

    Vidar

  • Hello Vidar,thanks a lot for your reply.

    As you said it's an issue with the initial jump address, I already found out yesterday.

    One of the more strange problems is found at the moment, because the previous version of the iPad version 16.6.1 was used to implement the Bluetooth connection, but when using the iPhone with the iOS version 18, the Bluetooth connection could not be realized. Will the Bluetooth connection of the NRF52832 be related to the system version? Do I need to set any relevant parameters?

    Best regards,

    Anny

  • Hello Vidar,

    Do you know what caused the jump address to become invalid?

    Unfortunately, I'm not very clear about this. However, after I modify the definition symbol __ICFEDIT_region_RAM_start__ address in the icf file, the DFU function can be implemented normally. I haven't tried more situations yet.

    Could you please provide more information about how the connection is failing to establish?

    If you connect with an iPhone phone, the following reply will appear:

    00> Connected. conn_handle:0x0000
    00> Connected. conn_Param:24,24,0,72
    00> <info> app: conn_Param Updata : 24,24,0,72
    00> <info> app: Disconnected. conn_handle: 0x0, reason: 0x22

    Based on the return value 0x22, I modified the value of the MTU, with a minimum of 27 and a maximum of 251,It didn't work out. And when the phone is connected, it will always be in the connecting state。Do I need to switch to any other settings?

  • Hello Anny,

    Based on the return value 0x22, I modified the value of the MTU, with a minimum of 27 and a maximum of 251,It didn't work out. And when the phone is connected, it will always be in the connecting state。Do I need to switch to any other settings?

    Does your application use the GATT module to handle data length update requests? The disconnect reason is BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT (0x22), which indicates that either the phone or app failed to respond to a link layer control procedure request.

    Best regards,

    Vidar

  • Hello Vidar,

    Does your application use the GATT module to handle data length update requests?

    Yes, I added the relevant setting functions according to the example-"ble_app_uart",

    err_code = nrf_ble_gatt_init(&m_gatt,gatt_evt_handler);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_ble_gatt_att_mtu_periph_set(&m_gatt,NRF_SDH_BLE_GATT_MAX_MTU_SIZE);
    APP_ERROR_CHECK(err_code);

    however,it did not work.Somehow, the program went into NRF_FAULT_ID_SD_ASSERT state after receiving a 0X22 error reply.Do I need to do anything extra in the handler?

    I’m looking forward for your reply!

    Anny

  • Hello Anny,

    And you have not implemented any handling of these events in your application? Do you see the same issue if you attempt to connect with the original ble_app_uart example?

  • Hi Vidar,

    And you have not implemented any handling of these events in your application?

    I just made a judgment to determine the change in the MTU value.

    Do you see the same issue if you attempt to connect with the original ble_app_uart example?

    The original routine works fine on one of the boards used, and the connection works fine. But the program doesn't work on my PCB board

Reply Children
  • Hi Anny,

    ANNY-TAO said:
    I just made a judgment to determine the change in the MTU value.

    Can you post some code snippets showing how you are handling MTU and Data length extension?

    ANNY-TAO said:
    The original routine works fine on one of the boards used, and the connection works fine. But the program doesn't work on my PCB board

    Were you able to run the original ble_app_uart example on your custom board, or have you only tested with your project?

  • Hi Vidar,

    1.I use “nrf_ble_gatt_att_mtu_periph_set”to set the MTU size of the GATT server.The GATT event callback determines the update status of the MTU:

    • void gatt_evt_handler(nrf_ble_gatt_t * p_gatt,nrf_ble_gatt_evt_t const * p_evt)
      {
      if ((m_conn_handle == p_evt->conn_handle) && (p_evt->evt_id == NRF_BLE_GATT_EVT_ATT_MTU_UPDATED))
      {
      NRF_LOG_INFO("Data len is set to 0x%X(%d)",
      p_evt->params.att_mtu_effective-OPCODE_LENGTH-HANDLE_LENGTH,
      p_evt->params.att_mtu_effective-OPCODE_LENGTH-HANDLE_LENGTH
      );
      }
      }

    2.I only tested with my project,since routine example don't work on my board

  • callback determines the update status of the MTU:

    Thanks, this will not interfere with the MTU exchange, so it must be something else that is handled different in your project, but it's difficult to say what it is without having seen the project. Have you changed the ble_evt_handler() compared to the ble_app_uart example?

  • Hi Vidar,

    As you predicted, I didn't make an update to the PHY request for the two connected devices in the BLE Handler!The final problem arises at the application layer, and I wasn't aware of the version issue with Bluetooth before.

    Thank you so much for your reply!

    Anny

Related