2024-07-15 08:01 PM - last edited on 2024-07-16 02:47 AM by Andrew Neil
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?
2024-07-16 01:43 AM
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.
2024-07-16 02:41 AM
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.
2024-07-16 03:35 AM
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.
2024-07-16 07:06 PM
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?
2024-07-24 06:11 AM
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.