CC1352R, SDK version 4.10.00.78
Starting with BLE5 Project Zero, I added a second task following the instructions in the user guide.
int main() { <...> ProjectZero_createTask(); ValveTimerTask_createTask(); /* <-- Newly-added task */ /* enable interrupts and start SYS/BIOS */ BIOS_start(); return(0); }
static void ValveTimerTask_init(void) { /* ****************************************************************** NO STACK API CALLS CAN OCCUR BEFORE THIS CALL TO ICall_registerApp ****************************************************************** Register the current thread as an ICall dispatcher application so that the application can send and receive messages via ICall to Stack. * */ ICall_registerApp(&selfEntity, &syncEvent); }
The second task itself currently does nothing:
static void ValveTimerTask_taskFxn(UArg a0, UArg a1) { ValveTimerTask_init(); while (1) { uint32_t valve_timer_events; valve_timer_events = Event_pend(Event_handle(&timer_event), Event_Id_NONE, (uint32_t)VALVETIMER_ALL_EVENTS, (uint32_t)BIOS_WAIT_FOREVER); } }
Everything works fine as long the task priority is set higher than Project Zero (whose priority is 1)
#define VALVE_TASK_PRIORITY 2 #define VALVE_TASK_STACK_SIZE 600
But if I set VALVE_TASK_PRIORITY to 1, the application does NOT get to the line which would print:
static void ProjectZero_processGapMessage(gapEventHdr_t *pMsg) { switch(pMsg->opcode) { case GAP_DEVICE_INIT_DONE_EVENT: { <...> Log_info1("GAP is started. Our address: " \ ANSI_COLOR(FG_GREEN) "%s" ANSI_COLOR(ATTR_RESET), (uintptr_t)addrStr);
However if I debug the program and pause it, there are no exceptions; the program is in every other way executing normally. Even ROV doesn't show any issues. It is not just the UART logging that has failed either, the device cannot be seen by a phone either.
Note everything works fine when I set the second task's priority to 2. Why can't these tasks run with the same priority?