Do I *need* an external clock with an STM32F7? Need help with the data sheet :/ - Page 1
Forum section: electronics / general

author: ivyandnine
author_rank: Newbie
timestamp: February 17, 2019, 10:20:29 pm
content: I started laying out an STM32F7 based on this document:https://www.st.com/content/ccc/resource/technical/document/application_note/b0/5c/ba/b2/cb/10/41/dd/DM00164549.pdf/files/DM00164549.pdf/jcr:content/translations/en.DM00164549.pdfbut I'm unsure if the internal oscillator can be used by itself without any external components (Is that the HSI?).Also, another question, is "SYSCLK" == main cpu clock?Thanks for any help <3

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 17, 2019, 11:45:57 pm
content: The STM32F7 (as most of STM32 MCUs) has two internal oscillators: LSI and HSI (low- and high-speed obviously). Both can be used without the need of any external component. The STM32F7 will start with the HSI as the source of SYSCLK upon reset (you then have to switch the clock programmatically if you want to use another source such as HSE).(Note that if you're designing some kind of development board, I'm suggesting adding provisions to add an external crystal/give access to the HSE in case you want to use it later on. But the MCU can run without it.)SYSCLK is not the CPU clock, but more like the clock most other clocks are derived from (although the clocking scheme of STM32s is a bit more complex than that with the PLLs and such...)The CPU clock is called HCLK if I'm not mistaken.You should read the reference manual as it's a lot more detailed than the datasheet which is just an overview:https://www.st.com/resource/en/reference_manual/dm00305990.pdfYou may also find more general info on the Cortex-M7 here:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.cortexm.m7/index.html

author: krho
author_rank: Regular Contributor
timestamp: February 18, 2019, 05:52:58 am
content: I don't know if this is true for all stm32s but some of them need external clock if you want to use USB. See the manual of your chip if it says crystalles USB.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: February 18, 2019, 06:54:00 am
content: I have found that the Stm32CubeMX configuration tool gives a nice graphical overview of how the clock details work.I found that very instructive for learning the STM32 clock details.I would suggest you download it and familiarize yourself with the program.Even if you do not use it for generating code, it does show you the inter-relation between the different peripherals.Fellow beginner.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 18, 2019, 03:16:02 pm
content: Quote from: krho on February 18, 2019, 05:52:58 amThat's probably true for most of them. The internal oscillator is probably not accurate enough to be used as a clock source for USB cores.

author: dgtl
author_rank: Regular Contributor
timestamp: February 18, 2019, 03:34:45 pm
content: There are some, that sync their internal clock from USB and can do usb without crystal(ie F042 comes to mind first). But if it is not mentioned, they need crystal for USB (and other timing-critical comm stuff).I would also recommend trying out the stm32cubemx tool. Use that to configure the clocking system graphically and see if it can be set up to do what you want.

author: bson
author_rank: Unknown
timestamp: February 18, 2019, 08:21:35 pm
content: Which specific F7?The reference manual mentioned in your linked AN:https://www.st.com/resource/en/reference_manual/dm00124865.pdfSection 5.2.2:QuoteSo, yeah, I'd assume as much but would verify it by checking the device-specific datasheet...

author: mark03
author_rank: Frequent Contributor
timestamp: February 18, 2019, 09:03:10 pm
content: I agree with the suggestion to check out the CubeMX software for clocking and pin planning. However, speaking as someone who rarely uses that, there is another resource you should know about. Every STM32 datasheet contains a full-page diagram called "Clock Tree." This shows you everything you need to know, on one page. When you're first getting started, the minutiae may seem overwhelming, but study it carefully and you can see, for example, the relation between SYSCLK and HCLK (HCLK is a prescaled---divided down---version of SYSCLK which runs the MCU core). You can also see the multiplexer that produces SYSCLK, which will show you what the SYSCLK options are: HSE, HSI, a PLL output, etc.