Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bugs in ble_app_hrs_freertos example?

Some bugs in ble_app_hrs_freertos example from the SDK when handling buttons:
(at the end of this listing are same tests but with ble_app_hrs (no rtos) and buttons are handled as expected)
Tests were made with pca10040 / SDK 16.0.0 and SES 4.30b

Could you point where is the problem, please, because I've used some parts of this code as base for one my app and it handles buttons Ok in Release mode, but in Debug mode first pass through the button handler passes, but then the app stalls without reporting any error :(
Thanks
---------------------------------

ble_app_hrs_freertos_pca10040_s132

Turn On the PCA10040 board:
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.

Press Btn1: ->Sleep
Press Btn1 or Btn2 or Btn3 or Btn4:
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.

While advertising:
Press Btn2:
<error> hardfault: HARD FAULT at 0x00000004
<error> hardfault: R0: 0x200067E4 R1: 0x20006738 R2: 0x200072E0 R3: 0x200072E0
<error> hardfault: R12: 0x20007138 LR: 0x00000004 PSR: 0x6000000E
<error> hardfault: Cause: The processor has attempted to execute an instruction that makes illegal use of the EPSR.
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.

Press Btn3 or Btn4:
<error> hardfault: HARD FAULT at 0x00000002
<error> hardfault: R0: 0x20007098 R1: 0x20006FF8 R2: 0x200072E0 R3: 0x200072E0
<error> hardfault: R12: 0x200065D4 LR: 0x00000002 PSR: 0x6000000E
<error> hardfault: Cause: The processor has attempted to execute an instruction that makes illegal use of the EPSR.
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.


While Connected (not paired):
<info> app: Connected

Press Btn2:
<error> hardfault: HARD FAULT at 0x00000004
<error> hardfault: R0: 0x200067E4 R1: 0x20006738 R2: 0x200072E0 R3: 0x200072E0
<error> hardfault: R12: 0x20007138 LR: 0x00000004 PSR: 0x6000000E
<error> hardfault: Cause: The processor has attempted to execute an instruction that makes illegal use of the EPSR.
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.


<info> app: Connected
Press Btn3 or Btn4:
<error> hardfault: HARD FAULT at 0x00000002
<error> hardfault: R0: 0x20007098 R1: 0x20006FF8 R2: 0x200072E0 R3: 0x200072E0
<error> hardfault: R12: 0x20007138 LR: 0x00000002 PSR: 0x6000000E
<error> hardfault: Cause: The processor has attempted to execute an instruction that makes illegal use of the EPSR.
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.

--- When Paired:
restart:
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.

Connect:
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
<info> app: Connected
<info> peer_manager_handler: Connection secured: role: Peripheral, conn_handle: 0, procedure: Encryption
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Peer rank, action: Update, no change
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Local database, action: Update
<info> peer_manager_handler: Peer data updated in flash: peer_id: 0, data_id: Local database, action: Update

Press Btn1 Or Btn2 or Btn3 or Btn4:
For Btn1 and 2 (with some minor diffs in the values):
<error> hardfault: HARD FAULT at 0x00000004
<error> hardfault: R0: 0x200067E4 R1: 0x20006738 R2: 0x200072E0 R3: 0x200072E0
<error> hardfault: R12: 0x20007138 LR: 0x00000004 PSR: 0x6000000E
<error> hardfault: Cause: The processor has attempted to execute an instruction that makes illegal use of the EPSR.
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.

For Btn3 and 3 (with some minor diffs in the values):
<error> hardfault: HARD FAULT at 0x00000002
<error> hardfault: R0: 0x20007098 R1: 0x20006FF8 R2: 0x200072E0 R3: 0x200072E0
<error> hardfault: R12: 0x20007138 LR: 0x00000002 PSR: 0x6000000E
<error> hardfault: Cause: The processor has attempted to execute an instruction that makes illegal use of the EPSR.
<info> app: HRS FreeRTOS example started.
<info> app: Fast advertising.


==============================================================================
ble_app_hrs_pca10040_s132: (here everything works Ok so far)

Press Btn1: ->Sleep
Press Btn1:
<info> app_timer: RTC: initialized.
<info> app: Heart Rate Sensor example started.
<info> app: Fast advertising.

Long press Btn2:
<info> app: Fast advertising.

Press Btn1: ->Sleep
Press Btn2:
<info> app_timer: RTC: initialized.
<info> app: Heart Rate Sensor example started.
<info> app: Erase bonds!
<info> peer_manager_handler: All peers deleted.
<info> app: Fast advertising.

Pressing Btn2,Btn3, Btn4 while advertising or connected - no any effect

Related