I have accumulated lot of cheap stuff based on STMF103C8T6 chip. Before pandemic, these were typically for < 2 USD on Aliexpress/Ebay including shipping.
They typically have 20KB RAM, 128KB Flash and USB. Some board files are still in https://github.com/espruino/Espruino/tree/UNMAINTAINED_BOARDS/boards
Wanted to check whether current code still fits and how usable they are with Espruino now. Main reason was to have something to experiment with STLINK V2 dongle (see e.g. https://hackaday.io/project/162597-st-link-clone-repurposing) as I wanted to port something to it so wanted to get familiar quickly with the hardware.
I started with minimal SAVE_ON_FLASH configuration (only 128KB of Flash!) and then managed to add
while still having 11KB flash free for persistent storage. So overall surprising success. With 20K RAM there is also ~1000 variables.
So now I have very compact USB stick Espruino device with pin header with up to six GPIOs that can do HW UART (including console if usb is not plugged in), software SPI and I2C and other stuff. Tried e.g. to backup SPI flash (photo here https://i.ibb.co/fG3wRJf/IMG-20211119-012644.jpg ) and it was pretty easy to do. I can also load native C code quickly to test this platform.
The only catch is that there is no bootloader so update is needed via SWD, but when bringing SWD pins outside, which is easy to do, reprogramming is easy and I have two more GPIOs (A13,A14) as SWD functionality can be turned off at runtime via one poke32 call. Also I am thinking about building some "bootloader" and upload it to storage (or RAM) temporarily to update it via USB or serial.
Some photos, board file and binary build is here
Wow, this is super cool - thanks for sharing!
If you have many of them (I do, my incomplete order history :-) ) then it is good to pick the better ones. Some have two leds, some one, some have chip labelled STM32 some have CKS32 and also some have 680 ohm pullup on SWIM (as per schematics) which is easy to find and scratch off the board and some not. Also some have SWD test points that are easier to solder (bigger or with holes) or attach to, some not. With every order I got slightly different one and then when searching internet I saw plenty of different ones too. I flashed two variants (three in total) and they work fine but no guarantee it will work with yours. Also some are labelled F101 instead of F103 (F101 should not have USB functionality at all, don't have any 101 one myself but others report getting it).
Also nowadays they are more expensive so not worth getting them now I guess. Funnily I wanted to port CMSIS-DAP debugger source to it including working UART and then checked aliexpress for these dongles again and found cheaper ones already having CMSIS-DAP preinstalled - here or here, ordered but will see what is inside. There can be something worse than STM32.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem