Associate III
February 26, 2020
Solved
Using the Sequencer and Timer Server on p2pServer example 1.5.0 hardfaults
- February 26, 2020
- 9 replies
- 4548 views
As soon as I add a task to the scheduler and schedule it to run once every 5 seconds, when the timer fires and the sequencer tries to run the task the STM32 goes to the hard fault handler.
I'm using the latest example BLE_p2pServer from STM32CubeWB 1.5.0, the example is as-is, except for adding "deviceModes.c":
#include "deviceModes.h"
void StandbyMode();
void QueueStandbyMode();
const int SCH_PRIORITY_STANDBY_MODE = CFG_SCH_PRIO_20;
uint8_t standbyTimerId;
#define FIVE_S (5 * 1000 * 1000 / CFG_TS_TICK_VAL)
void RegisterDeviceModes() {
UTIL_SEQ_RegTask(CFG_TASK_STANDBY_MODE, UTIL_SEQ_RFU,StandbyMode);
HW_TS_Create(CFG_TIM_PROC_ID_ISR, &standbyTimerId, hw_ts_Repeated, QueueStandbyMode);
HW_TS_Start(standbyTimerId, FIVE_S);
}
void QueueStandbyMode() {
UTIL_SEQ_SetTask(1 << CFG_TASK_STANDBY_MODE, SCH_PRIORITY_STANDBY_MODE);
}
void StandbyMode() {
BSP_LED_Toggle(LED_RED);
HAL_Delay(5);
BSP_LED_Toggle(LED_RED);
}The problem doesn't occur on the p2pServer examples from CubeWB1.1.1 - why is this happening? How do we use the Sequencer and Timer server on the 1.5.0 p2pServer example?
I've attached a git repo which shows only 2 changes from as-downloaded: adding a Makefile, then adding the task to the sequencer.
