Sysprogs forums › Forums › VisualGDB › Problem with ProfilerRTOS_FreeRTOS.c
Tagged: FastSemihosting, FreeRTOS, RTOS
This topic contains 3 replies, has 2 voices, and was last updated by elivoe 2 years, 3 months ago.
-
AuthorPosts
-
July 2, 2021 at 10:07 #30858
Hi,
in the ProfilerRTOS_FreeRTOS.c file there is the following function:
C++123456789101112131415161718192021void 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_nRF5XxxxxSysprogsRTOSHooks_FreeRTOS_RTC1_IRQHandler();#endifSysprogsRTOSHooks_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, 3 months ago by
support. Reason: formatting
July 2, 2021 at 10:15 #30859A possible fix could be something like that:
C++1234#ifndef xQueueSendFromISRextern void xQueueGenericSendFromISR();extern void xQueueReceiveFromISR();#endif // xQueueSendFromISRSo it detects if the “queue.h” file is included by checking if the xQueueSendFromIsr is defined.
-
This reply was modified 2 years, 3 months ago by
support. Reason: formatting
July 5, 2021 at 09:37 #30870Hi,
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.
July 5, 2021 at 12:28 #30871Hi,
Thank you for your quick response and the fix!
-
This topic was modified 2 years, 3 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.