2020-08-14 03:46 AM
Hello, I'm using FreeRTOS on STM32F746NG.
I have created 4 task which run with the same priority.
But when I run my code,Only StartDefaultTask running, others aren't.
In debug mode, when I clicked Resume(F8), the pointer always jump to start of StartDefaultTask function.
My functions are working correctly in another project.
Anyone can help my fix this bug?
Many thanks,
Hieu
Here is my task define:
osThreadId defaultTaskHandHandle;
osThreadId MQTTTaskHandHandle;
osThreadId PubTaskHandHandle;
osThreadId UpdateTaskHandle;
void StartDefaultTask(void const * argument);
//void StartDefaultTask(void * argument);
/* USER CODE BEGIN PFP */
void MQTTTask(void *client);
void PubTask(void *argument);
void SyncTask(void *argument);
osThreadDef(defaultTaskHand, StartDefaultTask, osPriorityNormal, 0, 4096);
defaultTaskHandHandle = osThreadCreate(osThread(defaultTaskHand), NULL);
osThreadDef(MQTTThread, MQTTTask, osPriorityNormal, 0, 1024);
MQTTTaskHandHandle = osThreadCreate(osThread(MQTTThread), client);
osThreadDef(PubThread, PubTask, osPriorityNormal, 0, 512);
PubTaskHandHandle = osThreadCreate(osThread(PubThread), client);
osThreadDef(UpdateThread, SyncTask, osPriorityNormal, 0, 256);
UpdateTaskHandle = osThreadCreate(osThread(UpdateThread), client);
/* USER CODE BEGIN RTOS_THREADS */
Here is my StartDefaultTask, this task running with TouchGFX
void StartDefaultTask(void const * argument)
{
/* USER CODE BEGIN 5 */
// mqtt_do_connect(argument);
MX_TouchGFX_Process();
/* Infinite loop */
for(;;)
{
osDelay(1);
}
/* USER CODE END 5 */
}
Solved! Go to Solution.
2020-08-14 07:04 AM
and when you set a breakpoint in another task?
2020-08-14 07:04 AM
and when you set a breakpoint in another task?
2020-08-14 02:10 PM
Hi,
Are you sure that the threads were correctly created? could you check that the thread_id handles are not "NULL",
if it is the case then try to increase the FreeRTOS heap in the FreeRTOSConfig.h file.
regards
Haithem.
2020-08-16 07:42 PM
many thanks KnarfB, a unexpected breakpoint was set in my code but it's invisible in my debug mode. I dont know why but when I removed it, my program worked.
2020-08-16 07:42 PM
many thanks KnarfB, a unexpected breakpoint was set in my code but it's invisible in my debug mode. I dont know why but when I removed it, my program worked.