nobody wrote on Thursday, December 15, 2005:
> I have been trying to change the HCS12C32 to HCS12E128.
The 128 has 4 time the ram of the 32, so should be ok.
>I changed the cpu bean
> to the hcs12E128. Had to change timers from TM0 to TM2C4.
>I am using a softec
> board. Changed led ports from B to T. Change button bean from PP0 to PAD04.
Should not cause a problem even if this were not correct.
> Build option to small.(for now).
Easiest way to start. Presume BANKED_MODEL is therefore not defined.
>Found the info on the vector.c file change
> so I am using the vport interrupts instead of the vtask interrupt routines.
Not sure exactly what you mean by vport Vs vtask. However, provided the interrupt functions are in the correct places in the table.
> Changed the tick flag from TFLG1 to TIM2_FLG1.
I think this would be very obvious were it wrong.
>And changed the button flag from
> PIFP to PIFAD.
Likewise.
>Changed softec.ini file hardware from PK-HCS12C32 to PK-HCS12E128.
> Changed device name as well from MC9S12C32 to MC9S12E128.
>Putting a breakpoint
> inside the vTaskIncrement routine shows the tick occuring.
So the vectors must be set up correctly.
>But pressing continue
> in the debugger alows the trap to occur only about 15 times then the program
> crashes.
>Also I notice that the sp is growing and growing until it crashes.
Presumably the tick ISR does actually exit correctly and not just immediately reenter as if the interrupt has not been cleared? Could this cause the SP to wind up in this way?
> What am I missing.
Seem to have everything covered. I would suggest cutting the system back to the bones to start.
1) Set configUSE_PREEMTPION to 0 in FreeRTOSConfig.h.
2) Comment out the call to prvSetupTimerInterrupt() in port.c.
3) don’t create any of the demo tasks. Instead create two tasks as this:
void Task1( void *parameters )
{
____int count = 0;
____while( 1 )
____{
________++count;
________if( count > 1000 )
________{
____________vParTestToggleLED( 1 );
____________count = 0;
________}
________portYIELD();
____}
}
Task2 would be exactly the same but flash led 2.
As no task delays or blocks the fact that the tick is not running will not matter. With no interrupts it will be easier to step through the code and check that this is working first. Each task should just run for one cycle then yield to the other task so they take it in turns to perform one loop. Every 1000 loops it will toggle an LED. 1000 may be too high depending on the speed. With this setup you should be able to step through everything using the debugger and see exactly what it is doing.
Once this is working change portYIELD() to vTaskDelay(1) and uncomment prvSetupTimerInterrupt(). The tasks should behave in a similar manner but are now dependent on the tick ISR incrementing the tick count. If this part fails then it looks like something in the ISR is causing the problem.
Once this is working try changing configUSE_PREEMTPION back to 1 as the final step.