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

peer_manager_handler: Peer data updated failed: peer_id: 0, data_id: Service changed pending flag, action: Update, error: NRF_ERROR_INVALID_FLAGS

I am running an application with norma NUS Service with bonding.

When I want to make a DFU I start to write a token into the flash with fds and then do a soft reset. After the soft reset the token is read out and resetted.

Now the DFU Service is advertised. This works all fine. But now I want to connect with the same smart phone and start the DFU but it gives me an error

peer_manager_handler: Peer data updated failed: peer_id: 0, data_id: Service changed pending flag, action: Update, error: NRF_ERROR_INVALID_FLAGS

    case PM_EVT_PEER_DATA_UPDATE_FAILED:
    {
        // Assert.
        APP_ERROR_CHECK(p_evt->params.peer_data_update_failed.error);
    } break;

I mean I've could uncomment the check. But I guess it means something.

Again the bootloader is without bonding but the APP is with bonding. The same application runs just fine the DFU when I do not use bonding. at all.

System: nRF52840

SDK: 15.3

Compiler: GCC ARM Embedded 7.2018

Thanks in advance,


Constantin

  • Hello,

     

    When I want to make a DFU I start to write a token into the flash with fds and then do a soft reset.

     Is this token related to the peer manager?

    Can you please attach the sdk_config.h files for the bootloader and the application? Perhaps there are some settings that are not set correctly regarding the bonding requirements for the bootloader.

    I mean I've could uncomment the check. But I guess it means something.

     I agree it is better to figure out why it doesn't return successfully. 

    As long as the bootloader is without bonding, it should behave as a new device (with a new BLE address) in order to force the phone to do a service discovery, so it shouldn't use the old bonding data in the connection with the bootloader.

    Is this something that I can reproduce on an nRF52840 DK?

    BR,

    Edvin

  • This is our custom token that we force the device to advertise the DFU service only if requested. Hence we write it into the flash and toggle a reset. After the reset the DFU service is advertised.

    Sure I can upload both sdk_config.sdk_config_bootloader.h

    sdk_config_application.h

  • I am about to leave the office, but I had a quick glance at your sdk_config_bootloader.h.

    On line 1174 you have set:

    #define NRF_DFU_BLE_REQUIRES_BONDS 1

    Can you try to set it to 0, and see if that solves it? I'll check it out in more detail tomorrow if that doesn't solve it.

     

    Constantin said:
    This is our custom token that we force the device to advertise the DFU service only if requested.

     When you say the DFU service, do you mean running the bootloader only, or running the buttonless_dfu service (like the ble_app_buttonless_dfu example)?

    Your implementation may work just fine, but I just thought I should mention that we have an example to put the device in DFU mode over BLE.

    Best regards,

    Edvin

Related