Hi,
I am facing hardfault when i try to enable low power in a ble application. i want to enable trace on my PCA10040 board to find out the cause of this hardfault. can you help me to succeed to enable trace ? please.
Best regards.
Hi,
I am facing hardfault when i try to enable low power in a ble application. i want to enable trace on my PCA10040 board to find out the cause of this hardfault. can you help me to succeed to enable trace ? please.
Best regards.
Strange. how did you conclude it was a hardfault earlier? Halting the core with nrfjprog/jlink, or did you have a LED or similar in the event handler?
Overview of my Ble application:
.
.
.
BleInit();
uart_init();
printf("%s",start_string);
DisplayInit();
NorFlashInit();
//scheduler init
APP_SCHED_INIT(SCHED_MAX_EVENT_DATA_SIZE, SCHED_QUEUE_SIZE);
//create Display timer
err_code = app_timer_create(&DisplayTimerId, APP_TIMER_MODE_REPEATED, DisplayEventHandler);
APP_ERROR_CHECK(err_code);
while (1)
{
app_sched_execute();
power_manage();
}
when proc is idle mode i measure a consumption current of~900uA, run mode ~6mA.
Hardfault occurs randomly (on connect event, display event ...etc) when it occurs i measure a consumption current of 10mA, and ble stops advertising.
To be sure that is a hardfault, i replaced
HardFault_Handler\
PROC
EXPORT HardFault_Handler [WEAK]
B .
ENDP
on arm_startup_nrf52.s by Reset_Handler code
HardFault_Handler\
PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
then when the hardfault occurs, the board resets
Blog post explaining how to do this step by step: devzone.nordicsemi.com/.../.