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: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

Friends, thanks for the tips!

So, I bought 10 8 MHz HSE boards.
All the boards are stitched by the manufacturer with a demo program with a flashing LED, and they all flash the LED when connected, which means that all the boards are working!

1. All boards with a frequency of 8 MHz - I took a photo and will attach it soon.

2. The boards switch to DFU mode by pressing the buttons, as you wrote

Code: Select all

                       STM32CubeProgrammer v2.16.0                  
      -------------------------------------------------------------------



USB speed   : Full Speed (12MBit/s)
Manuf. ID   : STMicroelectronics
Product ID  : STM32  BOOTLOADER
SN          : 389E33553233
DFU protocol: 1.1
Board       : --
Device ID   : 0x0431
Device name : STM32F411xC/E
Flash size  : 512 KBytes (default)
Device type : MCU
Revision ID : --  
Device CPU  : Cortex-M4


Memory Programming ...
Opening and parsing file: Blink.ino.bin
  File          : Blink.ino.bin
  Size          : 23.57 KB 
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
sector 0000 does not exist
sector 0001 does not exist
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:00.493

RUNNING Program ... 
  Address:      : 0x8000000
Start operation achieved successfully
3. I select "USB CDC Serial", but after flashing the program into the microcontroller, the COM port is not displayed on PC devices (I checked in Windows Device Manager)- so the microcontroller does not start!
4. I have corrected the file C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\variants\STM32F4xx\F411C(C-E)(U-Y)\variant_BLACKPILL_F411CE.cpp

Code: Select all

  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  RCC_OscInitStruct.PLL.PLLM = 8;
  RCC_OscInitStruct.PLL.PLLN = 48;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
  RCC_OscInitStruct.PLL.PLLQ = 8;
Attachments
3.jpg
3.jpg (78.5 KiB) Viewed 957 times
2.jpg
2.jpg (57.52 KiB) Viewed 957 times
01.jpg
01.jpg (75.18 KiB) Viewed 957 times
Fziegler_076
Posts: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

Added a corrected file C:\Users\Admin\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.4.0\variants\STM32F4xx\F411C(C-E)(U-Y)\variant_BLACKPILL_F411CE.cpp

I tried your advice, but the boards still don't work after the firmware.
Now I will try to flash through the stm32cube programmer
Attachments
4.jpg
4.jpg (53.38 KiB) Viewed 926 times
variant_BLACKPILL_F411CE.zip
(1.33 KiB) Downloaded 3 times
Fziegler_076
Posts: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

1. Updated STM32 Library to version 2.7.1
2. Performed the download via the stm32 cube programmer DFU
Attachments
002.jpg
002.jpg (94.55 KiB) Viewed 915 times
001.jpg
001.jpg (95.88 KiB) Viewed 915 times
Last edited by Fziegler_076 on Sun Apr 21, 2024 2:03 am, edited 1 time in total.
ag123
Posts: 1668
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:

Code: Select all

  RCC_OscInitStruct.PLL.PLLM = 8;
  RCC_OscInitStruct.PLL.PLLN = 48;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
  RCC_OscInitStruct.PLL.PLLQ = 8;
^ this won't work, try

Code: Select all

  RCC_OscInitStruct.PLL.PLLM = 8;
  RCC_OscInitStruct.PLL.PLLN = 192;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 4;
fcpu is HSE 8 Mhz / M * N / P = 8 / 8 * 192 / 2 = 96 Mhz
and usb bus speeds is HSE 8 Mhz / M * N / Q = 8 / 8 * 192 / 4 = 48 Mhz
Fziegler_076
Posts: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

Code: Select all

  RCC_OscInitStruct.PLL.PLLM = 8;
  RCC_OscInitStruct.PLL.PLLN = 192;
  RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
  RCC_OscInitStruct.PLL.PLLQ = 4;
Unfortunately, this does not work either (
Attachments
variant_BLACKPILL_F411CE.zip
(1.33 KiB) Downloaded 4 times
ag123
Posts: 1668
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

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

Post by ag123 »

The values given and used are correct, yup check the LED, try to use a led connected to a different pin manually e.g. on the headers.
I've more than once used boards with a 'defective' LED, sometimes they put the LED reversed, that'd never light up.
manufacturing error. no need to look at schematic. if we assume that PC13 is correct.

the other way is to measure pins with a volt meter.
Last edited by ag123 on Sun Apr 21, 2024 2:27 am, edited 5 times in total.
Fziegler_076
Posts: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

The documentation for the board version 3.1 indicates that the LED is connected to the PC 13. I indicated it correctly in the program

C:/Users/Admin/Downloads/WeActStudio.MiniSTM32F4x1-master/WeActStudio.MiniSTM32F4x1-master/HDK/MiniF4x1Cx_V31.pdf
Attachments
9.jpg
9.jpg (12.7 KiB) Viewed 882 times
Fziegler_076
Posts: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

I have tested this on 3 boards.
I think that the microcontroller freezes, because after the firmware, the COM port does not appear in the computer devices, although I turn on the "USB CDC Serial" setting
ag123
Posts: 1668
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 really want to get to the bottom of that, the only way seemed to be to use a st-link v2
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
https://octopart.com/search?q=st-link+v ... SD&specs=0
then you can try to debug that, but that would require setting up your IDE to work properly so that it actually trace the codes

for those PLL M,N,P.Q settings USB should work, so the virtual com port should appear.
but that is beyond basic test.
At a very least, if you turn on a led it should light up.
In fact, according to the schematic, just

Code: Select all

pinMode(PC13, OUTPUT);
would light up the led, if the led is working correctly.

otherwise to check, use a led to check manually on the header pins or use a voltmeter (e.g. multi-meter) to measure that.
a HIGH level on a pin is close to VDD 3.3v

in fact for the led test, if you think that the crystal has a problem you can even try

Code: Select all

void SystemClock_Config() {

return; // <- return on entry, so no clock setting is done

....
}
this will run on HSI (internal oscillator) 16 Mhz (no usb), select uart for serial so that it won't hang on the usb. but the led should still light up if

Code: Select all

void setup() {
	pintMode(PC13, OUTPUT);
}
is run.

the stm32cube programmer log messages seem to indicate that the sketch firmware is installed correctly.
I'm not sure if that 'sector 0 does not exist' message meant any errors.
Last edited by ag123 on Sun Apr 21, 2024 2:49 am, edited 6 times in total.
Fziegler_076
Posts: 21
Joined: Fri Apr 19, 2024 1:04 am

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

Post by Fziegler_076 »

Thanks for the tips!

Now I will solder the connector to the board and try to flash it through ST-LINK.
Attachments
IMG_20240421_093235.jpg
IMG_20240421_093235.jpg (80.23 KiB) Viewed 855 times
Post Reply

Return to “General discussion”