mjachapman wrote on Tuesday, July 02, 2019:
Hi, I have taken a Version 8.3.1 Free RTOS that compiles and runs on an Adafruit M0+ and used that as the basis of an upgrade to 10.2.1. There is another Arduino library based on 10.2.1 but its for AVR processors and includes a lot of assembler inserts so is less useful to me.
The IDE is Atmel Studio that uses a GCC compiler.
The files came from the M0+ port.
However I have to the stage of trying to get it compile but unfortunately is fails around a function that includes assembler inserts:
void vPortStartFirstTask( void )
{
/* The MSP stack is not reset as, unlike on M3/4 parts, there is no vector
table offset register that can be used to locate the initial stack value.
Not all M0 parts have the application vector table at address 0. /
__asm volatile (
" .syntax unified \n"
" ldr r2, pxCurrentTCBConst2 \n" / Obtain location of pxCurrentTCB. /
" ldr r3, [r2] \n"
" ldr r0, [r3] \n" / The first item in pxCurrentTCB is the task top of stack. /
" adds r0, #32 \n" / Discard everything up to r0. /
" msr psp, r0 \n" / This is now the new top of stack to use in the task. /
" movs r0, #2 \n" / Switch to the psp stack. /
" msr CONTROL, r0 \n"
" isb \n"
" pop {r0-r5} \n" / Pop the registers that are saved automatically. /
" mov lr, r5 \n" / lr is now in r5. /
" pop {r3} \n" / Return address is now in r3. /
" pop {r2} \n" / Pop and discard XPSR. /
" cpsie i \n" / The first task has its context and interrupts can be enabled. /
" bx r3 \n" / Finally, jump to the user defined task code. */
" \n"
" .align 4 \n"
"pxCurrentTCBConst2: .word pxCurrentTCB "
);
}
If I comment out assembler in this function it compiles but the compliation error doesn’t seem to be related to the code!
Compiling ‘4_RTOS_10_2_SAMD21_Demo_V01’ for ‘Adafruit Feather M0’
cc3u5LMY.s: Assembler messages
Error compiling project sources
Build failed for project ‘4_RTOS_10_2_SAMD21_Demo_V01’
cc3u5LMY.s*:86: cannot honor width suffix – mov r4,#128
cc3u5LMY.s*:87: lo register required – sub r3,r0,#4
cc3u5LMY.s*:88: cannot honor width suffix – lsl r4,r4,#17
cc3u5LMY.s*:90: lo register required – sub r3,r3,#4
cc3u5LMY.s*:93: lo register required – sub r3,r3,#4
cc3u5LMY.s*:95: lo register required – sub r3,r3,#20
cc3u5LMY.s*:96: lo register required – sub r0,r0,#64
cc3u5LMY.s*:129: cannot honor width suffix – mov r0,#0
cc3u5LMY.s*:149: cannot honor width suffix – mov r2,#255
cc3u5LMY.s*:151: cannot honor width suffix – lsl r2,r2,#16
cc3u5LMY.s*:152: cannot honor width suffix – orr r2,r1
cc3u5LMY.s*:155: cannot honor width suffix – mov r2,#255
cc3u5LMY.s*:156: cannot honor width suffix – lsl r2,r2,#24
cc3u5LMY.s*:157: cannot honor width suffix – orr r2,r1
cc3u5LMY.s*:161: cannot honor width suffix – mov r4,#0
cc3u5LMY.s*:169: cannot honor width suffix – mov r2,#7
cc3u5LMY.s*:199: cannot honor width suffix – mov r3,#250
cc3u5LMY.s*:200: cannot honor width suffix – lsl r3,r3,#2
cc3u5LMY.s*:225: cannot honor width suffix – mov r2,#128
cc3u5LMY.s*:226: cannot honor width suffix – lsl r2,r2,#21
cc3u5LMY.s*:255: lo register required – add r2,r2,#1
cc3u5LMY.s*:289: lo register required – sub r3,r3,#1
cc3u5LMY.s*:345: cannot honor width suffix – mov r2,#128
cc3u5LMY.s*:347: cannot honor width suffix – lsl r2,r2,#21