426 views
in GUI Development by

Hi Manfred,

 

I am now working on threads. 

I created another task(RFID_task) with the GUI_task(GuiThread). but both can not run simultaneously.

If i just print debug line(comment all other things in GUI_task) in GUI_task then both can run simultaneously. but if i use to uncomment the code in GUI_task then it stuck and didn't display GUI. i atteched my main function please refer.

Is any setting to do if i have to run another task with GUI_task?

Hope you can help. Have a nice day.

 

Thanks,

Chand Bhadaniya

int main(void)
{
  BOARD_Initialization();       /* Board Hardware Initialization */
  BOARD_PeripheralInit();       /* LCD hardware Initialization */
  
  if (xTaskCreate(RFID_Task, "RFID_Task", RFID_Task_STACKSIZE, NULL, 1, NULL) != pdPASS)
  {
    PRINTF("RFID Task creation failed!.\r\n");
    while (1)
      ;
  }

  if (xTaskCreate(GUI_Task, "GUI_Task", GUI_Task_STACKSIZE, NULL, 1, NULL) != pdPASS)
  {
    PRINTF("GUI Task creation failed!.\r\n");
    while (1)
      ;
  }
 
  vTaskStartScheduler();
  for (;;)
    ;
}

 

1 Answer

0 votes
by

Hi Chand,

 

a few weeks ago another user had a similar problem. I've explained how to add a task for testing reasons here.

Hopefully that can help you too.

 

Best regards,

 

Tim

by
Hello Tim,

 

We have done same thing but while we are just put print message their, It is working but when we put whole code It is not working. I have one doubt you are incrementing one variable in systickhandler. I think that is creating issue for us. Can you please inform me a way to increment your variable on other timer or any other way to solve this error.
by

Hi Chand,

 

first of all, good that both task are running if you just using the print statement.

 

Could you please check whether the stack and heap size is great enough?

You'll find the defines for that in “FreeRTOSConfig.h”: 

#define configMINIMAL_STACK_SIZE                ( ( uint16_t ) 128 )

#define configTOTAL_HEAP_SIZE                   ( ( size_t ) ( 10 * 1024 ) )

 

Depending on the complexity of your RFID task, you probably have to adapt this settings. If that doesn’t help, could you please try to change the task priority of you RFID task to any value higher than the GUI task has.

 

Btw, did you get any logging information in you console?

That might be useful to determine whether the UI starts correctly.

 

Best regards,

 

Tim

by
Hi Tim,

 

First of all thanks for your replay.

There is a problem of timer which i mentioned before. and now it is solved.

 

Thanks,

Chand Bhadaniya

Embedded Wizard Website | Privacy Policy | Imprint

...