cancel
Showing results for 
Search instead for 
Did you mean: 

BLE router with FreeRTOS

~Amit~
Associate III

Hey guys,

I am going to start a project which required to have the BLE router.

I prefer to stick to the FreeRTOS as my O.S due to regulations and standards this project needs to pass.

I know there is no such example who combined router with freeRTOS, so I guess I will need to merge between the heartrate with FreeRTOS and the router examples.

as far as I am aware there are 2 main issues I need to consider. the first is the low power handling and the second and obvious is scheduler vs O.S.

I would really appreciate it if someone can give some guidelines on how to approach this kind of task and if it is better to merge the router capability into the freeRTOS example or vice versa.

Thank u.

1 ACCEPTED SOLUTION

Accepted Solutions
Christophe Arnal
ST Employee

​Hello,

Here is the way I would recommend to go :

1/ Download package v1.5.0.

2/ Start from BLE_p2pRouteur with the Sequencer

3/ Study the difference between BLE_HeartRateFreeRTOS and BLE_HeartRate. This will show you how to switch from the Sequencer to FreeRTOS. The main difference is in the task creation for FreeRTOS as this is done differently in the Sequencer. Otherwise, it is almost a 1 to 1 mapping

4/ Regarding low power mode / tickless, you can just reuse the two files freertos_port.c and stm32_lpm_if.c from BLE_HeartRateFreeRTOS . You may check that the application Thread_SED_Coap_FreeRTOS is using exactly the same files so it clearly does not depend on the application.

Overall, we managed to provide both BLE_HeartRateFreeRTOS and BLE_HeartRate examples with no architecture change so it could help understanding how to switch from the Sequencer to FreeRTOS.

Once everything is working, you may decide to merge BLE Tasks into a single OS Task. The example implements one OS task for one Sequencer task to ease the comparison but when moving to FreeRTOS in an application which may have several tasks aside to BLE, it could make sense to gather all BLE Task into a single OS task.

I would say it is up to the application designer. At the end, whatever is the architecture chosen, it should work. Only the performance might be different.

Regards.

View solution in original post

2 REPLIES 2
Christophe Arnal
ST Employee

​Hello,

Here is the way I would recommend to go :

1/ Download package v1.5.0.

2/ Start from BLE_p2pRouteur with the Sequencer

3/ Study the difference between BLE_HeartRateFreeRTOS and BLE_HeartRate. This will show you how to switch from the Sequencer to FreeRTOS. The main difference is in the task creation for FreeRTOS as this is done differently in the Sequencer. Otherwise, it is almost a 1 to 1 mapping

4/ Regarding low power mode / tickless, you can just reuse the two files freertos_port.c and stm32_lpm_if.c from BLE_HeartRateFreeRTOS . You may check that the application Thread_SED_Coap_FreeRTOS is using exactly the same files so it clearly does not depend on the application.

Overall, we managed to provide both BLE_HeartRateFreeRTOS and BLE_HeartRate examples with no architecture change so it could help understanding how to switch from the Sequencer to FreeRTOS.

Once everything is working, you may decide to merge BLE Tasks into a single OS Task. The example implements one OS task for one Sequencer task to ease the comparison but when moving to FreeRTOS in an application which may have several tasks aside to BLE, it could make sense to gather all BLE Task into a single OS task.

I would say it is up to the application designer. At the end, whatever is the architecture chosen, it should work. Only the performance might be different.

Regards.

Thanks for the great insights, I am sure they will be useful!