Skip to main content
ABN
Associate III
March 6, 2025
Question

HeartRate FreeRTOS Default task

  • March 6, 2025
  • 3 replies
  • 1175 views

Hi all,

I'm referring to BLE_HeartRateFreeRTOS example project. As per my understanding, controller wakes up to advertise based on the Adv Interval. This can be fast(80ms-100ms) or low power advertising(1s-2.5s).

In this project there is a default task, which gets initialized and is run on boot up. This default task is not running after subsequent wakeup of controller. May I know, how can I make this default task to run??

Also is there any FreeRTOS, STOP2 mode and BLE Beacon based example project available?

3 replies

ABN
ABNAuthor
Associate III
March 10, 2025

Hi @STTwo-32 , @_Joe_ 

 

Can you guys help me with this?

ABN
ABNAuthor
Associate III
March 12, 2025

Hi @Ouadi can you help me out with this??

STTwo-32
Technical Moderator
March 13, 2025

Hello @ABN 

First, could you explain more in details what are you exactly locking for. Is it a specific task that is called only once by the scheduler or what exactly? and what is the expected behavior?

Best Regards.

STTwo-32 

ABN
ABNAuthor
Associate III
March 19, 2025

Hi @STTwo-32 

Default task is created in the MX_FREERTOS_Init funciton

defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);

 The default task looks like this.

void StartDefaultTask(void *argument)
{
 /* USER CODE BEGIN StartDefaultTask */


 /* Infinite loop */
 for(;;)
 {
 osThreadFlagsWait(1,osFlagsWaitAll,osWaitForever);
 }
 /* USER CODE END StartDefaultTask */
}


When the controller wakes up from sleep, I want to run the default task to perform some sensor measurements. Right now, when the controller is waking up the default task is not hit

STTwo-32
Technical Moderator
March 24, 2025

I'm not an expert of RTOS use cases. But I may suggest you follow the implementation of the Heart rate bare metal example and how it has been migrated to the RTOS implementation (using the attached document). This way, you will be able to identifier how to go to a task to perform your task.

Best Regards.

STTwo-32