cancel
Showing results for 
Search instead for 
Did you mean: 

Does "BLE_MeshLightingPRFNode" sample use RTOS? How is the clock configuration?

Cooper_WJH
Associate II

I want to add a new timmer application in the "BLE_MeshLightingPRFNode", so I need to know which timmer is available.

Because the RTOS needs a reference timer, but I don't see the RTOS initialize and activate sequence in this sample code. Is RTOS not used in this example?

And how is the "Clock configuration" in "BLE_MeshLightingPRFNode" example? Does have the cubeMX-like clock configuration diagram?

5 REPLIES 5
STTwo-32
ST Employee

Hello @Cooper_WJH 

In fact, this example and almost all our BLE example for the STM32WB are using a SW implementation called sequencer to make it easy to execute the different tasks of the Code.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @STTwo-32 

So, Which timer is the sequencer used? Which timer is available for the user to use?

How is the clock configured?

I think need to know the clock configuration, so that I can let the timer work as I expected.

For such a purpose, I suggest you take a look at the AN5289 specially the Timer Server parts.

PS: the timer Server provide virtual timers running on RTC (in Stop and Standby modes) to the application.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I studied the Timer server part, and as I understand it works like the freeRTOS software timmer, and the resolution is about 2.04/ms. The  CFG_TS_TICK_VAL is about 488.78.

#define CFG_TS_TICK_VAL           DIVR( (CFG_RTCCLK_DIV * 1000000), LSE_VALUE )
#define APPLI_MESH_TIMER_INTERVAL       1*(1000/CFG_TS_TICK_VAL)  /* 1 ms */

 But I need a more precise timer, so I may have to use the HW timer. If so, I think I still have to know the clock configuration and which HW timer is available to use.

Could you help me set up the HW timer?

I suggest you refer to one of the Timers configurations on the following examples. For the Clock config of the BLE_MeshLightingPRFNode, you have to refer to the line 161 of the main.c file.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.