STM32F401CCU6 LQFP100 (!) development board

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
ag123
Posts: 243
Joined: Thu Mar 07, 2019 6:15 am
OS: linux
IDE: eclipse, arduino 1.8.5
Core: Roger's
Board: Maple mini, Bluepill

Re: STM32F401CCU6 LQFP100 (!) development board

Post by ag123 » Sun Jan 19, 2020 3:03 pm

oops misposted
reposted in the official stm32duino forum as well
https://www.stm32duino.com/viewtopic.ph ... p=714#p714
------------

hi steve,

i think we need to rework the clock setting f4 code.
blackpill f411 runs on a 25mhz crystal
while
disco f411 runs on a 8mhz crystal
https://github.com/stevstrong/Arduino_S ... f411.h#L41

my thoughts are either to do like the official core
the system clock config is defined in the variant itself
https://github.com/stm32duino/Arduino_C ... t.cpp#L106

or we can do something similar to libopencm3
we can have the variant maintain a structure containing some clock setups
https://github.com/libopencm3/libopencm ... /rcc.c#L52

Code: Select all

	{ /* 84MHz */
		.pllm = 16,
		.plln = 336,
		.pllp = 4,
		.pllq = 7,
	...
and a call back function needs to be defined in the variant to return the structure, it can even be a static structure or class that needs to be defined in the variant, initialized at reset so that the rcc_init_clocks() would look for those values in that structure.
but i just thought that this approach may lead to ifdefs, while the variant call back can be a fixed function to return a fixed structure

Post Reply