-
As a preamble, I do this successfully on the L432. I setup the G473 with 8MHz oscillator on PF0 . My code is setup the G473 to use HSE and run the system clock at 150Mhz. I have done similar code in stm32CubeIDE (I have included) which works as expected. Have I missed something? meClock_G473.h
Blink_473.ino
stm32CudeIDE code
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Which G473? RE?... |
Beta Was this translation helpful? Give feedback.
-
the Arduino was a fresh install about a week ago. |
Beta Was this translation helpful? Give feedback.
-
to help debugging I setup the serial port using bare metal below.
works correctly. (proving system clock) The error is that SystemCoreClock = 450Mhz and I don't know how it got that number. I have now added Serial Setup
|
Beta Was this translation helpful? Give feedback.
-
looking at SystemCoreClockUpdate(), I now print all the variables used in this routine and I can't see how SystemCoreClock comes to equal 450Mhz. My code and output below. new Main Loop
and the results
|
Beta Was this translation helpful? Give feedback.
-
SystemCoreClock is updated by HAL when it configures the clock. As stated here: So, in our case, it is when Anyway I think I've found the issue. By default HSE_VALUE for STM32G4xx is 25MHz but in your case you used a 8MHz so you have to redefine it. You can use That should explain why you get 3x. https://github.com/stm32duino/wiki/wiki/Customize-build-options-using-build_opt.h |
Beta Was this translation helpful? Give feedback.
SystemCoreClock is updated by HAL when it configures the clock.
As stated here:
Arduino_Core_STM32/system/Drivers/CMSIS/Device/ST/STM32G4xx/Include/system_stm32g4xx.h
Lines 49 to 57 in 72524db