2026-04-15 2:48 PM - last edited on 2026-04-22 3:05 AM by KDJEM.1
Hi all,
I am trying to implement simple USB-FS communication on a BlueCoin board (STEVAL-BCNCS01V1). I am following the official STM tutorial on USB CDC and referencing the official SW package for BlueCoin.
So, for USB I need PLL source from HSE clock: BlueCoin schematic shows that there is a crystal oscillator @16Mhz (NDK NX2520SA) installed directly on the board, so I configured RCC HSE as Crystal/Ceramic Resonator; the problem is that the function HAL_RCC_OscConfig(&RCC_OscInitStruct) in SystemClock_Config retrieves HAL_TIMEOUT as a result. Timeout value is default at 100ms.
Clock configuration in STM32CubeMX is as suggested in the official USB tutorial:
My current debug configuration has BlueCoin connected via SWD to a NUCLEO-G0B1RE, as suggested in UM2240 (see page 14).
Could you please help me? Am I missing something? Thanks to anybody who can help!
Solved! Go to Solution.
2026-04-27 2:10 AM
Hello,
@ghibli wrote:
3) If I switch to HSI, this is what I get (I guess USB-FS needs HSE):
Because USB needs HSE with an external crystal to work properly in this product.
Forget about USB for now and deactivate it in CubeMx. Create a very simple project and select HSE with a 16MHz with PLL as clock source. The test is to check whether there is an issue in your hardware.
2026-04-16 4:09 AM
Hello @ghibli and welcome to the ST community,
I don't have idea about that BlueCoin board but referring to its schematic, it has indeed a crystal on it of 16MHz:
But from what you shared in the CubeMx screenshot, it seems you are configuring HSE in Bypass mode:
Only one pin is used in this case while you need OSC_IN and OSC_OUT for a crystal.
So you need to select Crystal/Ceramic Resonator in CubeMx for your case:
Bypass mode is used for example for crystal oscilators (XO) and not for crystals (XTAL).
PS: in your main.c you've attached, HSE is correctly configured! So that doesn't reflect the CubeMX configuration! which induces to some confisions here..
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
Hope that helps.
2026-04-16 4:31 AM
Hi @mƎALLEm, thanks for your feedback and for the welcome!!
The confusion is due to the late hour at which I wrote the post... The screenshot is wrong, please forgive me for that.
Anyway, the correct configuration that you suggested is the one that I definitely tested in main.c file, but still it gets stuck in HAL_RCC_OscConfig for the same reason; the screenshot comes from a previous configuration that I tested (and which did not obviously work...).
Do you know whether I have to set some other configurations in order to have the external oscillator on the board working properly (maybe on ST-Link side)?
Thanks again for your support!
PS: the BlueCoin board is actually a product from ST, more information here. It's a pity that I could not find much documentation or samples about that because it's definitely a very interesting board for prototyping.
2026-04-16 4:40 AM
Hello,
1- You mentioned in a previous post NUCLEO-G0B1RE. So could you please confirm your are debugging on STEVAL-BCNCS01V1 that contains a STM32F446 and not NUCLEO-G0B1RE which contains a STM32G0B1 MCU?
2- Check you have that crystal on your board and that was not unsoldered:
3- Test if you can use HSI as source clock:
This is just for test.
2026-04-16 5:47 AM
Hi @mƎALLEm, thanks for your feedback. I will try out your points and give a feedback as soon as possible.
2026-04-25 12:14 AM
Hi @mƎALLEm, I tested your points. Here are my findings:
1) I confirm, debug is active on STM32F446
2) The oscillator is present on the board
3) If I switch to HSI, this is what I get (I guess USB-FS needs HSE):
Thanks again for your suppport.
2026-04-27 2:10 AM
Hello,
@ghibli wrote:
3) If I switch to HSI, this is what I get (I guess USB-FS needs HSE):
Because USB needs HSE with an external crystal to work properly in this product.
Forget about USB for now and deactivate it in CubeMx. Create a very simple project and select HSE with a 16MHz with PLL as clock source. The test is to check whether there is an issue in your hardware.
2026-04-29 1:59 PM
Hi @mƎALLEm, good suggestion. I set up a simple project which switches LEDs on and off using HSE and a timer and it works fine, so I assume the external oscillator is ok. I attach the project, maybe it can be useful to someone in the community.
Getting back to the original USB project, I will compare the RCC_CR register to the simple project and check if something is wrong with the configuration.
2026-05-26 2:18 PM
Getting back to this old post, @mƎALLEm your suggestion was right. Just tried to use the simple project as a starting base for the USB project and everything was fine. There was definitely an error from my side in the CubeMX HSE configuration in the original project. Thanks again for your support.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.