Blue Pill as a Versatile Interface - Page 1
Forum section: electronics / general

author: poorsam
author_rank: Newbie
timestamp: August 07, 2020, 09:18:32 pm
content: I'm going to buy a blue pill board (STM32F103C8T6) and use it for flash programming, debugging, …. I looked up GitHub and found many projects emulating almost any interface on STM32F1.I know my question seems weird, at first I planned to get a FT232H board but it's price is ridiculously high where I live, then I considered FT232RL hoping to use its bitbang feature but I couldn't find any way to use it - for example to flash eeproms (famous flashrom didn't support it). Considering the price tag and the fact that I won't use it frequently I settled on blue pill.What's your opinion about this? Is it feasible?Also does the USB bootloader interfere with such applications?

author: thm_w
author_rank: Super Contributor
timestamp: August 07, 2020, 09:52:12 pm
content: If you want to flash EEPROMs you can get one of the CH341A devices:https://www.aliexpress.com/item/32793476447.htmlBut yes, bluepill is useful for various thingshttps://www.eevblog.com/forum/microcontrollers/make-a-blackmagic-probe-out-of-a-stm32-bluepill/USB bootloader should not interfere, if its properly compiled for it.

author: phil from seattle
author_rank: Super Contributor
timestamp: August 07, 2020, 10:00:07 pm
content: One thing to consider about the Blue Pill is that there is no consistency. You might get one of several different processors or different pullup resistors on the USB lines. Unlike Arduinos which have a central authority that defines what it is, Blue Pills don't really have a reference design - at least one that everyone uses. It mostly works out ok for the hobbyists with maybe some amount of fussing. If you are doing it for yourself, that's one thing, but if you are making a product or a maker-type project you will write up, it's something else. That is one reason why I use Teensys for my products - pretty much a guaranteed thing.

author: thm_w
author_rank: Super Contributor
timestamp: August 07, 2020, 10:22:07 pm
content: If you want a consistent product then you purchase from a trusted vendor:https://robotdyn.com/stm32-arm-arduino-mini-system-dev-board-with-arduino-bootloader-stm32f103c8t6-64kb-not-soldered.htmlhttps://robotdyn.com/stm32f103-stm32-arm-mini-system-dev-board-stm-firmware-stm32f103c8t6-64kb-not-soldered.html

author: ozcar
author_rank: Frequent Contributor
timestamp: August 08, 2020, 12:01:48 am
content: Quote from: thm_w on August 07, 2020, 10:22:07 pmI have purchased a few "back pill" boards from Robotdyn, and as far as I can tell, the boards do have genuine STM32 processors.Whether you can trust everything they say, is a different question. They also sell "black pill" boards using APM32F103 chips that they claim are superior to STM32F103, in that they have FPU and can be clocked at a higher rate (96MHz rather than 72MHz).However, it seems that the specific APM32 chips used on the Robotdyn boards do not have FPU, and if they can run at 96MHz, it is more down to luck. This was brought to Robotdyn's attention some months ago, but their web site still makes claims about FPU and 96MHz.https://www.stm32duino.com/viewtopic.php?f=62&t=264&p=2727

author: cdev
author_rank: Super Contributor
timestamp: August 08, 2020, 12:27:08 am
content: Your idea seems valid to me for the idea you put forward, IMHO. It sounds a bit similar to the old? firmata concept with arduino. An Arduino can be used as a general purpose IO board for another computer that runs over USB. (with all the issues that brings) Maybe the Blue Pill can be used in Arduino firmata mode also, to do that.

author: NorthGuy
author_rank: Super Contributor
timestamp: August 08, 2020, 04:29:09 pm
content: Quote from: poorsam on August 07, 2020, 09:18:32 pmIs it possible for you to order on AliExpress? They're $5-7 in there.

author: cdev
author_rank: Super Contributor
timestamp: August 08, 2020, 06:13:59 pm
content: There is a version of the CH341 that has the same feature set and works with USB and its cheaper. Its fully supported by the Linux kernel and no drivers are even necessary. You can use it for bitbangging and programming other devices. It also of course can act as a USB-UART with switchable voltages. It can also speak SPI (which I have never used) and i2c which I have. It can also create new GPIOs for any Linux computer.Data sheet:https://github.com/boseji/CH341-Store/raw/master/CH341_EN.pdf

author: poorsam
author_rank: Newbie
timestamp: August 08, 2020, 06:58:38 pm
content: Quote from: NorthGuy on August 08, 2020, 04:29:09 pmUnfortunately no (no payment method and shipping for my country).Quote from: thm_w on August 07, 2020, 09:52:12 pmQuote from: cdev on August 08, 2020, 06:13:59 pmI already know about CH341A, It's more expensive and supports less interfaces than what STM32 can emulate (also it doesn't support bitbang or at least I don't know any software that can exploit it. Beside there were some uncertainties about it's output voltage).

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 08, 2020, 07:41:19 pm
content: I would recommend to buy at least 2 board. (and also 2 ST-Link V2 clones).In that case you can simply swap hardware in case of any doubt.ESD damage etc does occur, especially in hobby settings.I'm suspicious that it's not possible anymore to buy a "genuie" blue pill on Ali.In the last few years prices have dropped even further to around USD1.5 for these boards (It used to be above USD2). There are at least 8 different manufacturers of very similar chips, (which are a few dimes cheaper then the STM version), and the chinese tend to rub off the part numbering of these other manufacturers and laser on STM32F...The chips in themselves may be OK, but there are inconsistencies. For example I put a GRBL variant in one of the newer variants, and it does not seem to store settings in FLASH (emulated EEprom).More about the different variants in this thread:https://www.eevblog.com/forum/microcontrollers/cheap-bluepill-very-likely-it-has-fake-stm32-right/The robotdyn version is twice as expensive as the Ali clones, but if it has indeed a genuine STM chip on it, you probably have more success of a program written for this chip "just working" without tinkering or debugging.Well worth the extra small change.About USB to serial CDC...Just for fun I put github/sathosimn in one of my blue pills. It makes 3 serial ports available over USB

author: cdev
author_rank: Super Contributor
timestamp: August 08, 2020, 08:09:33 pm
content: The STLink v2 dongles are also BluePill compatible (kind of)

author: dmendesf
author_rank: Frequent Contributor
timestamp: August 09, 2020, 04:21:38 pm
content: Quote from: Doctorandus_P on August 08, 2020, 07:41:19 pmCan you point me this code? Tried searching for it in Google but only found trash about Satoshi Nakamoto...

author: poorsam
author_rank: Newbie
timestamp: August 10, 2020, 05:45:32 am
content: Quote from: dmendesf on August 09, 2020, 04:21:38 pmhttps://github.com/ivpri/mecrisp_pillserial

author: thm_w
author_rank: Super Contributor
timestamp: August 10, 2020, 11:09:40 pm
content: Quote from: poorsam on August 08, 2020, 06:58:38 pmIts *slightly* more expensive because it comes with a ZIF socket, and optional clip on probe, which makes connecting to an eeprom 100x easier than having to use jumper wires and then disconnecting them for your next project. If the few dollars is a huge issue, and you can use paypal in iran, PM me.The output voltage issue can be fixed:edit: RobotDyn claim to ship to Iran but I didn't check the price.

author: aheid
author_rank: Regular Contributor
timestamp: August 11, 2020, 08:10:14 am
content: RobotDyn also do their own PCB layouts which are usually quite good as far as I can tell. ADC performance for example was 11 effective bits vs 8 effective bits on the Blue Pills I have, purchased from different vendors at different times, using same exact setup and code.They also ship with proper protection. So for me worth the slightly higher price.Of course if you can't get them due to logistical restrictions that doesn't matter much... but maybe check their homepage store and not just AliExpress?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: August 11, 2020, 01:21:11 pm
content: I apologize for my laziness.https://github.com/satoshinm/pill_serialProbably a fork of the mecrisp one, or the other way around.

author: poorsam
author_rank: Newbie
timestamp: August 11, 2020, 03:23:13 pm
content: Quote from: thm_w on August 10, 2020, 11:09:40 pmOh, my real problem is I'm not going to flash eeproms frequently, I just want something handy for personal use. (And I don't want to desolder it from PCB).After all they don't ship to my country, they say no shipping method available. BTW thank you for your help offer.