Upgraded to 8.2.3 of Core Files from 8.2.2 - TI Herc App Won't Start Scheduler

westmorelandeng wrote on Tuesday, January 26, 2016:

Hello Richard,

I have an app - Hercules R4F - I updated from core files 8.2.2 to 8.2.3 and it is crashing - I have traced to one of the timer configs where it seems to crash but thought I’d ask. I am using IAR.

8.2.3 -> says I have 49 tasks - but scheduler does not start. 8.2.2 -> 41 tasks and all is well.
A bit of a mystery at the moment where 8 tasks are coming from and perhaps indicitive of the issue - I am using heap5.c.

Here is something else I am seeing - ulCriticalNesting is staying at 9999 in 8.2.3 and in 8.2.2 is reset to 0.

The app has been running fine with 8.2.2 - just wondering if anyone else has seen anything like this.
I just decided to update the core files today.

Thanks,
John

westmorelandeng wrote on Tuesday, January 26, 2016:

OK - the 8 extra tasks were due to adding the 8.2.3 files and not editing out some of the task creation (in the 8.2.3 demo files) that I had done previously - so that much is explained.

So, showing 40 tasks now with 8.2.3 - ulCriticalNesting is showing 9999 - and getting crash when trying to start scheduler.

westmorelandeng wrote on Tuesday, January 26, 2016:

In vTaskStartScheduler - it is crashing when xTimerCreateTimerTask() is called -
xCurrentNumberofTasks is 40 - which is fine for this app.

westmorelandeng wrote on Tuesday, January 26, 2016:

When pxNewTCB = prvAllocateTCBAndStack( usStackDepth, puxStackBuffer, ( TCB_t* ) pxTaskBuffer );

is called for “Tmr Svc” - and in heap_5.c where xTaskResumeAll() is called is where it fails.

westmorelandeng wrote on Wednesday, January 27, 2016:

Not sure - maybe MPU wrappers causing an issue here?
(Nope - I verified I am not accidentally using something here I am not supported to.)

westmorelandeng wrote on Wednesday, January 27, 2016:

When LR gets restored in the first task’s control block - it is corrupted. Tracing this out…
I also rolled back to the 8.2.3 tag - I was using the the tip of tree which I believe is at 2409 now but went back to the tag.

westmorelandeng wrote on Wednesday, January 27, 2016:

Well, this is interesting.
I increased memory allocation for the IAR linker and the memory region(s) that heap5.c uses - and the app is running now.
Hmmmm.
I will try the ‘tip’ of tree and report back.

westmorelandeng wrote on Wednesday, January 27, 2016:

And tip of tree breaks. (rev 2409)
Not getting past timer creation in tasks.c:#if ( configUSE_TIMERS == 1 )
{
if( xReturn == pdPASS )
{
xReturn = xTimerCreateTimerTask();
goes into the weeds before that returns
(same as what I had reported originally)

westmorelandeng wrote on Wednesday, January 27, 2016:

And if I use heap4.c vs. heap5.c it works fine.

westmorelandeng wrote on Wednesday, January 27, 2016:

I am running with the 8.2.3 tag and heap5.c - before the next tag is done - 8.2.x - can someone please update this thread as I would like to make a build and test. If it fails I would like to have a bug report issued. Thanks.