WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

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

WeAct Studio STM32F411CEU6 BlackPill v3.1 crystal is 8 MHz

Post by Fziegler_076 »

Hello friends!

I bought a new version of the Black Pill v3.1 board (WeAct Studio) with HSE 8 MHz.

The standard version of the board is available with HSE 25 MHz, and this board (easier to enter dfu mode by usb)
was made with HSE 8 MHz and it does not work.

Please tell me in detail what and where to fix so that the board works in Arduino.
I am a novice specialist and I really need to launch this board.

I will be very grateful for your help.
User avatar
fpiSTM
Posts: 1751
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 »

Simply redefine HSE_VALUE using hal_conf_extra.h.
See the wiki.
Fziegler_076
Posts: 4
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

fpiSTM wrote: Sat Apr 20, 2024 7:02 am Simply redefine HSE_VALUE using hal_conf_extra.h.
Hi fpiSTM !

There is no such file. I need to create it myself in the catalog C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.7.1\variants\STM32F4xx\F411C(C-E)(U-Y)?

Or does it need to be created in another directory? I looked at the Wiki, but did not understand what needs to be entered there.
Only one line #define HSE_VALUE 800000000U or something else needs to be added to this file?
Could you help me write the contents of this file?
User avatar
fpiSTM
Posts: 1751
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 »

https://github.com/stm32duino/Arduino_C ... adaptation

https://github.com/stm32duino/Arduino_C ... efinitions

So simply create the file with at sketch level :
#define HSE_VALUE 800000000U
Fziegler_076
Posts: 4
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

I created the hal_conf_extra.h file with a single line #define HSE_VALUE 800000000U and put it in the folder with the sketch, next to the blink.ino files.
The program is loaded into the microcontroller, but the LED does not blink.
I use the standard Blink program from the examples

Code: Select all

// the setup function runs once when you press reset or power the board
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(LED_BUILTIN, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}
Why doesn't it work?
What could be the problem?
I checked on 3 boards.
User avatar
fpiSTM
Posts: 1751
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 »

Is the LED_BUILTIN correct for this new board?
User avatar
fpiSTM
Posts: 1751
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 »

Pay attention it seems you set 80MHz and not 8MHz
Fziegler_076
Posts: 4
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

1. I fixed it to #define HSE_VALUE 8000000U


2. I wrote the LED pin myself (PC13)

Code: Select all

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(PC13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(PC13, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);                      // wait for a second
  digitalWrite(PC13, LOW);   // turn the LED off by making the voltage LOW
  delay(1000);                      // wait for a second
}
https://aliexpress.com/item/1005001456186625.html 8 MHz XTAL version

https://github.com/WeActStudio/WeActStu ... iSTM32F4x1

It doesn't work anyway (

What else can I check?

I have attached my project
Attachments
Blink.zip
(674 Bytes) Downloaded 1 time
User avatar
fpiSTM
Posts: 1751
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 »

You should redefine the system core clock config to properly configure the pll vs the HSE value.
Post Reply

Return to “General discussion”