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

FreeRTOS + Softdevice HARDFAULT:ERROR:Hardfault PC:4

Hello,

I'm experiencing a hardware fault followed by a reset when running the nRF5_SDK_12.1.0_0d23e2a ble_app_hrs_freertos with the following configuration :

  • PCA10040 V1.1.0 with nRF52832
  • In sdk_config.h, I set NRF_LOG_ENABLED 1 and NRF_LOG_DEFERRED 0
  • Eclipse with GCC 5.4.3
  • Without optimization in Makefile ( -O0).

The error occurs very rapidly if I press button 2 ( two or three times) or every few seconds if nothing is pressed.

The logs shown on the terminal are :

SDH:INFO:sd_ble_enable: RAM START at 0x20002128

APP:INFO:Fast Adverstising

HARDFAULT:ERROR:Hardfault PC:4"

I've been digging into all the questions about freertos in the forum and I did not find a resolution. I was working on an already modified version of the example, put the DEBUG_NRF flag in Makefile, had the debugger stop and show vPortStartFirstTask() at port.c .... but I found no clue. I got back to a clean SDK version and retried the same configuration ( here before) and the problem was the same.

With optimization -O3, it does not appear on the example ( but still on my modified code).

Thank you for your interest.

Related