cancel
Showing results for 
Search instead for 
Did you mean: 

Using CMSIS for FreeRTOS implementation but osDelayUntil results in a hard fault error!

JKahn.1
Associate III

Hi,

I am attempting to use the example code from CMSIS documentation here: https://www.keil.com/pack/doc/CMSIS/RTOS2/html/group__CMSIS__RTOS__Wait.html\

But it results in HardFault.

Working around currently by using

#include "FreeRTOS.h"

#include "task.h"

and running the bare FreeRTOS syntax and functions:

void StartLedBlink01(void *argument)

{

 /* USER CODE BEGIN 5 */

TickType_t lastWakeTime;

const TickType_t frequency=500;

lastWakeTime=xTaskGetTickCount();

 /* Infinite loop */

 for(;;)

 {

vTaskDelayUntil(&lastWakeTime,frequency);

  HAL_GPIO_TogglePin(LD2_GPIO_Port, LD2_Pin);

 }

 // Add termination if exit the loop accidentally

  osThreadTerminate(NULL);

 /* USER CODE END 5 */

}

Is there any way to make the CMSIS osDelayUntil() function work properly?

The osDelay() function works fine, but I need the functionality of the osDelayUntil function.

0 REPLIES 0