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

ble_app_hrs_freertos Increassing MTU Fatal error

Hi,

Using SDK 15.3.0 , example "ble_app_hrs_freertos", pca10040 with armgcc.

I want to increase MTU and GAP data length.

I started with MTU to 247, and when I try to connect, on log :

Fullscreen
1
2
3
4
5
6
7
8
9
<debug> nrf_sdh_freertos: Creating a SoftDevice task.
<info> app: HRS FreeRTOS example started.
<debug> nrf_sdh_freertos: Enter softdevice_task.
<info> app: Fast advertising.
<error> hardfault: HARD FAULT at 0x0002C004
<error> hardfault: R0: 0x20008214 R1: 0x002A821C R2: 0x20008214 R3: 0x20008208
<error> hardfault: R12: 0x00000000 LR: 0x0002AAF1 PSR: 0x8100020E
<error> hardfault: Cause: Data bus error (PC value stacked for the exception return points to the instruction that caused the fault).
<error> hardfault: Bus Fault Address: 0x002A8228
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

The modifications I have done to the code are :

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/config/FreeRTOSConfig.h b/config/FreeRTOSConfig.h
index ae2167d..6dee317 100644
--- a/config/FreeRTOSConfig.h
+++ b/config/FreeRTOSConfig.h
@@ -63,7 +63,7 @@
#define configTICK_RATE_HZ 1024
#define configMAX_PRIORITIES ( 3 )
#define configMINIMAL_STACK_SIZE ( 60 )
-#define configTOTAL_HEAP_SIZE ( 4096 )
+#define configTOTAL_HEAP_SIZE ( 8192 )
#define configMAX_TASK_NAME_LEN ( 4 )
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
diff --git a/pca10040/s132/config/sdk_config.h b/pca10040/s132/config/sdk_config.h
index 8edaaed..715d28d 100644
--- a/pca10040/s132/config/sdk_config.h
+++ b/pca10040/s132/config/sdk_config.h
@@ -39,6 +39,9 @@
*/
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I also modified "nrf_sdh_freertos.c" :

#define NRF_BLE_FREERTOS_SDH_TASK_STACK 256 to 512

(not sur it is useful ?)

I also have seen normal ble_app_hrs is with 247 MTU and 251 GAP data lenth, and it works !

Regards,