Various problems with bluepill, stlink and serial

Post here all questions related to LibMaple core if you can't find a relevant section!
anv
Posts: 5
Joined: Fri Apr 10, 2020 12:03 pm

Various problems with bluepill, stlink and serial

Post by anv »

I've got 3 bluepill boards. One of them works as expected: I place the boot0 jumper to 1 and I can upload via serial.The ASCIITable demo works ok.

But the other 2 boards that I bought can't be programmed via serial. I place the boot0 jumper in "1" position and the led keeps blinking with the factory blink program. I even short-circuited R3 (as I red somethere) but the led keeps blinking. One of the boards is STM32, the other is CKS32.

Both has the same problem: serial programming does not work, then, I programmed them with ST-LINK. All seems ok with this BUT, when I upload ASCIITable with st-link, nothing is output via the serial port. I checked it programming the good bluepill where ASCIITable worked OK when programmed via serial port and it fails if programmed with ST-Link.

I'm using linux and downloaded and compiled the lastest version of stlink from github.
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Various problems with bluepill, stlink and serial

Post by fredbox »

Every blue pill I've had came with the flash write protected. You will need to use a tool such as stm32flash.

Code: Select all

$ ./stm32flash -h
stm32flash Arduino_STM32_0.9
http://github.com/rogerclarkmelbourne/arduino_stm32
Usage: ./stm32flash [-bvngfhc] [-[rw] filename] [tty_device | i2c_device]
	-a bus_address	Bus address (e.g. for I2C port)
	-b rate		Baud rate (default 57600)
	-m mode		Serial port mode (default 8e1)
	-r filename	Read flash to file (or - stdout)
	-w filename	Write flash from file (or - stdout)
	-C		Compute CRC of flash content
	-u		Disable the flash write-protection
	-j		Enable the flash read-protection
	-k		Disable the flash read-protection
	-o		Erase only
...
Connect a serial adapter to PA9/PA10, set Boot0=1, and use the -u option to disable the write protection on the board.
anv
Posts: 5
Joined: Fri Apr 10, 2020 12:03 pm

Re: Various problems with bluepill, stlink and serial

Post by anv »

When I select BOOT0=1, the blink sketch continues working.

Code: Select all

$ ~/.arduino15/packages/stm32duino/tools/stm32tools/2020.3.13/linux/stm32flash/stm32flash -u /dev/ttyUSB0
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Interface serial_posix: 57600 8E1
Failed to init device.
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: Various problems with bluepill, stlink and serial

Post by fredbox »

When I select BOOT0=1, the blink sketch continues working.
With BOOT0=1, press reset. It should not be blinking. BOOT1 is next to the reset switch, BOOT0 is near B10 and B11.
anv
Posts: 5
Joined: Fri Apr 10, 2020 12:03 pm

Re: Various problems with bluepill, stlink and serial

Post by anv »

fredbox wrote: Sat Apr 11, 2020 3:02 pm
When I select BOOT0=1, the blink sketch continues working.
With BOOT0=1, press reset. It should not be blinking. BOOT1 is next to the reset switch, BOOT0 is near B10 and B11.
I dis this. This works OK with one of my 3 blue pills. The other 2 keeps blinking when I change boot0 (and reset). Check this: https://youtu.be/z-AR7Xl8pA0

I even checked the board to verify that it is connected to pin 44.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Various problems with bluepill, stlink and serial

Post by mrburnette »

anv wrote: Fri Apr 10, 2020 12:23 pm I've got 3 bluepill boards.
There is no quality assurance with bluepills. We have reports that some pills are dead-on-arrival and some have faux microcontrollers. These reports all seem to refer to the Chinese made/delivered boards. RobotDyn seems to offer a quality "blackboard" and other vendors may too.

If you are hung-up on the "blue-pill", you are going to need to validate several know good boards from a number of boards you ordered. But, even at $2 per board, you are going to spend $20 for 10 boards and know that a percentage will go to the trash. The Robotdyn board is $1.89 plus shipping. Do the math.

Point is, trying to develop with junk hardware is not good. When everything works, it works consistently across multiple, identical parts. I always test my build board (test) with my project board and a 3rd known good board. A test sketch compiled, uploaded, and tested. Then, the 3rd reserved board is held back for hardware failure identification (only.) This way, you software build and test on the 1st board, build the final project with the 2nd board. If something goes wrong, your known-good 3rd board can be used to discriminate between a hardware and software issue. Your next project just requires moving board 1 to board 2 (to get new flash into development), adding in a new 1st board, and testing against all 3 boards.


Ray
anv
Posts: 5
Joined: Fri Apr 10, 2020 12:03 pm

Re: Various problems with bluepill, stlink and serial

Post by anv »

mrburnette wrote: Tue Apr 14, 2020 2:56 am
anv wrote: Fri Apr 10, 2020 12:23 pm I've got 3 bluepill boards.
There is no quality assurance with bluepills. We have reports that some pills are dead-on-arrival and some have faux microcontrollers.
In this case, the chips seems to work but unly when programmed vea st-link but ignores boot0 jumper. It does not look like a production failure because 2 chips from different manufacturers presents exactly the same problem. All 3 of the boards where "cheap" ones.

Image
mrburnette wrote: Tue Apr 14, 2020 2:56 am Point is, trying to develop with junk hardware is not good.
My problem is that 66% of the boards I tested does not support boot0 for serial programming but 100% of them works OK with st-link. Then I should develop for the most common case. No problem with this.

But tere is a more important problem I've found: when I upload the software via ST-LINK, the serial port does not output any data through serial port (even in the one that worked ok with the same software but uploaded via serial). I was testing with the simple "ascii table" sample included with arduino ide.

It is: on a board fully working when I upload the software via serial port. If I use st-link, it fails on sending data through serial.

By the way... the only chip that seems to work ok has 128Kb flash. The other 2 are only 64Kb.
arpruss
Posts: 83
Joined: Sat Dec 21, 2019 10:06 pm

Re: Various problems with bluepill, stlink and serial

Post by arpruss »

mrburnette wrote: Tue Apr 14, 2020 2:56 am If you are hung-up on the "blue-pill", you are going to need to validate several know good boards from a number of boards you ordered. But, even at $2 per board, you are going to spend $20 for 10 boards and know that a percentage will go to the trash.
Depends on what you use them for and whether you can get a refund. I recently got three fakes, two of them C6s and one something else. The C6s were good enough for my projects--I only needed 32k flash--and the seller refunded me half of the price, so I actually saved money. And the "something else" seems to work well enough (apart from some timing issues I can work around).
The Robotdyn board is $1.89 plus shipping. Do the math.
Where can one find it at that price? The robotdyn.com store has it for $2.99.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Various problems with bluepill, stlink and serial

Post by mrburnette »

If you are using the Official core, serial is as discussed here:
https://github.com/stm32duino/wiki/wiki ... wareserial

If you are using Roger's (old LeafLabs core) then serial is discussed here: (API selection)
https://web.archive.org/web/20190316155 ... =Main_Page


You may wish to read this post as you may be affected:

viewtopic.php?f=7&t=127&p=1042&hilit=Counterfeit#p1042

Ray
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Various problems with bluepill, stlink and serial

Post by mrburnette »

arpruss wrote: Tue Apr 14, 2020 11:15 pm Where can one find it at that price? The robotdyn.com store has it for $2.99.

My bad... I did a search but did not drill-down. The $1.89 is the compatible uC
https://robotdyn.com/default/black-pill ... board.html

I need to order a few to test them...
Black Pill APM32F103 built on APM32F103Cx MCU is an advanced version of our popular STM32F103CxT6 boards.
It features a more advanced APM32F103Cx microcontroller IC with a higher frequency 96MHz (1.5DMIPS) and a built-in FPU. The FPU of APM32 is a coprocessor unit specially used for floating-point operation, which is attached to the AHB bus. It can efficiently handle complex floating-point operations, such as decoding algorithms for scanning guns, closed-loop control for motor, PID algorithm, fast Fourier transform, etc., which accelerates the processing capacity of the system.

The PinOut, memory mapping and Compiling environment SWD/JTAG is totally similar to STM32F103 Microcontroller, and you can use the same tools and applications for programming APM32.
I trust the above is properly licensed from STM (if required.)


Ray

Update:
I ordered 10x for $22 USD shipped to USA. So, the per price is $2.20 without any discounts.
For the curious, Robotdyn has the schematic, layout, etc. on their product page.
Post Reply

Return to “General discussion”