Porting to hcs12x (mc9s12xdp512–hcs12 with xgate; code warrior; banked; FreeRTOS 5.02 demo)
1. hcs12x saves 3 additonal bits of CCR (IPV) meaning SaveContext must create 10-byte stack not 9 as in hcs12. (Demonstration, best seen with FCS: break before the _asm(rti) in startscheduler. Verify values at end of SP frame (ccr,ab,x,y,pc). Assembler-step. Verify new PC is bytes 9 and 10, therefore frame is actually 10B not 9B as in demo’s code.)
2. demo also seems to use heap2.c for pvPortMalloc and pvPortFree yet “unable to allocate to segment RAM at 2068” in linker. Problem is due to linker trying to allocate the heap’s data. One fix is to use Codewarrior’s ansilib malloc()/free(). Not sure about impact on banking.