Problem Sending MQTT messages using FreeRTOS
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-12-04 4:40 AM
Hello,
I have an FreeRTOS task that sends 4 MQTT messages (using LwIP MQTT) every 10 seconds:
void HomeAssistantConfigTask(void *argument)
{
/* USER CODE BEGIN HomeAssistantConfigTask */
/* Infinite loop */
for(;;)
{
SendAvailabilityMessage();
SendPowerConfigMessage();
SendDisplayConfigMessage();
SendFrontLedConfigMessage();
osDelay(10000);
}
osThreadTerminate(NULL);
/* USER CODE END HomeAssistantConfigTask */
}
But most of the times the last 2 messages are not sent... Seems like the thread is being interrupted before sending the message. I also tried to add osDelay between sending messages and I have same problem.
I have in total 4 FreeRTOS tasks and this one is configured like this:
osThreadId_t HMConfigTaskHandle;
const osThreadAttr_t HMConfigTask_attributes = {
.name = "HMConfigTask",
.stack_size = 4096 * 4,
.priority = (osPriority_t) osPriorityAboveNormal2,
};
The other tasks are running every 100ms and every 5s.
I'm using STM32F407VGT with FreeRTOS using CMSIS_V2.
Thanks for reading.
Labels:
- Labels:
-
CMSIS
-
FreeRTOS
-
STM32F4 Series
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
