ampltd wrote on Thursday, March 13, 2014:
Hello, Thanks for the reply,
The code compiles with no errors and runs as shown below up to the instruction :
bsr.a _main
_PowerON_Reset :
/* initialise user stack pointer */
mvtc #_ustack,USP
/* initialise interrupt stack pointer */
mvtc #_istack,ISP
/* setup intb /
mvtc #_rvectors_start, intb / INTERRUPT VECTOR ADDRESS definition */
/* setup FPSW */
mvtc #100h, fpsw
/* load data section from ROM to RAM */
mov #_mdata,r2 /* src ROM address of data section in R2 */
mov #_data,r1 /* dest start RAM address of data section in R1 */
mov #_edata,r3 /* end RAM address of data section in R3 */
sub r1,r3 /* size of data section in R3 (R3=R3-R1) */
smovf /* block copy R3 bytes from R2 to R1 */
/* bss initialisation : zero out bss */
mov #00h,r2 /* load R2 reg with zero */
mov #_ebss, r3 /* store the end address of bss in R3 */
mov #_bss, r1 /* store the start address of bss in R1 */
sub r1,r3 /* size of bss section in R3 (R3=R3-R1) */
sstr.b
/* call the hardware initialiser */
bsr.a _HardwareSetup
nop
/* setup PSW /
mvtc #10000h, psw / Set Ubit & Ibit for PSW */
/* change PSW PM to user-mode */
; MVFC PSW,R1
; OR #00100000h,R1
; PUSH.L R1
; MVFC PC,R1
; ADD #10,R1
; PUSH.L R1
; RTE
; NOP
; NOP
/* start user program */
bsr.a _main
bsr.a _exit
At this point it is stuck in the FreeRTOS function below with nothing happening and no tasks running (using the 780k processor selection in eclipse)
static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
/* Stop warnings. */
( void ) pvParameters;
for( ;; )
{
/* See if any tasks have been deleted. */
prvCheckTasksWaitingTermination();
if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) >
( unsigned portBASE_TYPE ) 1 )
{
taskYIELD();
}
}
If I INCORRECTLY Use the 1M processor selection then we jump to main() and the tasks seem to run ok
I have looked at the stack pointers and the load data registers in this startup code for both possible processors and they both seem correct
There is NO code in the _HardwareSetup routine and I don’t think there is any other hardware initialisation, the code works ok with B processor with or without network and doesn’t work with A processor at all.
I do not know where there is a memory map (rom/ram sections etc) I have simply selected the correct processor in eclipse.
No exceptions, just stuck in portTASK_FUNCTION()
Many thanks,
Alan…