It should recognize it, if it's not recognizing any USB connected then check your USB cable or try a different one. Otherwise try a different computer maybe?
So grateful for this video. Without your explanations I would never have gotten to troubleshooting and discovering my USB C cables were not data cables.
Caleb Marting: I posted over on the STM32F10x instructions looking for how to with the F4. Found this video...Thanks all is working...Keep up the nice video's....
Thanks for the video. This was exactly what the seller should have supplied. I was struggling with getting anything done on this board based on the information I was able to find elsewhere.
Thanks a lot Caleb. Working in first attempt with STM32Duino 1.9.0 Version on Arduino IDE 1.8.13. with a 3 button F401CC Board. A little beast. About 140 times faster than Arduino NANO calculating 12!
Thank you for this video. I have the new 3.0 board and your procedure worked for me with the following additions.. I had to use a hairdryer to heat up the board. I saw somewhere that the oscillator does not work correctly at cooler temps. Also the timing of pushing the BOOT0 and NRST buttons is ridiculously picky. I pretty much push and release them simultaneously while trying to get the correct order; this usually takes 5 to 15 attempts!
If you hold boot0 when you press and release rst, then release boot0 it doesn't work? You might have just gotten that timing by chance when you take like 15 times
Hi, I love your content very much. I'm using the black pill f411, but I followed your steps but as for now it only show STM32 BOOTLOADER at the device manager but there's no COM Port visible. I tested my wire cable, it supported the data link, I used it for transferring picture from phone to pc and its work. please do help me I'm stuck. thanks in advance sir
You have to create a virtual port since you don't have a “physical” one, in the libraries of the arduino IDE I didn't find how to solve it, but in platformIO in VScode, in the configurations mentioned in the video you just add these two lines: build_flags = -DUSBCON -DUSBD_USE_CDC monitor_speed = 115200 With that you can use it if you want to make it arduino based, the alternative solution is to use the stm32cubeIDE which is the original alternative.
Note: I found that the version of Arduino IDE I use, 1.8.12 has the value for LED_BUILTIN is correctly set based on the board you are using (PC13, in this case, and in the case of BluePill boards)
The STM32 Arduino core is what would change it. I've mostly had them work in the past but sometimes it just doesn't want to compile or it's not defined. I figured I would just make sure that it wasn't a potential failure point. Thank you
If anyone else has a situation similar to mine where they require all 3 serials the blackpills offers, the "UART6" pins will not work as expected if you use USB Support. Quite obvious in hindsight, a few of the forum posts I found talked about USB and the pinout also has USB + and - on those pins. *Arduino IDE* *>* *Tools* *>* *USB* *Support* *>* *None* for working UART6. USB upload still works but make sure you unplug the UART6 device when doing so as I think it can cause problems. Obviously, you won't get to monitor serial over USB anymore like shown in this video. Personally this is not an issue since my intent is to relay messages from 2 of the serial ports to the other port, connected to a PI3 A+ that will ultimately be running a more complex GUI program to monitor data received from both LoRa and GSM modules.
Thanks so much! I'm REALLY getting into STM32 and these videos are hitting right where I am in the learning process. Other than the built in bootloader, can you elaborate on what advantages there are of using the Black Pill over using the Blue Pill? Thanks again!
Thank you! That's a whole separate video lol. Someone else made a video on some of the differences which you should go check out but he used Mbed instead of Arduino. The information at the beginning is still good though. ruclips.net/video/QCdnO43RBK4/видео.html if you want to suggest some ideas for videos like things that are hard for you to learn or you want to see, you can go ahead and join the discord in the description. You can also get help if you get stuck.
Hi Caleb! Your video is the best reference about STM32F4 on RUclips. Many thanks! In my board STM32F11CE6 the driver for WeAct bootloader was correctly installed by Windows, but the com port does not show up. I cant not see it in device manager. Have you seen some thing like that?
In the device manager the stm is showing as STM32 DFU Emulator instead of STM32 bootloader and it's just buffering bte i have STM32 Bluepill plus by we act studio plz help
I'm trying to use and learn cubeide. I have to say that it makes you feel like making rocket science after arduino environment. I made some libraries(I just improved them) about I2C LCD 16x2 display and DHT11. I hope I can find a good source to learn more.
This is the type of comment that I love to receive. I tried to learn cube IDE but it just wasn't worth it for me. There are some guys that use it in the discord linked in the description. arduino's really good at bodging things together for prototypes and such. But using something like cube IDE is just like you said.
With the old blackpill version, I have to unplug the USB to get it back into STM32 BOOTLOADER, when I just hit reset with the dipswitch on, it doesn't show the BOOTLOADER come up
Thanks for the tutorial. Its saved me a lot of time. I'm interested in using spi and i2c busses on the 401 black pill. The 401 has several i2c and spi engines. How can I figure out which ones have been set up as the default ones used by the arduino wire and spi libraries.
hello nice video there! so i tried this tutorial and it works but i use STM32F411CEU and it didn't get recognized by windows first time i put it on DFU mode, so the trick is apparently there's a floating pin on A10 put a pulldown resistor into it then you can use the USB uploader
Hello, unfortunelly I has been a problema of "unknow device", the windows 10 dont recognize the uC... even I following the tutorial. I m not able to prog the uC through arduino.
You better use bare-metal programming for this high complex chip, e.g with Embitz and EBlink Debug server. You have 100 times more access to its ressources. But is is not as simple as using Arduino. Arduino hides the complexity in a way, that the board is not better than any AVR 8 Bit Chip.
it's not working... clicking the upload button on the Arduino ide does nothing (after completing all the steps), not even trying to compile the sketch. in the bottom banner it says: Generic STM32F4 series [not connected]. Any idea how to connect it? i have the BlackPill connected via USB C
I have to add some clarifications. I run Arduino IDE 2.0.3 and at bottom there is the display "Generic STM32F4 series [not connected]". Also before pressing the upload button, no COM Port ist shown in Windows 10 (but with reset and boot, STM32 BOOTLOADER ist shown in Windows device manager, this means the board is recognized) . When upload process is successfully finished, then STM32 BOOTLOADER disappears and a COM Port appears. Arduino (or STM32 Cube Programmer) finds COM Port automatically, so no setting before is possible. Sometime it is necessary to figure out such behavior, to prompt newbees to go forward, when there is no real error in red ist shown.
For other people getting Error: libusb_open() failed with LIBUSB_ERROR_ACCESS On Ubuntu I fixed it with: sudo apt -y install stlink-tools sudo systemctl restart udev
Hey Caleb, this video was extremely helpful thank you! I do have one problem though. I have a blackpill (STM32F411CE) board from WeAct Studios and I can run the bootloader and upload my code, but after doing so (every time even if I reset it) the COM port is never registered and my PC makes the sound of the USB disconnecting. Also it no longer shows up in my device manager, so I believe it completely disconnects without me unplugging it. Do you have any recommendations, it would be greatly appreciated, thanks!
@@CalebMarting Yup that ended up working. I had it enabled before but I must of forgot to set it again after installing the new library for STM32. Thanks again and keep up the great videos!
I haven't been able to get the black pill board to play well with any of the arduino libraries like the adafruit ssd_1306 or even the basic Servo library my code just won't compile without errors. The blue pill works great with the arduino though. Any thoughts anyone?
Thank you for the video !! ☺ I tried what you said. My board is successfully recognised as "STM32 BOOTLOADER" but I keep getting this error message : USB speed : Full Speed (12MBit/s) Manuf. ID : STMicroelectronics Product ID : STM32 BOOTLOADER SN : 367535703036 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.37 KB Address : 0x08000000 Erasing memory corresponding to segment 0: Erasing internal memory sectors [0 1] erasing sector 0000 @: 0x08000000 done erasing sector 0001 @: 0x08004000 done Download in Progress: Error: Write failed at address: 0x8000000 Error: failed to download Segment[0] Error: failed to download the File RUNNING Program ... Address: : 0x8000000 Start operation achieved successfully Any suggestions ? 😭
Looks like it might be locked from writing? You can try putting it into STM 32 cube programmer and seeing if the write protection is enabled, I'm not sure what else would cause that
@@CalebMarting Thanks for the reply 😊 . I checked the write protection, it was not enabled. My all attempts to program the board through the usb port failed... but anyhow i managed to program it using the USART pins A9 and A10 using my D1 mini as usb to serial converter (as i didn't had one of those usb to serial devices at that time) and using STM Flash Loader Demonstrator....
Hello, excuse my ignorance, but I bought one, it's still new, but I installed everything and for some reason when I put it in boot mode it sent me an error, (The USB device is not recognized, The last USB device that I connected to this computer does not work properly and windows does not recognize it.) can someone help me?
Couple things to try: Another USB - sometimes they don't have data lines Restart your PC Try another board if you have it Manually install the USB cdc drivers - can be downloaded from STM website Make sure it's actually in boot mode, it will act like this when not in boot mode
@@CalebMarting Thanks, before I saw I used a USB UART that I had around from a plane station to simulate it on the PC, I adapted it to the corresponding outputs to create a COM port and connection to the microcontroller and thus load the data, thanks everyone modes.😊
hello can you help me ? i have blackpill Weact v3.0 with stm32f411ce chip, but when I tried to get into boot mode my device manager shows "Unknown USB Device ( Device Descriptor Request Failed )", but sometimes it can read STM32 BOOTLOADER. it only occurred once or twice after reinstall everything. and when I restart my pc eventually the device manager just keep showing "Unknown USB Device ( Device Descriptor Request Failed )".
Answering my own question here. Weact 3.0 have some funcky behaviour with the onboard oscillator as @maytoolsmike describe. The other great solution that I found was to hook a ftdi tx and rx pin to a9 and a10 ( uart pin) And Also the power pin to gnd and 5v ( ftdi on 3.3v mode) Somehow the oscillator of the uart provide a "correction" and it just works. It doesn't use ftdi, just use the oscillator for enteribg the dfu mode. It's kinda iffy but it works reliably
Are you still planning on doing the Platformio tutorial for stm32? I've been struggling to find any Platformio tutorials that were as systematic and clear as your hardware tutorial for stm32.
I've been so busy with everything. You can join the discord and we can definitely help get you started there. You can actually help us write the script for that video too if you would like. I just need to start filming and making them again and get off my butt lol
Hi i have the STM32F411CE i am trying to use 2 SERIAL PORTS.... one for a bluetooth module and one as serial to the Arduino serial monitor. i read you use serial and serial1 , but no luck.... how do i configure to use more than one serial port on the STM32F411CE ? many thanks.
You can use whatever serial ports you like on what ever pins you like with this: #include HardwareSerial.h HardwareSerial SerialX(rx, tx); Then you can use SerialX like any other Serial object, with .begin and such. You can do this for as many unique serial ports as you would like, for instance HardwareSerial SerialX(PA10, PA9); HardwareSerial SerialY(PA3, PA2); Make sure you also dont use the same port twice, e.g. you can only use PA10 and PA9 OR PB7 and PB6, since this is hardware serial. You can also still use the default USB serial with this method.
@@CalebMarting Hi Caleb, it cant find the file HardwareSerial.h which one do i have to download...or where can i get HardwareSerial.h ? its for the black pill stm32f411 thank you for helping.im usually very good with arduino ... a couple of years... but new to the M4 processor in arduino. im just using the usb cable to upload and pressing the buttons, i have not added a bootloader, its programming fine, i have tft screen going... but no access to other serial ports other than the generic 'serial' through the usb to serial monitor in arduino.... that one works fine. :o)
Hmm, it worked for the f1 processors. Just to be certain you are using the Arduino core STM32, and you put "HardwareSerial.h" in quotes right? github.com/stm32duino/Arduino_Core_STM32/blob/master/cores/arduino/HardwareSerial.h
@@CalebMarting Hi Caleb, im nearly there.... i have now put the " quote marks" on and copied "HardwareSerial.h" as an added file... it seems to accept it fine and shows no errors.... however im still a bit lost on which port is which, the usual serial.println("hello world"); does NOT now print to the serial monitor through the usb port like it was doing. i simply want to use the usual USB port for serial...which works if i do not add another serial port. but adding the new serial port makes the USB serial stop working. any help please.... been 2 days now! eeeek! (if i add a line HardwareSerial Serial1(?,?); it says it is already defined, i also would not know which pins i should put in there as i want it to use the USB serial as usual) here is my code: #include "HardwareSerial.h" // RX TX HardwareSerial Serial2(PA10, PA9); void setup() { Serial1.begin(9600); delay(100); Serial1.println("Serial ONE!"); // to arduino usb serial monitor Serial2.begin(9600); delay(100); Serial2.println("Serial TWO!"); } .
Hi caleb...okay got it working! thanks for your help! here is code for others: (i dont need to #include 'HardwareSerial.h' at the beginning... it must find it automatically) HardwareSerial Serial2(PA10, PA9); void setup() { Serial.begin(9600); Serial2.begin(38400); } void loop() { if (Serial2.available()) Serial.write(Serial2.read()); if (Serial.available()) Serial2.write(Serial.read()); }
I'm having trouble with uploading code on my board. I want to use MBED, which does not appear to be an option using the appropriate board selection when making a new project. However it is an option with the Nucleo_f411re board. I think the only difference with RE vs CE is the QFP vs QFN package. (and the nucleo board has STlink of course!) I found that if I reset the board at just the right time during the upload process after compilation with the STlink, I can get the board to accept the firmware. However the STlink cannot reset the chip as needed to flash on it's own. Also I get an "Unknown/unsupported device (Device ID: 0x431)" if I attempt to upload via serial port. Guessing because the uploader checks the target processor model against the platform settings. How can I "hack" the platform settings to make the uploader think the target is a CE and not a RE variant?
I'm not entirely sure. They did the same thing for the blue pill so I would start looking at how they did it there and see if it's applicable to this. Let me know if you make any progress
@@CalebMarting Yeah I am really looking forward to your video going more in-depth on platformIO. I'm fairly new to it. Seems I can't use upload_method=serial with the Nucleo equivalent board. And the generic STM32F411CEU6 and WeAct v2.0 options don't support MBED platform, least not natively. If I attempt to use upload_method=serial, I get an "ERROR: Invalid parameter specified" and I probably need to configure platformio.ini to use a custom upload command since the one for the Nucleo board doesn't want to cooperate. I'm hoping the uploader does not check to validate the CPU is an 411RE variant instead of an 411CE. If I set the environment to match the board I have but set the board = nucleo_f411re, then I get Unknown/unsupported device (Device ID: 0x431). I'm in over my head a bit with this one, trying to get away from Arduino.
When programming using Arduino IDE in DFU mode I've always getting RDP at level 1 with "device under read out protection" warning, even in newly erased and bit already set at level 0 via STM32Cube. But uploading in SWD mode using stlink working normally. Did I miss a step or something?
No I've never seen that before, that's really weird. If you want to join the discord linked in the description we might be able to debug more there but I've never seen that before. Please let me know if you find a solution to that issue.
No se si usted podría hacer un video de como cargar una animación en una microSd y leerla con este controlador para llevarlo a una matrix de leds ws2812
Do you have a video about programming this device using the arduino core by the user Stm32duino and not STMicroelectronics? The program Stm32CubeIDE contains a hidden disabled virus and i do not feel safe using that program. I would like to completely avoid it at all costs if possible. Thank you if you are able to reply to this comment as soon as possible. EDIT: if you are also able to include how to use the said method with a simple FTDI or similar usb uart serial adapter. Thanks again.
PA just means Pin bank A, it doesn't mean analog, that's why there are PA, PB, and PCs. Please look at a pinout diagram to find what analog pins www.mischianti.org/wp-content/uploads/2022/02/STM32-STM32F4-STM32F401-STM32F401CCU6-pinout-low-resolution-1024x623.jpg Here ADC means analog to digital converter which is an analog input, but you'll notice some of those are on the PB pins as well and not all of the PA pins have those. Pinout diagrams are how you'll find what pins have what
Mine are clones. They don't show up as STM32 BOOTLOADER, but STM Device in STM Mode. When try to upload I get this message: Error: Target device not found Establishing connection with the device failed the selected serial port Establishing connection with the device failed does not exist or your board is not connected Have any of you had this problem? I know the bootloader in the Black pill is not original, but from what I have read, the bootloader from WeAct is not open source.
The weact bootloader is actually just the STM 32 F4X1 ROM bootloader, it's actually just part of the official chip, not programmed in or custom for weact. I don't know why complaining about the COM, since it should be dfu mode, but if you have a com port on your computer you may need to select it to trick Arduino into working
@@CalebMarting It does not show up as a COM port. Just as an STM Device in STM Mode. Definitely, there is a difference between WeAct and a clone. The Key button does not work as on their boards.
Do you know what clone specifically this is? You may be able to find a schematic, make sure that you can find which button boot is, or if you can't find it manually pull it high or low depending, you'll have to look at the data sheet for the chip
@@CalebMarting When I use boot and rst buttons, it goes into somewhat boot/dfu mode. In STM32CubeProgrammer I can see it as a target device with all corresponding data. When I reset it, it can not be accessed through STM32CubeProgrammer. So it works, sort of... On 411 I successfully installed CircuitPython. I can upload a program through STM32CubeIDE. Boards are ok. When in boot/dfu mode I don't see it as you, as an STM32 BOOTLOADER, but as an STM Device in STM Mode. That said, I can not upload a sketch through Arduino IDE using a USB C port. Only ST-Link or Serial.
@@CalebMarting I am also looking for the pinout. I have the exact green board you show in your video. It is the STM32F401ccu6 GH210 VQ CHN 609 st e23 Z (marked on the chip) ---the e23 is in a circle. It has the 3 dip switches also as yours shows. Recent purchase on Amazon, Nov7. I have found many hardware schematics, however, none for this specific board. Anyone that can point me to documentation would be appreciated. I have it working, but do not know what all of the features or each header pin has available. Thanks in advance.
For some reason it didn't work for me. I had the Arduino IDE 1.8.12. When used the Arduino 1.9 then it worked flawlessly. I have the STM32F401CCU Thank you!
These boards have a USB-C connector, it's been out for a while but still very new and not well adopted, my Android phone has one so that's why I have the cable
@@CalebMarting Is that what is on the iPhone? I have one the iPhone charger will that work? Thanks for letting me know. I like the looks of the black pill better. I have other projects so I am just pecking at it for now.
It is not, iPhone uses the lightning connector. you should be able to go to any big box store and get a USB-C cable though for pretty cheap. Just make sure it has data
CubeMX is a different program. STM32 Cube Programmer is used by Arduino to upload code to the black pill. There's a command line program included in the install that it uses.
It doesn't show up before you upload code, or after? You don't need a port for uploading code to this, it goes through a different protocol called DFU. If you do have a port other than this device, you may have to select it to get code to upload, but it should work
@@CalebMarting Thank you, the port didn't show even after uploading it turns out on my board the nrst needs to be pressed first then the boot and release nrst, now it works
I'm not sure, it is a weact f401 board. You can join the discord and we can try to help you there if you want, otherwise if you use the keyword weact you should be able to find it
@@CalebMarting nvm I found it. In the Amazon page, there is a google drive link to a folder with data sheets and schematic. I would love to join the discord though.
Pretty sure there are much better ways to program for the i9 :p Brain***k is a pretty popular language for it I've heard Hello World: ++++++++[>++++[>++>+++>+++>+>+[.>---.+++++++..+++.>>.+.>++. You'll also need to have the Windows 10 bootloader, some supporting hardware modules, and a BF interpreter executable installed haha
Lol I hope we're both joking 'cause I know I am. Arduino is a great way to get up and running with stuff that you wouldn't normally be able to. I know a lot of people in our discord have issues with getting cube IDE working and stuff. It also exposes some features like the registers and stuff so you can still do things like hardware encoder stuff. it's the same question of why would you use Python when C is so much faster.Because with Python you can bodge something together in 10 minutes versus C being a lot harder to debug and get it up and running. For the same question C versus assembly C provides abstraction which just makes things easier but you lose that low-level control. Everything is trade-offs
Yeah so that's intentional. If you don't have generic serial supersede uart and USB support on. If you turn those two settings on then USB support will be enabled and you'll see the USB port.
@@CalebMarting Thanks a lot for your help. Have you tried the ADC pins? It got me wondering since the datasheet says the uM has 12-Bit resolution for ADC, while I am getting only 10-Bit Resolution.
@Caleb Marting it spoils human brain.) Nowadays you can easily start programming MCUs like a normal engineer but Arduino is everywhere! Articles just gives you instructions you don't understand. Arduino forces you to think that educational devices can do real work. And then people trusts quite dangerous things to it -- like an elevators. Arduino don't teach people properly but gives them illusion of knowing.
I call it a gateway drug, it's what got me into ST devices, HAL, etc. It's great for bodging things together. It's the old saying, when all you have is a hammer, everything looks like a nail
its over for arduinocels
Truly brutal
lmao
Dont be a freeagent in life
bro it never began its already over
Finally, a video that covers dip switches. Thanks for uploading this!
Thank you!
Just received the BlackPill F411CE and I must say this is an arduino killer !
how did you make windows recognise it in dfu mode?
It should recognize it, if it's not recognizing any USB connected then check your USB cable or try a different one. Otherwise try a different computer maybe?
@@CalebMartingthe driver it's using doesn't work, wich one do you use?
Thank you for the very intuitive video
So grateful for this video. Without your explanations I would never have gotten to troubleshooting and discovering my USB C cables were not data cables.
It's so unexpected, isn't it?!
Glad you were able to figure it out
Caleb Marting: I posted over on the STM32F10x instructions looking for how to with the F4.
Found this video...Thanks all is working...Keep up the nice video's....
Thanks for the video. This was exactly what the seller should have supplied. I was struggling with getting anything done on this board based on the information I was able to find elsewhere.
Glad you figured it out, I saw the comment on my other video and realized you had the same boards that I did
Thanks a lot Caleb.
Working in first attempt with STM32Duino 1.9.0 Version on Arduino IDE 1.8.13. with a 3 button F401CC Board.
A little beast. About 140 times faster than Arduino NANO calculating 12!
This works great on my new black pill stm32f411ce with arduino 1.8.13 ide, It uploaded direct from the USB port - very happy thanks
How do you did it?
I just wanted to thank you. I had been struggling with uploading code to the board. This was exactly what I was looking for. Thanks!!!
Am an Arduino user getting into STM32. This content is just what I was looking for; should have ideally come from STM. Thanks a ton.
Many thanks, now I can use this board.
Tech can’t fix a few mm of bone
Thank you for this video. I have the new 3.0 board and your procedure worked for me with the following additions.. I had to use a hairdryer to heat up the board. I saw somewhere that the oscillator does not work correctly at cooler temps. Also the timing of pushing the BOOT0 and NRST buttons is ridiculously picky. I pretty much push and release them simultaneously while trying to get the correct order; this usually takes 5 to 15 attempts!
If you hold boot0 when you press and release rst, then release boot0 it doesn't work? You might have just gotten that timing by chance when you take like 15 times
Thank you for that heating trick. That heating trick also tackles picky button timings or atleast for me it did.
DUDE WTF!!!! I HAD THIS SAME FRUSTRATION!
but still with the heating method it still require some luck with boot sequence
Good concise video, very helpful for getting started.
I think I'm in the wrong place oops
good tutorial, thanks so much.
very good, I just received one and will be using it soon. Thanks
Thanks for this fine video!
Hi, I love your content very much. I'm using the black pill f411, but I followed your steps but as for now it only show STM32 BOOTLOADER at the device manager but there's no COM Port visible. I tested my wire cable, it supported the data link, I used it for transferring picture from phone to pc and its work. please do help me I'm stuck. thanks in advance sir
Did you solve it , I’m stuck also
You have to create a virtual port since you don't have a “physical” one, in the libraries of the arduino IDE I didn't find how to solve it, but in platformIO in VScode, in the configurations mentioned in the video you just add these two lines:
build_flags = -DUSBCON -DUSBD_USE_CDC
monitor_speed = 115200
With that you can use it if you want to make it arduino based, the alternative solution is to use the stm32cubeIDE which is the original alternative.
Great Video. This helped me a lot.
Great video
Thanks for sharing👍😀
Thank you!
Note: I found that the version of Arduino IDE I use, 1.8.12 has the value for LED_BUILTIN is correctly set based on the board you are using (PC13, in this case, and in the case of BluePill boards)
The STM32 Arduino core is what would change it. I've mostly had them work in the past but sometimes it just doesn't want to compile or it's not defined. I figured I would just make sure that it wasn't a potential failure point. Thank you
If anyone else has a situation similar to mine where they require all 3 serials the blackpills offers, the "UART6" pins will not work as expected if you use USB Support. Quite obvious in hindsight, a few of the forum posts I found talked about USB and the pinout also has USB + and - on those pins.
*Arduino IDE* *>* *Tools* *>* *USB* *Support* *>* *None* for working UART6. USB upload still works but make sure you unplug the UART6 device when doing so as I think it can cause problems.
Obviously, you won't get to monitor serial over USB anymore like shown in this video. Personally this is not an issue since my intent is to relay messages from 2 of the serial ports to the other port, connected to a PI3 A+ that will ultimately be running a more complex GUI program to monitor data received from both LoRa and GSM modules.
Thanks so much! I'm REALLY getting into STM32 and these videos are hitting right where I am in the learning process.
Other than the built in bootloader, can you elaborate on what advantages there are of using the Black Pill over using the Blue Pill?
Thanks again!
Thank you!
That's a whole separate video lol. Someone else made a video on some of the differences which you should go check out but he used Mbed instead of Arduino. The information at the beginning is still good though. ruclips.net/video/QCdnO43RBK4/видео.html
if you want to suggest some ideas for videos like things that are hard for you to learn or you want to see, you can go ahead and join the discord in the description. You can also get help if you get stuck.
For starters the blue pill makes you a simp but the black pill doesn't.
Thanks for the Video, Boardmanager is today version 1.9.0
Many thanks!
Interesting vid newbie here. Just wanted to say hi from the Netherlands new subscriber..
Hi Caleb! Your video is the best reference about STM32F4 on RUclips. Many thanks! In my board STM32F11CE6 the driver for WeAct bootloader was correctly installed by Windows, but the com port does not show up. I cant not see it in device manager. Have you seen some thing like that?
Try another USB cable, some don't have data lines
In the device manager the stm is showing as STM32 DFU Emulator instead of STM32 bootloader and it's just buffering bte i have STM32 Bluepill plus by we act studio plz help
I'm trying to use and learn cubeide. I have to say that it makes you feel like making rocket science after arduino environment. I made some libraries(I just improved them) about I2C LCD 16x2 display and DHT11. I hope I can find a good source to learn more.
This is the type of comment that I love to receive. I tried to learn cube IDE but it just wasn't worth it for me. There are some guys that use it in the discord linked in the description. arduino's really good at bodging things together for prototypes and such. But using something like cube IDE is just like you said.
life saver
Hello I m struggling with some Read Our Protection is on, error what to do please help
With the old blackpill version, I have to unplug the USB to get it back into STM32 BOOTLOADER, when I just hit reset with the dipswitch on, it doesn't show the BOOTLOADER come up
I forgot to thank you for this valuable video. It was the missing step to get my board working.
Thanks for the tutorial. Its saved me a lot of time. I'm interested in using spi and i2c busses on the 401 black pill. The 401 has several i2c and spi engines. How can I figure out which ones have been set up as the default ones used by the arduino wire and spi libraries.
I'm not entirely sure, best way would probably be guess and check or you can look at the configs on the actual stm32 Arduino core for that board
hello nice video there! so i tried this tutorial and it works but i use STM32F411CEU and it didn't get recognized by windows first time i put it on DFU mode, so the trick is apparently there's a floating pin on A10 put a pulldown resistor into it then you can use the USB uploader
Hello, unfortunelly I has been a problema of "unknow device", the windows 10 dont recognize the uC... even I following the tutorial. I m not able to prog the uC through arduino.
BootLoader update complete!
@5:00 PARTY TIME!!!
Sorry, it's me again. Now I found, that in menu tools, item "Port" occurs after successful upload.
You better use bare-metal programming for this high complex chip, e.g with Embitz and EBlink Debug server. You have 100 times more
access to its ressources. But is is not as simple as using Arduino. Arduino hides the complexity in a way, that the board is not better than any AVR 8 Bit Chip.
it's not working... clicking the upload button on the Arduino ide does nothing (after completing all the steps), not even trying to compile the sketch.
in the bottom banner it says: Generic STM32F4 series [not connected].
Any idea how to connect it? i have the BlackPill connected via USB C
I have to add some clarifications. I run Arduino IDE 2.0.3 and at bottom there is the display "Generic STM32F4 series [not connected]". Also before pressing the upload button, no COM Port ist shown in Windows 10 (but with reset and boot, STM32 BOOTLOADER ist shown in Windows device manager, this means the board is recognized) . When upload process is successfully finished, then STM32 BOOTLOADER disappears and a COM Port appears. Arduino (or STM32 Cube Programmer) finds COM Port automatically, so no setting before is possible. Sometime it is necessary to figure out such behavior, to prompt newbees to go forward, when there is no real error in red ist shown.
For other people getting Error: libusb_open() failed with LIBUSB_ERROR_ACCESS
On Ubuntu I fixed it with:
sudo apt -y install stlink-tools
sudo systemctl restart udev
Hey Caleb, this video was extremely helpful thank you! I do have one problem though. I have a blackpill (STM32F411CE) board from WeAct Studios and I can run the bootloader and upload my code, but after doing so (every time even if I reset it) the COM port is never registered and my PC makes the sound of the USB disconnecting. Also it no longer shows up in my device manager, so I believe it completely disconnects without me unplugging it. Do you have any recommendations, it would be greatly appreciated, thanks!
You must enable usb, and generic CDC supersede usart, etc like I explained in the video. If that doesn't work please let me know
@@CalebMarting Yup that ended up working. I had it enabled before but I must of forgot to set it again after installing the new library for STM32. Thanks again and keep up the great videos!
I haven't been able to get the black pill board to play well with any of the arduino libraries like the adafruit ssd_1306 or even the basic Servo library my code just won't compile without errors. The blue pill works great with the arduino though. Any thoughts anyone?
I was having an issue programming this board from Arduino IDE it was showing no debug port detected can you please help me!
Thank you for the video !! ☺
I tried what you said. My board is successfully recognised as "STM32 BOOTLOADER" but I keep getting this error message :
USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : 367535703036
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.37 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
erasing sector 0000 @: 0x08000000 done
erasing sector 0001 @: 0x08004000 done
Download in Progress:
Error:
Write failed at address: 0x8000000
Error: failed to download Segment[0]
Error: failed to download the File
RUNNING Program ...
Address: : 0x8000000
Start operation achieved successfully
Any suggestions ? 😭
Looks like it might be locked from writing? You can try putting it into STM 32 cube programmer and seeing if the write protection is enabled, I'm not sure what else would cause that
@@CalebMarting Thanks for the reply 😊 . I checked the write protection, it was not enabled.
My all attempts to program the board through the usb port failed... but anyhow i managed to program it using the USART pins A9 and A10 using my D1 mini as usb to serial converter (as i didn't had one of those usb to serial devices at that time) and using STM Flash Loader Demonstrator....
bro I am not getting com port
Hello, excuse my ignorance, but I bought one, it's still new, but I installed everything and for some reason when I put it in boot mode it sent me an error, (The USB device is not recognized, The last USB device that I connected to this computer does not work properly and windows does not recognize it.) can someone help me?
Couple things to try:
Another USB - sometimes they don't have data lines
Restart your PC
Try another board if you have it
Manually install the USB cdc drivers - can be downloaded from STM website
Make sure it's actually in boot mode, it will act like this when not in boot mode
@@CalebMarting Thanks, before I saw I used a USB UART that I had around from a plane station to simulate it on the PC, I adapted it to the corresponding outputs to create a COM port and connection to the microcontroller and thus load the data, thanks everyone modes.😊
I do not know if you could make a video of how to load an animation on a microSd and read it with this driver to take it to a matrix of leds ws2812
Pls do more stm32 project, bluepill
hello can you help me ? i have blackpill Weact v3.0 with stm32f411ce chip, but when I tried to get into boot mode my device manager shows "Unknown USB Device ( Device Descriptor Request Failed )", but sometimes it can read STM32 BOOTLOADER. it only occurred once or twice after reinstall everything. and when I restart my pc eventually the device manager just keep showing "Unknown USB Device ( Device Descriptor Request Failed )".
Answering my own question here.
Weact 3.0 have some funcky behaviour with the onboard oscillator as @maytoolsmike describe. The other great solution that I found was to hook a ftdi tx and rx pin to a9 and a10 ( uart pin)
And Also the power pin to gnd and 5v ( ftdi on 3.3v mode)
Somehow the oscillator of the uart provide a "correction" and it just works.
It doesn't use ftdi, just use the oscillator for enteribg the dfu mode.
It's kinda iffy but it works reliably
thanks!!!
Are you still planning on doing the Platformio tutorial for stm32? I've been struggling to find any Platformio tutorials that were as systematic and clear as your hardware tutorial for stm32.
I've been so busy with everything. You can join the discord and we can definitely help get you started there. You can actually help us write the script for that video too if you would like. I just need to start filming and making them again and get off my butt lol
Hi i have the STM32F411CE i am trying to use 2 SERIAL PORTS.... one for a bluetooth module and one as serial to the Arduino serial monitor.
i read you use serial and serial1 , but no luck.... how do i configure to use more than one serial port on the STM32F411CE ? many thanks.
You can use whatever serial ports you like on what ever pins you like with this:
#include HardwareSerial.h
HardwareSerial SerialX(rx, tx);
Then you can use SerialX like any other Serial object, with .begin and such. You can do this for as many unique serial ports as you would like, for instance
HardwareSerial SerialX(PA10, PA9);
HardwareSerial SerialY(PA3, PA2);
Make sure you also dont use the same port twice, e.g. you can only use PA10 and PA9 OR PB7 and PB6, since this is hardware serial. You can also still use the default USB serial with this method.
@@CalebMarting Hi Caleb, it cant find the file HardwareSerial.h
which one do i have to download...or where can i get HardwareSerial.h ?
its for the black pill stm32f411
thank you for helping.im usually very good with arduino ... a couple of years... but new to the M4 processor in arduino. im just using the usb cable to upload and pressing the buttons, i have not added a bootloader, its programming fine, i have tft screen going... but no access to other serial ports other than the generic 'serial' through the usb to serial monitor in arduino.... that one works fine. :o)
Hmm, it worked for the f1 processors. Just to be certain you are using the Arduino core STM32, and you put "HardwareSerial.h" in quotes right? github.com/stm32duino/Arduino_Core_STM32/blob/master/cores/arduino/HardwareSerial.h
@@CalebMarting Hi Caleb, im nearly there.... i have now put the " quote marks" on and copied "HardwareSerial.h" as an added file... it seems to accept it fine and shows no errors.... however im still a bit lost on which port is which, the usual serial.println("hello world"); does NOT now print to the serial monitor through the usb port like it was doing.
i simply want to use the usual USB port for serial...which works if i do not add another serial port. but adding the new serial port makes the USB serial stop working. any help please.... been 2 days now! eeeek!
(if i add a line HardwareSerial Serial1(?,?); it says it is already defined, i also would not know which pins i should put in there as i want it to use the USB serial as usual)
here is my code:
#include "HardwareSerial.h"
// RX TX
HardwareSerial Serial2(PA10, PA9);
void setup()
{
Serial1.begin(9600);
delay(100);
Serial1.println("Serial ONE!"); // to arduino usb serial monitor
Serial2.begin(9600);
delay(100);
Serial2.println("Serial TWO!");
}
.
Hi caleb...okay got it working!
thanks for your help!
here is code for others:
(i dont need to #include 'HardwareSerial.h' at the beginning... it must find it automatically)
HardwareSerial Serial2(PA10, PA9);
void setup()
{
Serial.begin(9600);
Serial2.begin(38400);
}
void loop()
{
if (Serial2.available())
Serial.write(Serial2.read());
if (Serial.available())
Serial2.write(Serial.read());
}
great sir, will u please share i2c tmp112 temperature sensor code?(aurdino IDE)
I'm having trouble with uploading code on my board. I want to use MBED, which does not appear to be an option using the appropriate board selection when making a new project. However it is an option with the Nucleo_f411re board. I think the only difference with RE vs CE is the QFP vs QFN package. (and the nucleo board has STlink of course!)
I found that if I reset the board at just the right time during the upload process after compilation with the STlink, I can get the board to accept the firmware. However the STlink cannot reset the chip as needed to flash on it's own. Also I get an "Unknown/unsupported device (Device ID: 0x431)" if I attempt to upload via serial port. Guessing because the uploader checks the target processor model against the platform settings.
How can I "hack" the platform settings to make the uploader think the target is a CE and not a RE variant?
I'm not entirely sure. They did the same thing for the blue pill so I would start looking at how they did it there and see if it's applicable to this. Let me know if you make any progress
@@CalebMarting Yeah I am really looking forward to your video going more in-depth on platformIO. I'm fairly new to it. Seems I can't use upload_method=serial with the Nucleo equivalent board. And the generic STM32F411CEU6 and WeAct v2.0 options don't support MBED platform, least not natively. If I attempt to use upload_method=serial, I get an "ERROR: Invalid parameter specified" and I probably need to configure platformio.ini to use a custom upload command since the one for the Nucleo board doesn't want to cooperate. I'm hoping the uploader does not check to validate the CPU is an 411RE variant instead of an 411CE. If I set the environment to match the board I have but set the board = nucleo_f411re, then I get Unknown/unsupported device (Device ID: 0x431). I'm in over my head a bit with this one, trying to get away from Arduino.
When programming using Arduino IDE in DFU mode I've always getting RDP at level 1 with "device under read out protection" warning, even in newly erased and bit already set at level 0 via STM32Cube. But uploading in SWD mode using stlink working normally. Did I miss a step or something?
No I've never seen that before, that's really weird. If you want to join the discord linked in the description we might be able to debug more there but I've never seen that before. Please let me know if you find a solution to that issue.
Is all Arduino codes and library works on stm32 using this method
No se si usted podría hacer un video de como cargar una animación en una microSd y leerla con este controlador para llevarlo a una matrix de leds ws2812
End vid, is it blue LED blink really follow the music ?
Yep, congratulations you found the Easter egg :p
Do you have a video about programming this device using the arduino core by the user Stm32duino and not STMicroelectronics? The program Stm32CubeIDE contains a hidden disabled virus and i do not feel safe using that program. I would like to completely avoid it at all costs if possible. Thank you if you are able to reply to this comment as soon as possible.
EDIT: if you are also able to include how to use the said method with a simple FTDI or similar usb uart serial adapter. Thanks again.
there are no stm in the boards manager of the arduino ide
is A0-A15 analog inputs?how many analog inputs can it handle? im planning to create a edrums out of it.thanks
PA just means Pin bank A, it doesn't mean analog, that's why there are PA, PB, and PCs. Please look at a pinout diagram to find what analog pins www.mischianti.org/wp-content/uploads/2022/02/STM32-STM32F4-STM32F401-STM32F401CCU6-pinout-low-resolution-1024x623.jpg
Here ADC means analog to digital converter which is an analog input, but you'll notice some of those are on the PB pins as well and not all of the PA pins have those. Pinout diagrams are how you'll find what pins have what
@@CalebMarting this is very helpful. thanks for this mate 😁😁
Mine are clones. They don't show up as STM32 BOOTLOADER, but STM Device in STM Mode. When try to upload I get this message:
Error: Target device not found
Establishing connection with the device failed
the selected serial port Establishing connection with the device failed
does not exist or your board is not connected
Have any of you had this problem? I know the bootloader in the Black pill is not original, but from what I have read, the bootloader from WeAct is not open source.
The weact bootloader is actually just the STM 32 F4X1 ROM bootloader, it's actually just part of the official chip, not programmed in or custom for weact. I don't know why complaining about the COM, since it should be dfu mode, but if you have a com port on your computer you may need to select it to trick Arduino into working
@@CalebMarting It does not show up as a COM port. Just as an STM Device in STM Mode. Definitely, there is a difference between WeAct and a clone. The Key button does not work as on their boards.
Do you know what clone specifically this is? You may be able to find a schematic, make sure that you can find which button boot is, or if you can't find it manually pull it high or low depending, you'll have to look at the data sheet for the chip
@@CalebMarting When I use boot and rst buttons, it goes into somewhat boot/dfu mode. In STM32CubeProgrammer I can see it as a target device with all corresponding data. When I reset it, it can not be accessed through STM32CubeProgrammer. So it works, sort of...
On 411 I successfully installed CircuitPython. I can upload a program through STM32CubeIDE. Boards are ok. When in boot/dfu mode I don't see it as you, as an STM32 BOOTLOADER, but as an STM Device in STM Mode. That said, I can not upload a sketch through Arduino IDE using a USB C port. Only ST-Link or Serial.
And you do have dfu selected in Arduino as the upload method?
this older version has 44 pins also where can you get a pinout for this older version. all i can find is the newer 40 pin version
The weact f4 mini GitHub has all of the hardware schematics and pinouts I believe, let me know if you can't find it
@@CalebMarting I am also looking for the pinout. I have the exact green board you show in your video. It is the STM32F401ccu6 GH210 VQ CHN 609 st e23 Z (marked on the chip) ---the e23 is in a circle. It has the 3 dip switches also as yours shows. Recent purchase on Amazon, Nov7.
I have found many hardware schematics, however, none for this specific board. Anyone that can point me to documentation would be appreciated. I have it working, but do not know what all of the features or each header pin has available. Thanks in advance.
github.com/WeActTC/MiniF4-STM32F4x1/tree/master/HDK it's one of them in here
For some reason it didn't work for me. I had the Arduino IDE 1.8.12.
When used the Arduino 1.9 then it worked flawlessly.
I have the STM32F401CCU
Thank you!
Huh, very weird, don't know what would cause that. Glad it works though!
arduino 1.9 ? did they release that ?
thank you for this video. its very good and clear, my question is what is the speed of the black pill chip ? i hear it is 100 mhz?
is that right ?
F401 is 84mhz, but I believe the f411 is above 100
Caleb, what USB cable do you use, mine doesn't fit?
These boards have a USB-C connector, it's been out for a while but still very new and not well adopted, my Android phone has one so that's why I have the cable
@@CalebMarting Is that what is on the iPhone? I have one the iPhone charger will that work? Thanks for letting me know. I like the looks of the black pill better. I have other projects so I am just pecking at it for now.
It is not, iPhone uses the lightning connector. you should be able to go to any big box store and get a USB-C cable though for pretty cheap. Just make sure it has data
also make sure you use a type C DATA cable.... sometimes from the pound shop they are only for charging and the DATA lines are not connected!
How to upload bootloader?
Hi i don"t understand Cube MX in you video what for?
CubeMX is a different program. STM32 Cube Programmer is used by Arduino to upload code to the black pill. There's a command line program included in the install that it uses.
@@CalebMarting oh thx.
port dosen't show up how do i deal with that?
It doesn't show up before you upload code, or after? You don't need a port for uploading code to this, it goes through a different protocol called DFU. If you do have a port other than this device, you may have to select it to get code to upload, but it should work
@@CalebMarting Thank you, the port didn't show even after uploading it turns out on my board the nrst needs to be pressed first then the boot and release nrst, now it works
Where can I find a pinout for your board?
I'm not sure, it is a weact f401 board. You can join the discord and we can try to help you there if you want, otherwise if you use the keyword weact you should be able to find it
@@CalebMarting nvm I found it. In the Amazon page, there is a google drive link to a folder with data sheets and schematic. I would love to join the discord though.
discord.gg/wrMcmXA I run this discord, see you there
hey, dude! have your any idea how to program an intel core i9 in Arduino IDE?
Pretty sure there are much better ways to program for the i9 :p
Brain***k is a pretty popular language for it I've heard
Hello World: ++++++++[>++++[>++>+++>+++>+>+[.>---.+++++++..+++.>>.+.>++.
You'll also need to have the Windows 10 bootloader, some supporting hardware modules, and a BF interpreter executable installed haha
@@CalebMarting oh rly?! but why you use ardu ide to program F4 (fourth series! ) ?
Lol I hope we're both joking 'cause I know I am. Arduino is a great way to get up and running with stuff that you wouldn't normally be able to. I know a lot of people in our discord have issues with getting cube IDE working and stuff. It also exposes some features like the registers and stuff so you can still do things like hardware encoder stuff. it's the same question of why would you use Python when C is so much faster.Because with Python you can bodge something together in 10 minutes versus C being a lot harder to debug and get it up and running. For the same question C versus assembly C provides abstraction which just makes things easier but you lose that low-level control. Everything is trade-offs
Why do you want to program a thermonuclear device? IT'S GONNA BLOW! RUN FOR YOUR LIFE!!!
Great! somehow I have the STM32F411CEU6
, and when connected I could see "STM32 BOOTLOADER" in Device manager but still can't see it in the ports.
Yeah so that's intentional. If you don't have generic serial supersede uart and USB support on. If you turn those two settings on then USB support will be enabled and you'll see the USB port.
@@CalebMarting Thanks a lot for your help. Have you tried the ADC pins? It got me wondering since the datasheet says the uM has 12-Bit resolution for ADC, while I am getting only 10-Bit Resolution.
Someone else on the discord (linked in the description) was trying to figure that out. You can join and see if they made any progress
Be sure that you seected CDC on USB Support. This activate the serial port COM.
Music on top of vocals is annoying
Fck the Arduino!
Why
@Caleb Marting it spoils human brain.) Nowadays you can easily start programming MCUs like a normal engineer but Arduino is everywhere! Articles just gives you instructions you don't understand. Arduino forces you to think that educational devices can do real work. And then people trusts quite dangerous things to it -- like an elevators. Arduino don't teach people properly but gives them illusion of knowing.
I call it a gateway drug, it's what got me into ST devices, HAL, etc. It's great for bodging things together.
It's the old saying, when all you have is a hammer, everything looks like a nail