TI Tiva TM4c1294 FreeRTOS v10.2.1


I am looking to run the freeRTOS kernel on a tm4c1294 custom board. I am using CCS v9.1 and FreeRTOS v10.2.1. Most of the examples for this processor are older. Running kernel v7. I believe I successfully setup my project to use the newer kernel. Tick seems to be hitting and the scheduler runs.

However, any task create sends me to a fault_isr. The function prvAddNewTaskToReadyList within task.c never returns and sends me to a hardfault.

Due to the many updates to the kernel from the available projects from TI, I am using the generic config header. I am wondering if I don’t have something in there setup quite right.

Is anyone aware of a more recent example for the TI Tiva TM4C line? Anyone have an example header I could look at?

Thanks in advance!

You should find the kernel is just a drop in replacement for the v7 code - one slight difference might be that mutexes cannot be used from interrupts any more due to the way priority inheritance works. If there are any differences it will be with the tools, rather than the C code.

Are you saying creating a task after the scheduler has already started is causing the hard fault? It sounds like it because you say the tick interrupt is running. If that is the case then creating a task is not the issue in itself as you will already have created at least the idle task with an issue. Therefore your problem might be that you are simply running our of heap, or something like that.

When you step into the code in the debugger, at which point does it crash?
Are you sure it is crashing in the task create function, and not in the task you are creating - as that task may execute before the task create function exits.
Have you done everything recommended here?

Hi Richard,

I was not familiar with the link you provided. I’ll look those over.

I should have been more clear in my initial post. If I comment out all task creations then the scheduler is able to launch,hit the systick interrupt, and is not hitting the faultisr. Adding any task creation in creates the problem.

The line of code that sends it out to lunch is with tasks.c. It has the comment “Fill the stack with a known value to assist debugging.” This seems true for any task created. I have toyed with the stacksize bigger and smaller.

I will be reviewing the links you have given.

That line fills the stack allocated to the task with a known value. If writing to the task stack causes a hard fault then it might be that the memory is invalid or overlapping with other memory. Which heap allocation scheme are you using? Are you sure your linker script is correct?

Agreed. I have taken a look at the linker file. I was using the default linker tables but I have also tried re-arranging them. That doesn’t seem to make a difference.

I am currently trying to use Heap_1.c but I have also tried heap_4.c with similar results.

In my latest attempt I am passing in memset(0x20008000, 0xa5u, (512 * 4)).