I have good news — my whole project is up and running using armclang!
I did have trouble building the FreeRTOS source itself, so I built that as a library with the old compiler. That required setting “Enum Containers always int” and adding the compiler flag “–wchar32” in order to make a library that would link with the armclag-built code.
I have not been able to test everything yet but the basic tasks seem to be running with their expected timing, including interrupt handling with yielding from ISRs.
So far the only thing tricky I did was to make changes in portmacro.h.
#define portFORCE_INLINE __attribute__((always_inline))
Then using the GCC syntax for assembly, for example, in ulPortRaiseBASEPRI:
__asm( "mrs %[ulReturn_], basepri; msr basepri, %[ulNewBASEPRI_]; dsb; isb" : [ulReturn_] "=r" (ulReturn) : [ulNewBASEPRI_] "r" (ulNewBASEPRI) );
I have not tried attribute
((naked)) or looked at the generated assembly to see if it can be slimmed down. Right now I’m just happy it works so far.
I will be testing more so I’ll post updates if I come across anything strange.
I would like to get the FreeRTOS sources building with clang but I will have to look into that more later; there were problems with compiler intrinsics and other port-specific things.