I have just got into STM32 blue/black pills. I installed the STM32Cube sw and then the ST STM32 in PlatformIO. I am running Code on linux Mint 20.
First I tried the blue pill, wired it up with a USB to TTL convert on A9 & A10. Loaded up the obligatory blink code and uploaded it no problem.
Moving over to the blackpill (WeAct BlackPill 3.0), first minor problem the choice of boards had WeAct BlackPill v2.0 but not 3.0 so I went ahead with 2.0. Next, the USB is supposed to work for uploading so in platformio.ini I had:
Using Parser : Raw BINARY
Interface serial_posix: 115200 8E1
*** [upload] Error 1
This was last nite. This afternoon I had another go at it. changed the upload_rotocol to dfu and hit upload. It worked!! The only difference was that the USB to TTL board was still wired up. As there are only 2 connections to the board I tried uploading with one and then the other connected. Uploading work with A10 connected. I then tied A10 to 5v and I could still upload via USB.
Has anybody else used the WeAct BlackPill 3.0? Can anyone explain what’s going on here?
Did you hold down the “BOOT0” button while inserting the USB connection of the device? Or did a hold-BOOT0 and press RST procedure? The chips are only flashable via serial or USB when they’re executing the embedded bootloader, and that’s the way to run it. See this article, too.
I have been holding down BOOT0 and then pressing NRST. When I tie PA10 HIGH then upload works. If PA10 is not connected to anything then upload does not work and I get the Invalid dfu message. I didn’t know about the hold BOOT0 while inserting the USB, so I just tried it and got the same results depending on if PA10 is held HIGH or not.
Per WeAct Studio Black Pill V3.0 — Zephyr Project Documentation the PA10 pin is the “USB FS_ID” pin. FS should stand for full-speed (USB) and the ID pin is what identifies the device is a USB host or as a USB device. Maybe there’s a fault in the USB-C to USB-something adapter that you may be using? Or it isn’t properly routed on the board?
Yup! ~£3. I just reviewed my last batch of STM32 MCUs. In fact, the last one I purchased is a v3. Same STM32 as v2, no real differences.
I have hardly ever use the USB-C connector on the blackpill_f411ce, just ST-Link.
Under Zephyr, I use nRF52840 (particle_xenon, Nordic Dongle), bbc_microbit_v2, and STM32 (blackpill_f411ce). All great devices.
It’s pity that the bbc_microbit_v2 isn’t based on the nRF52840 but the nRF52833 is just one below and pretty good, plus has an onboard probe ( default CMSIS-DAP but I reflashed it with J-Link) plus a bunch of sensors.
Zephyr does have somewhat of a learning curve with the devicetree but well worth the effort. I use PlatformIO and Zephyr combo most of the time.
I have quite a few esp8266, esp32, and nRF24 Nano (all using the Arduino Framework) deployed and in the works, the Zephyr & PlatformIO / nRF52840 / STM32 combo is superb for development & deployment. With Nordic Semi & many others standardizing on Zephyr, it has a great future.
All, so inexpensive, cool target development that used to cost over £1K back in '80s!