Firmware Update from IOS

Hello,

after having a product using a nrf52832 MCU for a while in production using nrf connect sdk 2.5.1, we now wanted to supply a first firmware update. However, while the system was tested to work beforehand we now noticed that the firmware update (which we supply from our app) process, is extremly slow from IOS devices. It got to the point where it is pretty annoying to update from IOS devices for our customers. We are using an nrf52832 with external flash. The update process works also not very well from IOS devices using the nrf device manager app. The problem seems similar to the one posted here: DFU on iOS 17.3.1 nRF Connect app very slow. - Nordic Q&A - Nordic DevZone - Nordic DevZone But the solution does no longer seem accessible as for some reason I can set the number of buffers no longer to 2 (minimum is 3 in the app). 

Do you have any idea what the problem could be?

  • Unfortunately it shows the same problem as before. It already takes very long to initalize a pairing and when you can at some point start the firmware update it is very slow. Were you able to see the behavior with the sample project I supplied or does it work fine on your end?

  • For the pairing issue, I see you added a security requirement to the characteristic. A pairing pop-up appears after you click Write. It's triggered by the peripheral device instead of the phone/iOS. See the explanation in this course. You can use nRF Sniffer to compare the behaviors.

    I guess you want to pair once connected. If so, it needs to be set via bt_conn_set_security in the connect event. 

    static void connected(struct bt_conn* conn, uint8_t err)
    {
      char addr[BT_ADDR_LE_STR_LEN];
    
      bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
    
      if (err != 0) {
        printk("Connection failed for %s (err %u)\n", addr, err);
        return;
      }
    
      printk("Connected %s — requesting encryption and bonding\n", addr);
    
      err = bt_conn_set_security(conn, BT_SECURITY_L2);
      if (err != 0) {
        printk("Failed to request security for %s (err %d)\n", addr, err);
        bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL);
      }
    }
    
    static void disconnected(struct bt_conn* conn, uint8_t reason)
    {
      char addr[BT_ADDR_LE_STR_LEN];
    
      bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
      printk("Disconnected from %s (reason 0x%02x)\n", addr, reason);
    }
    
    static void security_changed(struct bt_conn* conn, bt_security_t level, enum bt_security_err err)
    {
      char addr[BT_ADDR_LE_STR_LEN];
    
      bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
    
      if (err == BT_SECURITY_ERR_SUCCESS) {
        printk("Security changed: %s level %u\n", addr, level);
        return;
      }
    
      printk("Security failed: %s level %u err %d — disconnecting\n", addr, level, err);
      bt_conn_disconnect(conn, BT_HCI_ERR_AUTH_FAIL);
    }
    
    BT_CONN_CB_DEFINE(conn_callbacks) = {
        .connected        = connected,
        .disconnected     = disconnected,
        .security_changed = security_changed,
    };
    

    See DFUTest_pair_connected.7z. 

    “Beware that this code/configuration is not fully tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.”

    As for the transfer speed in iOS, we are still working on it. 

  • Hello, did you make progress regarding the slow transfer speed from IOS?

  • Not yet. Please give us more time. I will update once we have anything. Thanks for your patience. 

Related