Port FreeRTOS on RF transmitter project

Hello,

I have some real-time requirements needed to be implemented on RF transmitter project.

In the project files, app_timer2.c has already been included, and I have to add app_timer_freertos.c in it.

I set the default RTC of app_timer to be 2  in preprocessor definition to avoid conflicts with freertos one, but however, i get lots of multiple definition errors  such as :

Output/Release/Obj/transmitter_pca10056/app_timer2.o: in function `app_timer_stop': multiple definition of `app_timer_stop'; Output/Release/Obj/transmitter_pca10056/app_timer_freertos.o:\nRF5_SDK_17.1.0_ddde560\components\libraries\timer/app_timer_freertos.c:215: first defined here

Output/Release/Obj/transmitter_pca10056/app_timer2.o: in function `app_timer_start': multiple definition of `app_timer_start'; Output/Release/Obj/transmitter_pca10056/app_timer_freertos.o:\nRF5_SDK_17.1.0_ddde560\components\libraries\timer/app_timer_freertos.c:215: first defined here

When I just chose one of the two .c files (app_timer_freertos.c , app_timer2.c), I got fatal error at run time execution.

Are there any ways to use these two files simultaneously?

Thanks. 

Parents
  • Hello,

    app_timer_freertos.c is just an API wrapper to let SDK modules which normally rely on app_timer use the native Freertos timers instead. This is why you get the naming conflicts when including both.

    I would not expect the freertos implementation to have any better timing characteristics than the app timer.  Both use the same HW clock source,  and with the app timer you can do all processing within the RTC interrupt context if you want, while with Freertos timers you always have to defer the event processing to a task/thread (=more processing overhead).

    If you are not getting enough accuracy from the app_timer, then you probably need to use a TIMER instance instead of the RTC.

    Best regards,

    Vidar

Reply
  • Hello,

    app_timer_freertos.c is just an API wrapper to let SDK modules which normally rely on app_timer use the native Freertos timers instead. This is why you get the naming conflicts when including both.

    I would not expect the freertos implementation to have any better timing characteristics than the app timer.  Both use the same HW clock source,  and with the app timer you can do all processing within the RTC interrupt context if you want, while with Freertos timers you always have to defer the event processing to a task/thread (=more processing overhead).

    If you are not getting enough accuracy from the app_timer, then you probably need to use a TIMER instance instead of the RTC.

    Best regards,

    Vidar

Children
No Data
Related