Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for BlackPill F411CE #890

Closed
wants to merge 4 commits into from
Closed

Conversation

TzOk83
Copy link

@TzOk83 TzOk83 commented Jan 24, 2020

Added support for WeAct V2.0 STM32F411CEU6 dev. board a.k.a. BlackPill F411CE.

Added support for WeAct V2.0 STM32F411CEU6 dev. board a.k.a. BlackPill F411CE.
...AStyle again :/
Copy link
Contributor

@ag88 ag88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the pll parameters m, n, p, q

RCC_OscInitStruct.PLL.PLLM = 12;
RCC_OscInitStruct.PLL.PLLN = 96;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;

then using my python script
https://www.stm32duino.com/viewtopic.php?f=41&t=78

FHSE: 25 m: 25 n: 192 p: 2 (RCC_PLLP_DIV2) q: 4 fusb: 48.0 fcpu: 96.0
FHSE: 25 m: 25 n: 384 p: 4 (RCC_PLLP_DIV4) q: 8 fusb: 48.0 fcpu: 96.0
FHSE: 25 m: 25 n: 432 p: 4 (RCC_PLLP_DIV4) q: 9 fusb: 48.0 fcpu: 108.0
FHSE: 25 m: 50 n: 384 p: 2 (RCC_PLLP_DIV2) q: 4 fusb: 48.0 fcpu: 96.0

FHSE didn't seem to fall in line with a 25mhz crystal
https://www.stm32duino.com/viewtopic.php?p=938#p938
https://www.stm32duino.com/viewtopic.php?p=950#p950
currently the f411 pill boards are apparently shipped with a 25mhz crystal
https://www.aliexpress.com/item/4000103610226.html

@TzOk83
Copy link
Author

TzOk83 commented Jan 26, 2020

I have used CubeMX to generate these clock dividers, checked on real board with 25MHz oscillator, and confirmed that I2C and USB work.

Target FCPU for that board is 100 MHz, not 96 MHz like in STM32F401CCU6 variant.

BlackPill_CLK

@ag88
Copy link
Contributor

ag88 commented Jan 26, 2020

well, i work the numbers based on your pll dividers:
25 / 12 * 96 / 2 ~ 100 Mhz - fcpu
then for usb
25 / 12 * 96 / 4 ~ 50 Mhz
usb will fail to work as usb specifically requires 48 Mhz
it is a reason i've used

FHSE: 25 m: 25 n: 192 p: 2 (RCC_PLLP_DIV2) q: 4 fusb: 48.0 fcpu: 96.0

which would hit the 48mhz required to keep usb working
and provides a fcpu clock of 96 mhz (a little less than 100mhz)
usb is quite important as it is used for usb-serial and commonly used for Serial.print() and Serial.read() to interact with the host

Change PLL dividers to meet 48 MHz USB clock.
@TzOk83
Copy link
Author

TzOk83 commented Jan 29, 2020

You're right I wasn't aware of this. Yet USB was working fine with 50 MHz clock, at least for a short while, as I didn't do any long term tests. I have changed the clock according to your suggestions.

@ag88
Copy link
Contributor

ag88 commented Jan 29, 2020

thanks! i think users would appreciate it as i think even at 50 mhz, usb 'may' work.
the trouble would be that 2 mhz difference would cause sampling to drift. usb is 48 mhz 4x oversampled, so the actual signal is 12 mhz. this (50mhz) would seem to work initially even with the drift as they are pretty close. however, as time goes on, erratic results will follow as the 50 mhz intervals will keep drifting and finally interpret the signals incorrectly

@fpistm
Copy link
Member

fpistm commented Jan 30, 2020

@TzOk83, @ag88,

@Jozo132 made also a PR (#818) to add this support.
I will review them but I'm waiting the system clock config update of the Generic F411Cx.
Then this board should use the generic variant to add its support.

@fpistm
Copy link
Member

fpistm commented Feb 3, 2020

This one is replaced by #909

@fpistm fpistm closed this Feb 3, 2020
STM32 core based on ST HAL automation moved this from In progress to Done Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants