This is a quick post about the *32F103 comparison. When talking about my comparison on IRC, I was asked if I could run the Blinky test from the Greaseweazle project. It looks like an interesting project I’ll need to check out in the future.
Looking at the description of that test, it’s gonna toggle PC13 every 500 ms. Well… on a Blue Pill, PC13 connects to a LED, however, on my board, PC13 is connected to the USB pull up resistor. As the blinky test does not use USB, this poses no problem as long as I do not use the USB connector to power the board. The Blinky test will output information on the serial interface (USART1).
The source code for the blinky test goes here
And the results:
STM32F103CBT6
** Blinky Test ** ** Keir Fraser** https://github.com/keirf/Greaseweazle Serial = ff32:0672:5434:3532:2556:5701 Flash Size = 128kB Device ID = 0x0000 Revision = 0x0000 Testing I2C1... OK Testing I2C2... OK Testing SPI1... OK Testing SPI2... OK Testing TIM1... OK Testing TIM2... OK Testing TIM3... OK Testing TIM4... OK DMA Test #1... OK DMA Test #2... OK DMA Test #3... OK DMA Test #4... OK Testing 64kB Flash... OK Enable TIM4 IRQ... .OK
The original part, of course, passes all tests.
As expected, due to erratum 2.3, we read Device ID/Revision as 0x0000.
Please be aware, right after programming it will say:
Device ID = 0x0410 Revision = 0x2003 **WARNING**: 10xx8/B device returned valid IDCODE! Fake?
Only when the microcontroller has been power cycled it will start showing zero. Pressing the reset button is not enough to trigger this errata. The power has to be completely removed.
GD32F103CBT6
** Blinky Test ** ** Keir Fraser** https://github.com/keirf/Greaseweazle Serial = 476f:3538:3535:0734:314d:3734 Flash Size = 128kB Device ID = 0x0410 Revision = 0x1303 **WARNING**: 10xx8/B device returned valid IDCODE! Fake? Testing I2C1... OK Testing I2C2... OK Testing SPI1... OK Testing SPI2... OK Testing TIM1... OK Testing TIM2... OK Testing TIM3... OK Testing TIM4... OK DMA Test #1... OK DMA Test #2... OK DMA Test #3... OK DMA Test #4... OK Testing 64kB Flash... OK Enable TIM4 IRQ... .OK Testing 20kB SRAM (endless loop)...
The GigeDevice part passes all tests. It does not suffer from ST’s errata 2.3, and shows it’s device id and revision. We see Revision 0x1303, which does not correspond with any ST revision codes, and is unique for GigaDevice.
CS32F103C8T6
** Blinky Test ** ** Keir Fraser** https://github.com/keirf/Greaseweazle Serial = 322e:0007:121f:4353:4a59:004e Flash Size = 64kB Device ID = 0x0410 Revision = 0x2003 **WARNING**: 10xx8/B device returned valid IDCODE! Fake? Testing I2C1... OK Testing I2C2... OK Testing SPI1... OK Testing SPI2... OK Testing TIM1... OK Testing TIM2... OK Testing TIM3... OK Testing TIM4... OK DMA Test #1... OK DMA Test #2... OK DMA Test #3... OK DMA Test #4... OK Testing 64kB Flash... OK Enable TIM4 IRQ... .OK Testing 20kB SRAM (endless loop)...
The CS32 passes all tests. It also mentioned on the blinky tests description page it would. Here we see the Device ID and Revision. Unlike the GigaDevice part, the Revision matches “Revision 1, 2, 3, X or Y” from ST.
APM32F103C8T6
** Blinky Test ** ** Keir Fraser** https://github.com/keirf/Greaseweazle Serial = 0057:0032:000c:5900:5739:4e4c Flash Size = 128kB Device ID = 0x0410 Revision = 0x2003 **WARNING**: 10xx8/B device returned valid IDCODE! Fake? Testing I2C1... OK Testing I2C2... OK Testing SPI1... OK Testing SPI2... OK Testing TIM1... OK Testing TIM2... OK Testing TIM3... OK Testing TIM4... OK DMA Test #1... OK DMA Test #2... OK DMA Test #3... OK DMA Test #4... OK Testing 64kB Flash... OK Enable TIM4 IRQ... .OK Testing 20kB SRAM (endless loop)...
Also the part from ApexMic passes all tests. Also this device has a Revision 0x2003, which matches “Revision 1, 2, 3, X or Y” from ST. Another thing to note, the reported flash size if 128 kB, while this is an C8 part. In a later test I’ll have to verify the amount of flash in this part, and also check the datasheet for the advertised amount.
Does anyone know what CPU that is?
** Blinky Test **
** Keir Fraser
** https://github.com/keirf/Greaseweazle
Serial = 7f65:0008:1310:5347:4c38:004e
Flash Size = 128kB
Device ID = 0x0410
Revision = 0x2003
**WARNING**: 10xx8/B device returned valid IDCODE! Fake?
Testing I2C1… OK
Testing I2C2… OK
Testing SPI1… OK
Testing SPI2… OK
Testing TIM1… OK
Testing TIM2… OK
Testing TIM3… OK
Testing TIM4… OK
DMA Test #1… OK
DMA Test #2… OK
DMA Test #3… OK
DMA Test #4… OK
Testing 64kB Flash… OK
Enable TIM4 IRQ… .OK
Testing 20kB SRAM (endless loop).
It is labeled as
STM32F
103C8T6
9910X RR93
MYS 99 908
STLogo
Regards,
Holm
Well… this analysis is not made by my tool, but by Greaseweazle’s tool. Let’s see, it uses the ID code, rather then the ROM table.
Assuming the debugger was not attached during the run, we see we can read the ID code. ( Please program and then power cycle it,
to make sure the debugger is detached, otherwise the following does not hold ) This means Errata 2.3 is not present, so
we can assume it is not an ST part.
Looking it says device ID 0x0410 / Revision 0x2003. All I can say from this, it’s not a GD32F103. It pretends to be the ST part.
But to tell more, I’d suggest to run my code that looks at the ROM TABLE, as that differs more between the variants out there.
Do you have any instructions how I can go about doing this, I am quite new to this, I have complied the `Blinky.bin` and did a `st-flash –reset –format binary write Blinky.bin 0x8000000` . But now I don’t know what’s next so that I can see output like you shown above?
First of all, this is not *my* tool. I was asked to run this tool by some folks. Thus I am not into the specifics for this. See https://github.com/keirf/Greaseweazle/wiki/STM32-Fakes for the details.
Anohow, to see the output, You’ve got to connect an TTL-UART (eg an USB serial port) to PA9/A10 and open it at 115200,8n1 (using for example PuTTY)