cancel
Showing results for 
Search instead for 
Did you mean: 

Selecting 8MHz clock on Nucleo-64 in STM32CubeMX

David Bathurst
Associate III
Posted on January 04, 2017 at 07:53

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 #stm32cubemx
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on January 05, 2017 at 16:51

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.

0690X000006060GQAQ.png

:)

so it is expectedthat you have the same generatedSystem Clock Configuration for two test cases.

now to use the HSE bypass:

  1. Enable the HSE bypass in Pinout tab(already done)

  2. Then in the Clock configuration tab select HSE as source to drive system clock :

-Nesrine-

Ifmy suggestanswers your question, please mark it as correct.

View solution in original post

4 REPLIES 4
Nesrine M_O
Lead II
Posted on January 04, 2017 at 13:49

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-

David Bathurst
Associate III
Posted on January 04, 2017 at 21:04

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=false

Test6.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz0R&d=%2Fa%2F0X0000000bFC%2FFFducsYEhqn8sskASScpUaOmcva.V9IeguWbq.K8xDo&asPdf=false

Test6.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz0H&d=%2Fa%2F0X0000000bFB%2FRdqSgOFdnF2j.ZbQw6ndgs3PYWoLSz9PhXsDM7mzBiA&asPdf=false

main.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz07&d=%2Fa%2F0X0000000bFA%2FHv1_81mtlw1gcIJsrYMuGyaM8KabxsiyNaxwA7925Tw&asPdf=false

Test7.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hz0C&d=%2Fa%2F0X0000000bF8%2Fbe5zAmqd1Vl.b2hfX1jSNHrJ_p08n9UQx.w9V9VikDw&asPdf=false
Posted on January 05, 2017 at 16:51

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.

0690X000006060GQAQ.png

:)

so it is expectedthat you have the same generatedSystem Clock Configuration for two test cases.

now to use the HSE bypass:

  1. Enable the HSE bypass in Pinout tab(already done)

  2. Then in the Clock configuration tab select HSE as source to drive system clock :

-Nesrine-

Ifmy suggestanswers your question, please mark it as correct.

David Bathurst
Associate III
Posted on January 06, 2017 at 01:28

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.