Problem with ProfilerRTOS_FreeRTOS.c

Sysprogs forums Forums VisualGDB Problem with ProfilerRTOS_FreeRTOS.c

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30858
    elivoe
    Participant

    Hi,

     

    in the ProfilerRTOS_FreeRTOS.c file there is the following function:

    void InitializeProfilerRTOSHooks()
    {
    volatile int x = 0;
    extern void xQueueGenericSendFromISR();
    extern void xQueueReceiveFromISR();
    if (x)
    {
    SysprogsRTOSHooks_FreeRTOS_vTaskSwitchContext();
    SysprogsRTOSHooks_FreeRTOS_vTaskDelete(0);
    SysprogsRTOSHooks_FreeRTOS_SysTick_Handler();
    #ifdef PROFILER_nRF5Xxxxx
    SysprogsRTOSHooks_FreeRTOS_RTC1_IRQHandler();
    #endif
    SysprogsRTOSHooks_FreeRTOS_SVC_Handler();
    SysprogsRTOSHooks_FreeRTOS_traceQUEUE_SEND_Actual(0);
    SysprogsRTOSHooks_FreeRTOS_traceQUEUE_RECEIVE_Actual(0);
    SysprogsRTOSHooks_FreeRTOS_SchedulerStarting();
    x = (int)&xQueueGenericSendFromISR;
    x = (int)&xQueueReceiveFromISR;
    }
    }

    If I compile a project with FreeRTOS and FastSemihosting I get the compiler errors “Error conflicting types for ‘xQueueGenericSendFromISR’ …” and “Error conflicting types for ‘xQueueReceiveFromISR’ …”. This is because the file includes “FreeRTOS.h” which further includes “queue.h” (at least in the FreeRTOS port I use). So the declaration of those two functions is in the same c file and gets compiled into the same object. As the declaration does not match (return type and paramters) the compiler throws those two error messages. Of course I can fix this for myself but I would have to change it any time you update the FastSemihosting code. It would be great if you could fix it in your code as well.

     

    Thanks!

     

    Elias

    • This topic was modified 2 years, 8 months ago by support. Reason: formatting
    #30859
    elivoe
    Participant

    A possible fix could be something like that:

    #ifndef xQueueSendFromISR
    extern void xQueueGenericSendFromISR();
    extern void xQueueReceiveFromISR();
    #endif // xQueueSendFromISR

    So it detects if the “queue.h” file is included by checking if the xQueueSendFromIsr is defined.

     

    • This reply was modified 2 years, 8 months ago by support. Reason: formatting
    #30870
    support
    Keymaster

    Hi,

    Thanks for pointing it out. Indeed, in our test setups, the FreeRTOS.h did not directly include queue.h, so the profiler hooks built without any issues.

    We have switched ProfilerRTOS_FreeRTOS.c to reference the FreeRTOS functions in a way that does not depend on the included headers. You can find the details in this commit. The fix will be included in the next update of our profiler framework.

    #30871
    elivoe
    Participant

    Hi,

     

    Thank you for your quick response and the fix!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.