Hi, first some background, i'm using the KW45B41Z Eval Board with SDK version 24.12.00. With this configuration i'm trying to modify the beacon app, in this case by adding a periodic timer.
However i'm having some issues where the timer callback does not trigger and by debugging the application i can see that the program goes into panic for the gAdvertisingCommandFailed_c or the gInternalError_c reason.
The BLE stack has not been modified, the timer initialization is the default one in the PLATFORM_InitTimerManager function (No issues detected there). Afater this in the main i have the following configuration:
// Define the timer manager handle
uint32_t timerHandle[((TIMER_HANDLE_SIZE + sizeof(uint32_t) - 1U) / sizeof(uint32_t))];
//support variable to toggle the timer
static bool ledState = true;
// Define a callback for time
void my_timer_callback(void *param) {
(void)param; // Explicitly ignore unused parameter
if (ledState == true) GPIO_PinWrite(GPIOA, 19U, 0);
else GPIO_PinWrite(GPIOA, 19U, 1);
ledState = !ledState;
}
...
int main(void)
{
...
GPIO_PinWrite(GPIOA, 19U, 1);
/* Start Host stack */
BluetoothLEHost_AppInit();
timer_status_t checkTM = TM_Open(timerHandle);
if (checkTM =! kStatus_TimerSuccess){
//TODO, Do something if timer manager does not open
};
checkTM = TM_InstallCallback(timerHandle,(timer_callback_t) my_timer_callback,NULL);
if (checkTM =! kStatus_TimerSuccess){
//TODO, Do something if timer manager does not open
};
my_timer_callback(NULL);
checkTM = TM_Start(timerHandle,kTimerModeIntervalTimer,1000);
if (checkTM =! kStatus_TimerSuccess){
//TODO, Do something if timer manager does not open
};
BleApp_Start();
uint8_t check = TM_IsTimerActive(timerHandle);
if (checkTM =! 1){
//TODO, Do something if timer manager does not open
};
...
Here i have omitted the unmodified section of code that are in the beacon example. As far i can tell by following the SDK documentation the timer configuration should be correct so i'm having some issue fixing the error.
Thank you in advance.