Got an issue with task dynamically allocated. It works fine to use xSemaphoreMutexStatic() and xCreateTaskStatic(). Once using xSemaphoreMutex() and xCreateTask(), then no tasks are running.
Dynamic allocation is configured as 1 and the heap size is configured as (size_t)(8*1024). heap_4.c is included in the project.
The return value of xCreateTask() is ok. But once it is created and then other tasks stop running.
What could be the potential cause?
Thanks!
Crane
If the xCreateTask() was called PRE scheduler, then one possibility is that FreeRTOS just did not start as it failed to be able to create one of its built in tasks (Idle, and perhaps the Timer if needed).
What do you mean “break the code in the debugger”? It gets stuck after the scheduler is called. How to track what’s happening in this case?
Yes, configASSERT is defined and overflow check is configured as 1.
Idle task is created successfully statically. (Static allocation is also configured).
Timer task is not configured.
Scheduler is started. Then the program appears stopped as no task is running then.
It is for TI C28x from C2000Ware SDK provided by TI.
No, no matter stepping into or stepping over, sometimes it calls Interrupt_illegalOperationHandler() and sometimes the program just stops and both buttons of “step into” and “step over” are in grey.
Can you check with port.c file does it use? It should be present in FreeRTOS/portable directory. I am trying to see if you are using one of the official port or a port supplied by the vendor.
I am using FreeRTOSv202112.00. It is the latest version and doesn’t have the port for C28x.
The port I am using is actually posted on the internet first and recently it is included by TI in their C2000Ware SDK. Suppose it should work fine.
The question is, if it have potential problem, is there any way to debug to find it out?
An update.
Right now, the only issue is when the build configuration is set as RAM and the task is created statically, it will cause software interrupt. Otherwise, the tasks are running properly except the new task.
Anyway, the issue raised in the first post in this thread is addressed. I found it is relevant to the priority level of the new task.
Ok, thank you.
It works fine when the program is built for FLASH, no matter if the task is created statically or dynamically.
When the program is built for RAM, it works in a certain scenario and didn’t work most time .
I am afraid that the issue is relevant to linker file.