WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post here first, or if you can't find a relevant section!
Fziegler_076
Posts: 22
Joined: Fri Apr 19, 2024 1:04 am

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by Fziegler_076 »

Hello friends !

Hi fpiSTM and ag123 !!!

Today I checked through ST-LINK
I checked through the hal_conf_extra.h file with the setting #define HSE_VALUE 8000000U


Now the LED is blinking!!!
Fziegler_076
Posts: 22
Joined: Fri Apr 19, 2024 1:04 am

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by Fziegler_076 »

Friends, I checked several times today


1.Everything is stitched and working through ST-LINK!
2.Everything is flashed via USB (DFU), but it doesn't work!



How can I deal with firmware via USB (DFU)?
Do I need to write to the Weact Studio engineers about this problem?
Fziegler_076
Posts: 22
Joined: Fri Apr 19, 2024 1:04 am

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by Fziegler_076 »

Some more of my experiments:
1.I'm flashing it through ST-LINK
2.I select "USB CDC Serial"

the test program

Code: Select all

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  
  delay(1000);                      
  digitalWrite(LED_BUILTIN, LOW);  
  delay(1000);                      
}
Variant №1
I do not make any changes or additions, everything is by default

When connected, the Error - USB device is not connected (the device descriptor request fails) and the LED lights up very slowly - every 3 seconds



Variant №2
Only the hal_conf_extra file is connected.h with the string #define HSE_VALUE 8000000U

When connected, the Error - USB device is not connected (the device descriptor request fails) and the LED lights тnormal - every 1 seconds




Variant №3
I only make changes to the file variant_BLACKPILL_F411CE.cpp
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 192;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;

The COM port appears in the Windows Device Manager and the LED lights up very slowly - every 3 seconds



Variant №4
the hal_conf_extra file is connected.h with the string #define HSE_VALUE 8000000U
and
make changes to the file variant_BLACKPILL_F411CE.cpp
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 192;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;

The COM port appears in the Windows Device Manager and the LED lights normal - every 1 seconds
The exchange with the serial port is normal, data is sent to the serial monitor (Serial.println("Test");)



Is there any way to optimize variant №4?
ag123
Posts: 1678
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by ag123 »

among the things to try, after successfully flashing through st-link, try with DFU again, maybe make some changes so as to tell that that is installed from DFU.
it is quite possible the flash could be write protected. But that with st-link, there is a special means connect under reset which can override the write protection.
ag123
Posts: 1678
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by ag123 »

if you can work with @fpiSTM to do a commit for a new variant for 8 Mhz (by means of a PR pull request)
do help to test that.
the files that are needed to be updated are a copy of that variant file with a new name,
and maybe some other source files (i'm not sure but you'd need to check), e.g. the include header file for the board, I'm not sure if 2 variant cpp files can share the same board include file.
then look in boards.txt to copy and update relevant entries for the variant
and i'm not sure if platform.txt needs any updates, normally that can be left alone without changes
Fziegler_076
Posts: 22
Joined: Fri Apr 19, 2024 1:04 am

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by Fziegler_076 »

among the things to try, after successfully flashing through st-link, try with DFU again, maybe make some changes so as to tell that that is installed from DFU.
it is quite possible the flash could be write protected. But that with st-link, there is a special means connect under reset which can override the write protection.
Yes, I'll check it out tomorrow morning.


Of course, I'm ready to do everything.
(by means of a PR pull request)
What is it? How do I do this?
ag123
Posts: 1678
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by ag123 »

Fziegler_076 wrote: Mon Apr 22, 2024 7:55 am
among the things to try, after successfully flashing through st-link, try with DFU again, maybe make some changes so as to tell that that is installed from DFU.
it is quite possible the flash could be write protected. But that with st-link, there is a special means connect under reset which can override the write protection.
Yes, I'll check it out tomorrow morning.


Of course, I'm ready to do everything.
(by means of a PR pull request)
What is it? How do I do this?
to make a PR, first first click [fork] to make a copy of stm32duino repository
https://github.com/stm32duino/Arduino_Core_STM32

then do a git clone from your fork (copy) of the repository
https://gitforwindows.org/

then locally on your PC:
on your pc you can then edit codes and test locally, it may take copying files to/from the local git folder if your ide (e.g. arduino folders) if it don't directly support that.

next few items need to be done from your local git folder:
to see the list of changed files do a 'git status', to add the files type 'git add *'

when done, then do a 'git commit', type in your git comment e.g. 'new variant stm32f411ce 8mhz ... etc'
and 'git push' to get the changes into your repository in github

then back to github:
then you can follow the instructions on github e.g. click compare and pull request
https://docs.github.com/en/pull-request ... rom-a-fork

the steps from the edits, followed by 'git status', 'git add *', 'git commit', 'git push' can be iterative e.g. you can make the changes several time repeating these steps.

and that should generate a pull request
User avatar
fpiSTM
Posts: 1760
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by fpiSTM »

I would recommend to simply declare the new boards entry and add it to the existing variant for the blackPill F411CE.
Like it is done for the *PillF103:
https://github.com/stm32duino/Arduino_C ... pp#L13-L14

Example add it with name:

Code: Select all

 BLACKPILL_F411CE_8MHZ
Then simply duplicate entry in boards.txt with the new name, reference it in the README.md.
Finally add the new define in the cpp: variant_BLACKPILL_F411CE.cpp:

Code: Select all

#if defined(ARDUINO_BLACKPILL_F411CE) || defined(ARDUINO_BLACKPILL_F411CE_8MHZ)
And add the new config SystemClock_Config under swith:

Code: Select all

#if defined(ARDUINO_BLACKPILL_F411CE_8MHZ)
// new config
#else
// standard
#endif
Finally in the variant_BLACKPILL_F411CE, defined the correct HSE_VALUE thanks the define

Code: Select all

#ifndef HSE_VALUE
#if defined(ARDUINO_BLACKPILL_F411CE_8MHZ)
  #define HSE_VALUE             8000000U
#else
  #define HSE_VALUE             25000000U
#endif
#endif
Fziegler_076
Posts: 22
Joined: Fri Apr 19, 2024 1:04 am

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by Fziegler_076 »

Hi !

Code: Select all

among the things to try, after successfully flashing through st-link, try with DFU again, maybe make some changes so as to tell that that is installed from DFU.
it is quite possible the flash could be write protected. But that with st-link, there is a special means connect under reset which can override the write protection.
I checked it out.
The firmware is being flashed, but unfortunately it does not work (
The program works only with firmware via ST-LINK.



Dear @fpiSTM!
I kind of did as you wrote to me, but my lack of experience didn't give me any results.
In the menu in the Arduino IDE, the choice of a board with 8 MHz HSE does not appear.
Can you, as a professional, look at and correct my mistakes?
I'm attaching what I changed in the files
Attachments
Blackpill_F411CE_8.zip
(70.31 KiB) Downloaded 8 times
User avatar
fpiSTM
Posts: 1760
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by fpiSTM »

Arduino IDE 2 have/had issue with menu update. On older version of the IDE (prio 2.3.x), the menu is not refresh at startup.
This could explain your issue.
Post Reply

Return to “General discussion”