2025-10-06 5:45 AM
I am trying to set up a basic USB project on a NUCLEO-H7S3L8. It works okay with the HSI, but I need the HSE. I can see that the board has a 24MHz crystal fitted and resistors on SB14 and SB15. It's unmodified from the factory.
HAL_RCC_OscConfig() always returns with a timeout when trying to activate the HSE. I've tried various settings but can't get it to work.
I have attached my .ico file. The code is just what CubeMX generates. Thanks.
Solved! Go to Solution.
2025-10-17 1:11 AM
So here ioc , only using internal flash.
2025-10-06 6:19 AM
Did you set it like this ?
+ in clock tree set the 24M
It should work then. (My H7S3 does.)
2025-10-06 6:30 AM
Looks like it is set correctly.
2025-10-06 6:53 AM
Did you set it like this ?
... and USB:
2025-10-06 7:26 AM
2025-10-06 12:00 PM
So to check, the HSE crystal is ok , running, do a simple test:
make new -> stm32 project -> select just the H7S3L8H cpu -> give it a name, finish.
Then
- set only for "boot" , so its all in flash
- set RCC HSE , LDO, scale0
- set HSE 24M , clock tree to 600M core, etc.
- set debug trace async
- cortexM7 all caches on
(if you like, set port pin toggle an onboard led)
- generate code
- compile + debug
-- it should run (mine does).
2025-10-07 2:30 AM
Hello,
I tested your ioc file and generated a project and it's working fine from my side on a NUCLEO-H7S3L8.
May be you need to check OSC_OUT pin with an oscilloscope:
I suspect an issue in your board.
Do you have another board that you can run the test with?
2025-10-07 5:28 AM
AScha.3 that works for me too. mƎALLEm I can see a 24MHz sine wave on that pin.
I have made some progress though. I found that certain settings that CubeMX says are okay don't actually seem to work. I initially had the HSE divided by 12 into the PLLs. Changing it to divided by 2 (and adjusting the multiplier to give 600MHz) allows it to get past setting the system clock.
It's odd that the timeout is with setting up the HSE rather than the PLL, and odd that it works for other people. I will continue to investigate.
2025-10-08 4:43 AM
I think this is that old issue with CubeMX where sometimes it just doesn't build working code, but if you change things enough eventually whatever needs to be fixed gets fixed and the code is okay. Copying the .ico file to a new project works for me too.
I am not able to use USB CDC to work, but it's probably the same sort of bug.
2025-10-08 4:49 AM
@qua wrote:
Copying the .ico file to a new project works for me too.
Is there any specific difference in the path?
Did you detect any difference in the generated code between both cases?