{RESOLVED] STM32F0, why my PLL makes trouble?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-04 3:39 PM
STM32F070RB stepping Y, with a 24MHz crystal as HSE. No LSE.
In the Cube, enabled PLL sourced from the HSE; SYSCLK goes to 48 MHz.
Then, as soon as I run thru HAL_RCC_OscConfig, debugger loses connection and I don't know what the chip does.
So I've switched the sysclk mux to HSE without PLL (24 Mhz), and then whole SystemClock_Config() passes well and everything looks good.
So I thought, 48 MHz is too much for this board. Enabled PLL again, with pre-div 1/2, to get the same 24 MHz. It fails again.
What can be the problem with the PLL? The board runs well at 24 MHz from the HSE, so the oscillator is good?
Solved! Go to Solution.
- Labels:
-
STM32F0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-05 9:26 AM
Maybe the 24 MHz oscillator is not reliable, and F070 it quite dumb here - it (officially) has no clock monitor. Personally, I would recommend to use 8 or 12 MHz crystal with F0; this would work even with incorrectly matched capacitors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-04 11:46 PM
i would try : setting the pll in to 8 MHz (i have it here on F072 ), no problem on > 100 boards.
+ your VDDA is clean , with caps close to chip?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-05 2:19 AM
Before you set HCLK above 24 MHz, you must set Flash wait states to 1 in FLASH->ACR register. Enabling the prefetch buffer is also recommended.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-05 6:36 AM
@gbm then how you explain that it fails with PLL at 24 mhz but runs fine on 24 mhz HSE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-05 9:26 AM
Maybe the 24 MHz oscillator is not reliable, and F070 it quite dumb here - it (officially) has no clock monitor. Personally, I would recommend to use 8 or 12 MHz crystal with F0; this would work even with incorrectly matched capacitors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-05 9:45 AM
Single-step inside HAL_RCC_OscConfig() in disasm. Observe, which register is written by what value, and at which register write does the failure occur.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-02-05 4:51 PM
Thank you for all replies, guys. Replaced the board, the PLL problem went away.
It seems to be a bad board or maybe connectors, cables etc.
