I am developing a BLE application on the nRF52 platform using FreeRTOS. My application involves custom BLE services and characteristics, and I am encountering a hard fault after a BLE connects after that it goes directly to the disconnection event. The hard fault occurs consistently, and I have added detailed logging to help diagnose the issue. The hard fault address is within the range of the linker ram_start
and ram_size
. I put a log file of the nrf52. I am trying to connect with my PC to nrf52. It gives same result when I try to connect with my phone.
I would appreciate any insights or suggestions on what might be causing this hard fault and how to resolve it. Specifically, I am looking for guidance on:
- Potential causes of hard faults after BLE disconnection events.
- Best practices for debugging hard faults in nRF52 applications.
- Any known issues or common pitfalls related to BLE and FreeRTOS on the nRF52 platform.
Thank you in advance for your help!
<info> app: BLE Custom FreeRTOS example started.
<info> app: Fast advertising.
<info> app: BLE event received. Event type = 16
<info> app: BLE event received. Event type = 16
<info> app: Connected
<info> app: BLE event received. Event type = 85
<info> app: BLE event received. Event type = 85
<info> app: BLE event received. Event type = 58
<info> app: BLE event received. Event type = 58
<info> app: BLE event received. Event type = 35
<info> app: BLE event received. Event type = 35
<info> app: BLE event received. Event type = 19
<info> app: BLE event received. Event type = 19
<info> app: BLE event received. Event type = 36
<info> app: BLE event received. Event type = 36
<info> app: BLE event received. Event type = 21
<info> app: BLE event received. Event type = 21
<info> app: BLE event received. Event type = 33
<info> app: BLE event received. Event type = 33
<info> app: BLE event received. Event type = 80
<info> app: BLE event received. Event type = 80
<info> app: BLE event received. Event type = 34
<info> app: BLE event received. Event type = 34
<info> app: BLE event received. Event type = 18
<info> app: BLE event received. Event type = 18
<info> app: BLE event received. Event type = 18
<info> app: BLE event received. Event type = 18
<info> app: BLE event received. Event type = 26
<info> app: BLE event received. Event type = 26
<info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle:
<info> app: Connection secured: role: Peripheral, conn_handle: 0, procedure: Bon
<info> app: BLE event received. Event type = 25
<info> app: BLE event received. Event type = 25
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Bo
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Pe
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Lo
<info> app: BLE event received. Event type = 53
<info> app: BLE event received. Event type = 53
<info> app: BLE event received. Event type = 54
<info> app: BLE event received. Event type = 54
<info> app: BLE event received. Event type = 18
<info> app: BLE event received. Event type = 18
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Ce
<info> app: BLE event received. Event type = 82
<info> app: BLE event received. Event type = 82
<info> app: BLE event received. Event type = 18
<info> app: BLE event received. Event type = 18
<info> app: Fast advertising.
<info> app: BLE event received. Event type = 17
<info> app: BLE event received. Event type = 17
<info> app: Disconnected, reason: 0x13
<error> hardfault: HARD FAULT at 0x200072A4
<error> hardfault: R0: 0x200071E8 R1: 0x20006514 R2: 0x00000001 R3: 0x2
<error> hardfault: R12: 0x200078E8 LR: 0x000353FB PSR: 0x20000000
<error> hardfault: Cause: The processor has attempted to execute an instruction