cancel
Showing results for 
Search instead for 
Did you mean: 

Does sequencer and timer server togather effect USB operation? Also I am unable to set the timer server TIMEOUT value to repeat the task continuously.

GBehe
Associate III

I have a custom board having STm32WBCE on it. I have tried to call a function in stead of using in while (1)(Which I used to call in it and was working fine), implemented using sequencer + timer server in a repeated fashion which I create and start in "APP_BLE_Init()" function. I have created a task for my function to run repeatedly. To debug, I am using USB TX to print anything on the terminal software. I am able to send data on BLE and also able to receive. But after it receives data, the device stops printing my messages.

What could be the reason?

Also, how can I know how much time my function takes to complete once? -->( To set the TIMEOUT value for timer server repeating task)

Currently I have set a random timeout and it is working fine. But I don't know whether due to this, the code is running fine or not.

Thank you.

1 REPLY 1
Christophe Arnal
ST Employee

Hello,

The sequencer and/or the timerserver has nothing to do with USB operation.

However, there are two things that may happen :

1/ The CM0+ switches OFF the HSI48 oscillator when it enters low power mode so this will switch OFF your USB as I believe your are using HSI48 as USB source clock. To prevent this, you need to take semaphore 5 and keep it as long as you need USB. This iw what is done in all dongle project in SystemClock_Config() from main.c

2/ When there is nothing to be executed on CM4, the sequencer calls UTIL_SEQ_Idle(). By default in our application, UTIL_SEQ_Idle() calls UTIL_LPM_EnterLowPower() to enter stop mode. In that case, if stop mode is entered, this will switch OFF as well the HSI48 oscillator. So, you need to prevent Stop Mode to be entered when USB is used. The best way is to go with the low power manager. You may create a USB user to the low power manager and when needed, you may instruct the low pomer manager when the USB user allow/disallow Stop Mode.

I am not sure I properly understood your next question but I would suggest to refer to the HeartRate project where we are using the timer server to trigger in a repeated way a background task to send Heart Rate measurement to the CPU2. It looks like this is similar to what you need to do.

Regards.