Sysprogs forums › Forums › VisualGDB › Problem with ProfilerRTOS_FreeRTOS.c
Tagged: FastSemihosting, FreeRTOS, RTOS
- This topic has 3 replies, 2 voices, and was last updated 4 years, 3 months ago by
elivoe.
-
AuthorPosts
-
July 2, 2021 at 10:07 #30858
elivoe
ParticipantHi,
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 4 years, 3 months ago by
support. Reason: formatting
July 2, 2021 at 10:15 #30859elivoe
ParticipantA 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 4 years, 3 months ago by
support. Reason: formatting
July 5, 2021 at 09:37 #30870support
KeymasterHi,
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 #30871elivoe
ParticipantHi,
Thank you for your quick response and the fix!
-
This topic was modified 4 years, 3 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.