I am having some issues getting any CC1310 based example code to compile when using the CLang compiler (v3.2.1.LTS). My end goal is to build my code using CMake thanks to a recent addition by Alan Phipps at TI (CMake addition here). I am to the point that I am getting identical errors between CCS and CMake, but for now we can ignore the CMake portion.
When opening the `rfPacketRx` demo within CCS, I can initially compile without issue using the TI v20.2.7LTS compiler, however if I go to the project properties and update the compiler to use TI Clang v3.2.1.LTS I start getting error saying that parameter references within a `naked` function are not allowed. (I'm getting the same errors when invoking the build via CMake as well)
/home/stephen/ti/simplelink_cc13x0_sdk_4_20_02_07/source/ti/devices/cc13x0/driverlib/cpu.h:373:28: error: parameter references not allowed in naked functions : "r" (ui32NewBasepri) ^ /home/stephen/ti/simplelink_cc13x0_sdk_4_20_02_07/source/ti/devices/cc13x0/driverlib/cpu.h:366:38: note: attribute is here __STATIC_INLINE void __attribute__ ((naked))
When digging into the files, it then becomes apparent that the `__TI_COMPILER_VERSION__` macro is not being defined or used.
//***************************************************************************** // //! \brief Update the interrupt priority disable level. //! //! Use this function to change the level of priority that will disable //! interrupts with a lower priority level. //! //! \param ui32NewBasepri is the new basis priority level to set. //! //! \return None // //***************************************************************************** #if defined(DOXYGEN) __STATIC_INLINE void CPUbasepriSet(uint32_t ui32NewBasepri) { // This function is written in assembly. See cpu.h for compiler specific implementation. } #elif defined(__IAR_SYSTEMS_ICC__) __STATIC_INLINE void CPUbasepriSet(uint32_t ui32NewBasepri) { // Set the BASEPRI register. __asm(" msr BASEPRI, r0\n"); } #elif defined(__CC_ARM) || defined(__ARMCC_VERSION) __asm __STATIC_INLINE void CPUbasepriSet(uint32_t ui32NewBasepri) { // Set the BASEPRI register. msr BASEPRI, r0; bx lr } #elif defined(__TI_COMPILER_VERSION__) __STATIC_INLINE void CPUbasepriSet(uint32_t ui32NewBasepri) { // Set the BASEPRI register. __asm(" msr BASEPRI, r0\n"); } #else #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wattributes" __STATIC_INLINE void __attribute__ ((naked)) CPUbasepriSet(uint32_t ui32NewBasepri) { // Set the BASEPRI register. __asm volatile (" msr BASEPRI, %0\n" " bx lr\n" : /* No output */ : "r" (ui32NewBasepri) ); } #pragma GCC diagnostic pop #endif
I can manually define the version macro myself (yikes) and I get a bit further but then there are compiler warnings about legacy pragmas being used in the example source which are not supported in ticlang. I'll solve that when I get to it, but I'd like to figure out why the compiler version isn't being set.
Any help is greatly appreciated. Thanks!
-Stephen