Skip to main content
Chandan Bhatia1
Associate III
January 7, 2021
Question

STM32 Resetting after adding Touchgfx task in FreeRTOS

  • January 7, 2021
  • 2 replies
  • 1779 views

Hello, I am using custom board with MCU 746 and generated my project with latest cubmx. When I added Touchgfx task in FreeRTOS, STM started getting reset like for 15-20 times, than everything starts working fine.

Below is the stack information when it goes for hardfault. Also Model::tick() is getting called for once before reset.

0693W000006HrX1QAK.png 

Any suggestions ?

 osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 7000);
 
 defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
 
 
 
void StartDefaultTask(void const * argument)
 
{
 
 /* USER CODE BEGIN 5 */
 
MX_TouchGFX_Process();
 
 /* Infinite loop */
 
 for(;;)
 
 {
 
 osDelay(1);
 
 }
 
 /* USE

This topic has been closed for replies.

2 replies

Chandan Bhatia1
Associate III
January 8, 2021

While debugging I fond that Touchgx function  Model::tick()  is getting called before STM hardfault.

Alexandre RENOUX
Visitor II
January 8, 2021

Hello Chandan Bhatia,

I cannot really help if I don't see your code.

If I had your project in hands, I would first compare everything to the Application Template F746-DISCO and see what are the differences and why they exist. From another post of yours, I believe not much should be different.

Then, if I'm sure that my code is in line with the Application Template (I suspect it's not if you have a hardfault), I would start investigating my custom elements implementation such as the custom display driver implementation,etc.

Also trying the project on CubeMX 6.0.1 and TouchGFX 4.15 could be something I would try. In fact, CubeMX 6.1.1 was not fully tested with TouchGFX 4.16 so minor issues could appear if you're unlucky.

Hope this will be helpful

/Alexandre

Chandan Bhatia1
Associate III
January 8, 2021

@Alexandre RENOUX​  I am putting my project on google drive. Please share your mail id for access.