FreeRTOS with Stellaris LM3S9D92 and LWIP

barryandrews wrote on Tuesday, November 13, 2012:

Sorry it is pxCurrentTCB which is getting trashed, not the constant.  Not sure how I made that mistake.  Anyway it is the current pointer which winds up being 1 and hence a crash occurs when it tries to swith to the corrupt context.

barryandrews wrote on Wednesday, November 14, 2012:

Tracing through the pxReadyTasksLists this is where corruption appears to happen.
The priority 0 tasks (IDLE is my only one)  The end of the list which has xItemValue set to 0xFFFFFFFF has an owner of 0x00000001 when it crashes, normally this is 0x00000000

I currently am doing nothing in the idle task but increment a conter (unsigned long) ;

I have 5 tasks total running, plenty of stack on each.

My own two tasks (Priority 2) just wake up every 200ms to look for keyboard inputs and 5 seconds to print out stack usage
“vTaskList(statsbuff);” statsbuff is just a 1000 character static buffer not on the stack.

The LWIP TCPIP task is priority 1 and is running fine at the time of failure (bieing bombarded with pings to test).

The final task is the TMR SVC which is priority 3 (I have enabled 5 priority levels), I am not actually running any timers.

98% of the time idle is the task according to the stats on web page.

web page is also doing vTaskList which would be from a different task with its own buffer and is updating very 2 seconds, could calling this from two tasks cause an issue?
It says it suspends all tasks then resumes all tasks so I would hav thought no?

rtel wrote on Wednesday, November 14, 2012:

I don’t know which tools you are using, but some will allow you to put a watch point on memory getting written to.  If you are able to do that, then you can set one on the end of list owner value to see when it changes from NULL (its correct value) to 1.  If you are getting memory corruption then I expect it will be affecting more than one single value.

Regards.

barryandrews wrote on Friday, November 30, 2012:

Hello Richard

I now have this working, problem was an interrupt level and a couple of LWIP settings.

Do you want a copy of the basic project to add to your existing ports?
I have kept just simple web server example and now moving on to my own code development in a separate project.

Works with LWIP 1.4.0 (Latest from git) and FreeRTOS 7.3.0
Processor is Stellaris LM3S9D92 (EKS-LM3S9D92 Evaluation Kit).
Compiler is CCSV5 with Stellarisware installed.

Thanks again for your help and let me know if you want the source for this port.

rtel wrote on Friday, November 30, 2012:

I would be very grateful if you could upload the project to the FreeRTOS Interactive site.  Especially as it is a CCS5 port I think people will find it useful.

http://interactive.freertos.org/forums/135229-texas-instruments

Regards.

barryandrews wrote on Monday, December 03, 2012:

Submitted to the TI section.