I am developing a Central/Peripheral application with SDK 15.2.0 for s132 device on nRF52 development kits. I switch back and forth between my application and the example "ble_app_hrs_rscs_relay" on my nRF52 development boards. In doing so, eventually my nRF52 development boards will throw the error PM_EVT_CONN_SEC_FAILED when running on my application firmware and connecting to a peripheral device. I can never get PM_EVT_CONN_SEC_SUCCEEDED again on this nRF52 development board operating as a Central and Peripheral. When I put my application firmware on a new nRF52 DK, it runs fine and gets PM_EVT_CONN_SEC_SUCCEEDED every time it connects to a peripheral BLE device. This has happened to me with two nRF DKs and now I'm working with a 3rd, but I have not cycled between the "ble_app_hrs_rscs_relay" and my application firmware. I have only been programming it with my application firmware and it has been running fine. I have tried "erase all" on the problem DKs and this didn't help.
Are you able to reproduce the error? If so, take a look at the log in pm_handler_pm_evt_log(..) (In the peer_manager_handler.c) and check which procedure failed (pm_conn_sec_procedure_t) and the error code (pm_sec_error_code_t).
<info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Bonding, error: 133
Is this what you asked for?
What command did you run in order to erase the content of the chip, did you use nrfjprog --eraseall?
I'm using Segger Embedded Studio and used Target -> Erase All from the menu.
After bonding, the bonding information is stored in flash, and my suspicion is that this data prevents you from bonding again somehow. But, this should get resolved by erasing all the content of the chip.
I haven't been able to get a full grasp of your problem, and need some more time.
I'll be gone for some days due to easter break, but will be back the 23.04 and will look further into your issue then.
Thank you Simon. I look forward to continuing our discussion when you get back. Have a great holiday.
I don't think all the contents of the flash gets erased when doing it from SEGGER. Could you try to erase flash either by using nRF Connect for Desktop or the command nrfjprog --eraseall?
I performed a Recover (full erase) in nRF Connect. The nRF52 dev board still throws PM_EVT_CONN_SEC_FAILED when connecting to a peripheral.
In nRF Connect, the log shows "Non-volatile memory has been read. 1 non-empty memory blocks identified." This is after the full erase. Is this normal?
I just tried nrfjprog --eraseall and still no luck.
I still have one nRF52 board that works fine with the same firmware. I get PM_EVT_CONN_SEC_SUCCEEDED when connecting to a peripheral. Almost certainly if I program it with the example "ble_app_hrs_rscs_relay" and then go back to my custom firmware, then this nRF52 board will no longer work correctly.
Have you had a chance to look into this more?
I am sorry for the long delay. Have you resolved the issue? If not I will look into it the upcoming days.