This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Source Navigator in Segger Embedded Studio reports "unknown register name 'vfpcc' in asm"

Using SEGGER Embedded Studio for ARM
Release 3.34a  Build 2018022300.35192
Windows x64

with

GCC/BINUTILS: Built using the GNU ARM Embedded Toolchain version 6-2017-q2-update source distribution

In the Output pane with "Source Navigator" selected, every file gets this error:

unknown register name 'vfpcc' in asm

Error line is in cmsis_gcc.h

/**
\brief Set FPSCR
\details Assigns the given value to the Floating Point Status/Control register.
\param [in] fpscr Floating Point Status/Control value to set
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
{
#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U)
/* Empty asm statement works as a scheduling barrier */
__ASM volatile ("");
__ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc");
__ASM volatile ("");
#endif
}

NOTE: This does not appear to prevent building.  It is distracting and can misdirect new users.

Is there any workaround or fix for this issue?

  • Obvious workaround: Disable the FPU.

    Otherwise you better contact SEGGER support directly - looks like a bug in their assembler parser.

    Note that this code is known to be broken in some cases,  see Github ticket

  • what chip are you building for, you didn't say? If the 52810 it doesn't have an FPU so that instruction would be unknown. In that case you shouldn't have the FPU_PRESENT set to true. 

  • Hi,

     

    This is an error message that is normally shown if you use clang instead of gcc in "SES project settings -> compiler -> compiler". Could you make sure you're using GCC and not clang?

     

    Cheers,

    Håkon

  • The cmsis.gcc.h from CMSIS-Core 4, which is used in your project, does only compile with GCC, but not with clang.
    For the Source Navigator Embedded Studio uses the clang indexer which results in this error message.

    Since you build your project with GCC, this message has no impact on your application and even the Source Navigator will work.

    If you want to get rid of the message, although it would just be a cosmetic change, you can modify cmsis_gcc.h to compile with clang as follows:

    /**
      \brief   Set FPSCR
      \details Assigns the given value to the Floating Point Status/Control register.
      \param [in]    fpscr  Floating Point Status/Control value to set
     */
    __attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
    {
    #if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U)
      /* Empty asm statement works as a scheduling barrier */
      __ASM volatile ("");
    #if defined (__clang__)
      __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) :);
    #else
      __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc");
    #endif
      __ASM volatile ("");
    #endif
    }

    Regards,
    Johannes

Related