Skip to main content
JKahn.1
Associate III
February 19, 2020
Question

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

  • February 19, 2020
  • 0 replies
  • 1211 views

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.

This topic has been closed for replies.