And now you have the very cheap and STM32F103 pin compatible GD32VF103 RISC-V chip from China. Sure you'll need new firmware but the peripherals are mostly the same as far as I can see at this point but I'm not 100% familiar with it yet.
GD32VF103 Literature package: https://sourceforge.net/projects/mecrisp/files/Target%20literature%20package%20for%20GD32VF103.tar.gz/download
What I've done with it so far: https://mecrisp-stellaris-folkdoc.sourceforge.io/gd32vf103.html#gd32vf103-longan-nano
The GD32VF103CBF6 is completely different, totally different architecture than the STM32F103 or the similarly named GD32F103CBF6 .
The Sipeed Longan Nano board a GD32VF103CBF6 dev board, is available from SeedStudio for $4.90 apiece including a micro SD card reader and a color OLED display on the board and even a form fitted plastic case.
https://www.seeedstudio.com/Sipeed-Longan-Nano-RISC-V-GD32VF103CBT6-Development-Board-p-4205.htmlDespite the naming similarity, GD32VF103CBF6 RISC-V chip is 128KB Flash, 32KB SRAM (not 20 KB) and runs at 108 MHz. I am working with one of these feverishly now. I have the Microsoft Visual Studio Code and PlatformIO and gcc entire toolchain installed and support for the Longan Nano board. Also have Sigrok installed and running with a cheap Saleae clone. Have a DS Logic on order. Running it on the Lenovo 14w laptop I just bought for $129, and running Manjaro Linux from a fast USB thumb drive.
It is a bit of back and forth because I am working with a new laptop and a new operating system and having to install everything myself.
GD32VF103CBF6 is quite a learning curve but I think will be worth the time invested. Despite 'pin compatibility' with STM32 the RISC-V chip is thoroughly modern chip one of the most modern on the market (< 6 month old?) and has the following:
two 12-bit ADCs with 16 channels each, two 12-bit DACs, 6 timers, three SPIs, two I2Cs, three USARTs, two UARTs, two I2Ss, two CANs, an USBFS, a CRC calculate unit.
So far I got rudimentary understanding of timers, interrupts and basic sleep mode somewhat figured out by reading the data sheet, searching for Github projects and judicious cut/paste code, reading RISC-V spec. It's so new you really have to spend time just finding and gathering together the various guides online. You burn firmware using the DFU interface that it understands, while the USB cable is connected to the PC. There are also serial FTDI type programming option or through the JTAG port with a debugger, neither of which have I tried.
Got it to sleep on timer and/or button press, interrupt routines on either, reads a bunch of H/W registers and displays on the OLED color display ever 3.5 seconds. Reads and writes files to the SD card. And of course does a blinky but it's an 8 colors blinking on one of the onboard LED, changes colors every 3.5 seconds when the timer fires. Due to the sleep mode and the fact I can profile instruction counts, it is doing 771,000 instructions per second not 108 million, due to sleeping most of the time. Have not measured current draw on the thing yet.
It uses a USB C connector but the way for power.
I have to the video working I got the SD card reader/writer working, got the H/W register code to fetch the instructions executed count since startup (not sure if STM32 has this). So it is pretty easy to compute actual instruction count for a loop or what have you.
I don't have the STM32 background myself and no MCU expert but bought several Blue Pill boards for $1.50 each on order to play with. Going forward though my focus is on RISC-V and the Longan Nano board.
It is also available from Amazon Prime for less than $10. I got one to start with and ordered another 10 from SeeedStudio to play with.
One nice thing is you can program a Longan Nano board to be a debugger for other Longan Nano boards and just connect a ribbon cable to the already soldered JTAG headers. That is kind of cool. It also uses Altera USB Blaster or clones, or JLINK neither of which I have tried, and also an RV Link dedicated programmer from Seeed Studio I have one on order too just to keep handy that cost me $7.90.