BLE Custom Profile : Hardfault after advertising

himanshu pande gravatar image

asked 2017-05-19 15:44:45 +0100

I am trying to implement a simple example with custom profile by building upon the tutorial given https://devzone.nordicsemi.com/tutori...

My profile is something like this: Service 1 -->Characteristic 1 Service 2 -->Characteristic 1 -->Characteristic 2

I am using the FreeRTOS HRM example as the base because we need FreeRTOS in our project. Logger is enabled to print all the debug/info data.

I am attaching the main.c file which I am using for this.

The problem is that BLE starts to advertise but then encounters a hardfault which triggers a reset. I have got the additional log printed related to Cortex m4 registers.

Although, I am not able to trace what exactly is triggering this hardfault?

I have tried this example with gcc 2016 q2 and gcc 2017 q1 compilers and the result remains the same.

File(main.c and image of log) are here : https://drive.google.com/drive/folder...

edit retag flag offensive close delete report spam

Comments

Hi,

Which SDK are you testing ?

If you only test with the HRM example would it work ?

There is a bug need to be fix if you use SDK v13/12 , please have a look at new issue #6 here.

Hung Bui ( 2017-05-22 12:14:29 +0100 )editconvert to answer

The SDK in use is v12. I am able to do a lot more than running the basic HRM example. But the examples with freeRTOS generally face issues. I have attached files in the question.

himanshu pande ( 2017-05-22 12:40:02 +0100 )editconvert to answer

Have you tried ble_app_hrs_freertos with no modification ? Could you try with gcc 4.9 2015q3 ?

If the issue still occurs, please check the call stack when hardfault occurs to see what triggered it.

Hung Bui ( 2017-05-22 14:40:47 +0100 )editconvert to answer

ble_app_hrs_freertos example for the SDK set works fine for me with the current set up. But when I try to modify the ble_app_template example with my custom profile and freeRTOS(used exactly like hrs freertos example), I get the hardfault. The log attached in the question has some extra register values as well. Is FreeRTOS totally compatible with Nordic SDK?

himanshu pande ( 2017-05-22 14:49:44 +0100 )editconvert to answer

Could you try to debug and check what causes the assertion ? You may want to follow this debug guide.

Hung Bui ( 2017-05-23 11:13:59 +0100 )editconvert to answer