2017-01-03 10:53 PM
I'd like to migrate a project from using the internal RC on the STM32F091RC to the 8MHz HSE clock that comes down from the on-board ST-LINKV2's MCO signal. I use STM32CubeMX to generate SystemClock_Config(). On the panel to the left in the Pinout window, I expand RCC and change 'High Speed Clock (HSE)' from 'Disable' to 'BYPASS Clock Source'.
When I do that, everything looks like it's good. The PF0 pin goes green, the Clock Configuration screen lights up the 8MHz Input Frequency at HSE in blue. If I generate a report, the RCC section says 'High Speed Clock (HSE): BYPASS Clock Source', but when I generate the code, I get the exact same SystemClock_Config(void) I got before the change. In fact the freshly generated main.c doesn't change at all as result of the different clock selection in the gui. Any ideas?
#stm32f0 #stm32cubemxSolved! Go to Solution.
2017-01-05 08:51 AM
Hi @
Bath.David
,I check the Clock configuration tab for the two *ioc files and the same Clock settings is usedfor the two projects : HSI48 to
drive the system clock.
:)
so it is expectedthat you have the same generatedSystem Clock Configuration for two test cases.now to use the HSE bypass:
Enable the HSE bypass in Pinout tab(already done)
Then in the Clock configuration tab select HSE as source to drive system clock :
-Nesrine-
Ifmy suggestanswers your question, please mark it as correct.
2017-01-04 04:49 AM
Hi
dbcc
,I'mnot able to reproduce the issue with STM32CUBEMX Version 4.18,so if you are using an old version of MX please try to use the latest(4.18)
Otherwise, could you please share your .ioc file for check?
-Nesrine-
2017-01-04 12:04 PM
Hi Nesrine, thanks for the speedy response. I'm using 4.0 which seems to be the latest. I've created two near identical projects: Test6 and Test7. The only difference is that Test6 uses the internal RC oscillator and Test7 uses the HSE clock and I've attached the relevant ,ioc files plus the reports and main.c (main.c is identical for both projects so I've only attached one of them).
Doing a diff on the two ,ioc files shows a few housekeeping differences to do with project names, but the only relevant difference is Test7.ioc includes this line:
+ PF0-OSC_IN.Mode=HSE-External-Clock-Source
________________ Attachments : Test7.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyyb&d=%2Fa%2F0X0000000bF9%2Fsnj_fXDl_VZNMfo_e9qS8JHtRGVMMBaR5yISeISiv3o&asPdf=falseTest6.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz0R&d=%2Fa%2F0X0000000bFC%2FFFducsYEhqn8sskASScpUaOmcva.V9IeguWbq.K8xDo&asPdf=falseTest6.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz0H&d=%2Fa%2F0X0000000bFB%2FRdqSgOFdnF2j.ZbQw6ndgs3PYWoLSz9PhXsDM7mzBiA&asPdf=falsemain.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz07&d=%2Fa%2F0X0000000bFA%2FHv1_81mtlw1gcIJsrYMuGyaM8KabxsiyNaxwA7925Tw&asPdf=falseTest7.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz0C&d=%2Fa%2F0X0000000bF8%2Fbe5zAmqd1Vl.b2hfX1jSNHrJ_p08n9UQx.w9V9VikDw&asPdf=false2017-01-05 08:51 AM
Hi @
Bath.David
,I check the Clock configuration tab for the two *ioc files and the same Clock settings is usedfor the two projects : HSI48 to
drive the system clock.
:)
so it is expectedthat you have the same generatedSystem Clock Configuration for two test cases.now to use the HSE bypass:
Enable the HSE bypass in Pinout tab(already done)
Then in the Clock configuration tab select HSE as source to drive system clock :
-Nesrine-
Ifmy suggestanswers your question, please mark it as correct.
2017-01-05 04:28 PM
Doh! I completely missed the clock configuration step. Thanks Nesrine for the very speedy turnaround on this. I'm now happily clocking on the 8MHz HSE clock.