Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-11787

tiarmclang ti_compatibility.h gets build errors with -mcpu=cortex-m33

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Not Prioritized Not Prioritized
    • Code Generation Tools
    • CODEGEN-12535
    • ARMCLANG_3.2.2.LTS
    • default
    • Hide
      ti_compatibility.h is meant to provide backward compatibility when porting source code from the proprietary arm compiler (armcl), which didn't (officially) support Cortex-M33. The proprietary compiler provided intrinsics like

      _disable_interrupts()
      and friends for the supported targets, and so that is what you see there.

      Since you're not relying on a standard driver interface like CMSIS (which provides these routines), you have to define your own routines that use the CPSID/CPSIE hardware instructions to disable and enable interrupts – basically do what ti_compatibility.h effectively does.

      We do have an action to document how to disable/enable/restore interrupts without CMSIS and without ti_compatibility.h
      Show
      ti_compatibility.h is meant to provide backward compatibility when porting source code from the proprietary arm compiler (armcl), which didn't (officially) support Cortex-M33. The proprietary compiler provided intrinsics like _disable_interrupts() and friends for the supported targets, and so that is what you see there. Since you're not relying on a standard driver interface like CMSIS (which provides these routines), you have to define your own routines that use the CPSID/CPSIE hardware instructions to disable and enable interrupts – basically do what ti_compatibility.h effectively does. We do have an action to document how to disable/enable/restore interrupts without CMSIS and without ti_compatibility.h

      The attached file.c includes ti_compatibility.h and calls ...

      _restore_interrupts
      

      Build it ...

      % tiarmclang -mcpu=cortex-m33 -c file.c
      In file included from file.c:1:
      C:\ti\compilers\ti-cgt-armllvm_3.2.2.LTS\include\c\ti_compatibility.h:1529:21: error: invalid
            operand for instruction
          __asm volatile ("MSR CPSR_fc, %0" : : "r" (x) : );
                          ^
      <inline asm>:1:5: note: instantiated into assembly here
      MSR CPSR_fc, r1
          ^
      1 error generated.
      

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: