0
votes

I use Keil uvision5 to compile cmsis_os.c (wrapper for my FreeRTOS).

I get this this error: ..\Middlewares\Third_Party\FreeRTOS\Source\portable\GCC\ARM_CM4F\portmacro.h(221): error: #18: expected a ")"

portmacro.h has this:

portFORCE_INLINE static void vPortRaiseBASEPRI( void )
{
    uint32_t ulNewBASEPRI;

    __asm volatile
    (
        "   mov %0, %1                                              \n" \
        "   msr basepri, %0                                         \n" \
        "   isb                                                     \n" \
        "   dsb                                                     \n" \
        :"=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY )    <<<<<<<<<<< LINE WITH THE ERROR.
    );
}

ARM is STM32F417VG. FreeRTOS source code is V8.1.2

We have existing gcc-based source code for our ARM that I need to port onto Keil IDE. I used ST CubeMx to generate a virgin Keil project. Then, I added v8.1.2 FreeRTOS source code, including cmsis_os.c and cmsis_os.h because Keil needs cmsis RTOS wrapper for debugger etc.

1
"I cannot find ulNewBASEPRI anywhere." - modulo broken formatting, it's declared right there as a local variable... Either way, that's some GCC-specific syntax and functionality, so compiling it with not-GCC is going to mean rewriting it. FreeRTOS claims to support the Keil tools directly, so why do you need to mess with the GCC version of the sources anyway?Notlikethat

1 Answers

0
votes

With Keil you should use appropriate files from FreeRTOS\Source\portable\RVDS\ARM_CM4F\

This function in Keil syntax looks like

static portFORCE_INLINE void vPortRaiseBASEPRI( void )
{
    uint32_t ulNewBASEPRI = configMAX_SYSCALL_INTERRUPT_PRIORITY;
    __asm
    {
        msr basepri, ulNewBASEPRI
        dsb
        isb
    }
}