.. index:: stm32f1 usb, usb, blue pill: usb, olimex p103: usb .. _stm32f1-usb: STM32F1 USB =========== A special **USB** Blue Pill Image that can be used to test if the USB on your board is working. It can also read the MCU internal 'Device Electronic Signature'. Runs in a 64KB Flash STM32F103. This uses the Mecrisp-Stellaris USB driver for STM32F103 by Jean-Claude Wippler which is based on the Coreforth USB driver by Eckhart Köppen. .. note:: From Viktor Dvořák. USB needs PC side idVendor = 0x0483 idProduct = 0x7540 driver which is STM32 Virtual COM port driver desribed in en.DM00478229.pdf. The driver is en.stsw-stm32102.zip (24755 kB) is available directly from st.com Use it to check for *FAKE STM32F103 MCU's* and let me know if it is useful ? .. note:: if you don't have a :ref:`Blue Pill`, read my :ref:`rant` before thinking about buying one ? .. image:: projects/f1-usb/stm32f1-usb-terminal.jpg .. literalinclude:: projects/f1-usb/1882bdaff62f637a7bdd517d14f4c1a4.README.txt Download -------- Image tarball here: https://sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/mecrisp-stellaris-1882bdaff62f637a7bdd517d14f4c1a4.tar.gz/download .. note:: all software on this site is released under the GPL V2 or BSD V3 licenses. STM32ID ------- This program is based on the STM32F0 technical documentation because the STM32F1xx technical doc doesn't give the format of the actual "device electronic Unique ID register" and many assume that the format is the same as the STM32F0. I'm leaning towards the theory that they're slightly different by way of the "lot numbers" because the none of the ASCII data for the F1 chips looks sensible to me so far. Perhaps they are "lot numbers" but just sequential decimal numbers without character based information ? The "die" and 'wafer number" data seems reasonable in all cases. However in the F051 signature below, the ASCII lot number layout seems reasonable ? I'll add to this when I get another F051 board set up to read. NON STM32F103 MCU's For Comparison ---------------------------------- STM32F051 ^^^^^^^^^ :: Die xy coords: 2752589 Wafer Number: 14 Lot_num ascii encoded [23:0]: 0x00413657 | A 6 W Lot_num ascii encoded [55:24]: 0x20323336 | 2 3 6 STM32L073 ^^^^^^^^^ :: Die xy coords: 21444402 Wafer Number: 48 Lot_num ascii encoded [23:0]: 0x00343837 | 4 8 7 Lot_num ascii encoded [55:24]: 0x00000011 | . . . . .. _stm32f103-tests: STM32F103 or Clone Results -------------------------- 1882bdaff62f637a7bdd517d14f4c1a4.bin User Results ------------------------------------------------- This is the chip/board I developed my 1882bdaff62f637a7bdd517d14f4c1a4.bin image on. It's in a $9 :ref:`Shenzhen LC Technology` board with 64KB Flash. .. image:: pics/Shenzhen-LC-mini-STM32F103-board.jpg I bought 12 of these boards around 2014, one was dead out of the box, no option jumpers etc and one died while being flashed. STM32F103C8T6 #1 ^^^^^^^^^^^^^^^^ :: Die xy coords: 108068691 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00555071 | U P q Lot_num ascii encoded [55:24]: 0x87011723 | . . . # STM32F103C8T6 #2 ^^^^^^^^^^^^^^^^ :: Die xy coords: 108068688 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00555071 | U P q Lot_num ascii encoded [55:24]: 0x87083408 | . . 4 . .. note:: #1 is very close to this one, same silicon wafer only 3 positions away! STM32F103C8T6 #3 ^^^^^^^^^^^^^^^^ :: Die xy coords: 108003144 Wafer Number: 73 Lot_num ascii encoded [23:0]: 0x00515389 | Q S . Lot_num ascii encoded [55:24]: 0x87084441 | . . D A STM32F103C8T6 #4 ^^^^^^^^^^^^^^^^ :: Die xy coords: 107675464 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00485366 | H S f Lot_num ascii encoded [55:24]: 0x87244413 | . $ D . STM32F103C8T6 #5 ^^^^^^^^^^^^^^^^ :: Die xy coords: 107872073 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00565467 | V T g Lot_num ascii encoded [55:24]: 0x87014725 | . . G % STM32F103C8T6 #6 ^^^^^^^^^^^^^^^^ :: Die xy coords: 108003159 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00565666 | V V f Lot_num ascii encoded [55:24]: 0x87014633 | . . F 3 STM32F103C8T6 #7 ^^^^^^^^^^^^^^^^ :: Die xy coords: 107872086 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00575566 | W U f Lot_num ascii encoded [55:24]: 0x87092524 | . . % $ STM32F103C8T6 #8 ^^^^^^^^^^^^^^^^ :: Die xy coords: 107741015 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00545171 | T Q q Lot_num ascii encoded [55:24]: 0x87231927 | . # . ' STM32F103C8T6 #9 ^^^^^^^^^^^^^^^^ :: Die xy coords: 108396369 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00574867 | W H g Lot_num ascii encoded [55:24]: 0x87142756 | . . ' V STM32F103C8T6 #10 ^^^^^^^^^^^^^^^^^ :: Die xy coords: 108003154 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00545267 | T R g Lot_num ascii encoded [55:24]: 0x87195634 | . . V 4 STm32F103RBT6 ^^^^^^^^^^^^^ Olimex P103 #1 .. image:: projects/f103-lmt01/STM32-P103-01.jpg :: Die xy coords: 108068919 Wafer Number: 48 Lot_num ascii encoded [23:0]: 0x00353650 | 5 6 P Lot_num ascii encoded [55:24]: 0x43105156 | C . Q V FLASH.. TOTAL REPORTED: 131072 USED: 101376 FREE: 29696 Olimex P103 #2 :: Die xy coords: 107741012 Wafer Number: 72 Lot_num ascii encoded [23:0]: 0x00555285 | U R . Lot_num ascii encoded [55:24]: 0x87237267 | . # r g FLASH.. TOTAL REPORTED: 131072 USED: 103628 FREE: 27444 STM32F103ZET ^^^^^^^^^^^^ 144pinner with 512kB flash and 64kB ram :: stm32id Die xy coords: 97779505 Wafer Number: 78 Lot_num ascii encoded [23:0]: 0x00383341 | 8 3 A Lot_num ascii encoded [55:24]: 0x51137004 | Q . p . free FLASH.. TOTAL REPORTED: 524288 USED: 51200 FREE: 473088 BPill N1 ^^^^^^^^ (it has got 128kB). :: stm32id Die xy coords: 107806536 Wafer Number: 113 Lot_num ascii encoded [23:0]: 0x00564989 | V I . Lot_num ascii encoded [55:24]: 0x67255444 | g % T D free FLASH.. TOTAL REPORTED: 65536 USED: 51200 FREE: 14336 BPill N2 ^^^^^^^^ (it has got 128kB). :: stm32id Die xy coords: 107741009 Wafer Number: 117 Lot_num ascii encoded [23:0]: 0x00535783 | S W . Lot_num ascii encoded [55:24]: 0x81174113 | . . A . free FLASH.. TOTAL REPORTED: 65536 USED: 51200 FREE: 14336 Bluepill ^^^^^^^^ marked as STM32F103C8T6 :: Die xy coords: 108068690 Wafer Number: 114 Lot_num ascii encoded [23:0]: 0x00525366 | R S f Lot_num ascii encoded [55:24]: 0x67145016 | g . P . FLASH.. TOTAL REPORTED: 65536 USED: 51200 FREE: 14336 GD32F103C8T6 ^^^^^^^^^^^^ In private board, not a Blue Pill. ( **Device descriptor request failed** :: GD32F103-supplied-data Flash Bytes: 65536 [31:00] $3439CB2E | 4 9 . . | <--Hex char detected [63:32] $0F383438 | . 8 4 8 | <--Hex char detected [95:64] $38393733 | 8 9 7 3 | GD32F103 Data $1FFFF7E0 = $00140040 $1FFFF7E8 = $3439CB2E $1FFFF7EC = $0F383438 $1FFFF7F0 = $38393733 Good Bluepill #1 ^^^^^^^^^^^^^^^^ Same marking as #2 below "991KA 93 MYS 903" but 1/2 the flash reported. :: Die xy coords: 107806545 Wafer Number: 80 Lot_num ascii encoded [23:0]: 0x00525680 | R V . Lot_num ascii encoded [55:24]: 0x87192455 | . . $ U FLASH.. TOTAL REPORTED: 65536 USED: 65536 FREE: 0 Good bluepill #2 ^^^^^^^^^^^^^^^^ "991KA 93 MYS 903" :: Die xy coords: 108068680 Wafer Number: 113 Lot_num ascii encoded [23:0]: 0x00565366 | V S f Lot_num ascii encoded [55:24]: 0x67133045 | g . 0 E FLASH.. TOTAL REPORTED: 131072 USED: 51200 FREE: 79872 POS Bluepill ^^^^^^^^^^^^ Requires reconfiguring GDB, does not work with Windows STM debug at all. :: Die xy coords: 74414100 Wafer Number: 47 Lot_num ascii encoded [23:0]: 0x000E0014 | . . . Lot_num ascii encoded [55:24]: 0x170707E2 | . . . . FLASH FREE: 0 .. note:: the total lack of Ascii data is telling and the FLASH FREE = 0 is calculated so something is seriously different. CKS32F103C8T6 ^^^^^^^^^^^^^ Chinese clone :: Die xy coords: 16985099 Wafer Number: 42 Lot_num ascii encoded [23:0]: 0x004D3512 | M 5 . Lot_num ascii encoded [55:24]: 0x004E4B31 | . N K 1 Free FLASH.. TOTAL REPORTED: 131072 USED: 51200 FREE: 79872 .. note:: The Chinese CKS32F103C8T6 isn't using ASCII for the lot numbers, but hexadecimal and they're identical to 276745 below. CKS32F103C8T6 ^^^^^^^^^^^^^ Chinese clone :: Die xy coords: 276745 Wafer Number: 42 Lot_num ascii encoded [23:0]: 0x004D3512 | M 5 . Lot_num ascii encoded [55:24]: 0x004E4B31 | . N K 1 FLASH.. TOTAL REPORTED: 131072 USED: 51200 FREE: 79872 STM32F103C8T6 ^^^^^^^^^^^^^ :: Die xy coords: 107741012 Wafer Number: 72 Lot_num ascii encoded [23:0]: 0x00565283 | V R . Lot_num ascii encoded [55:24]: 0x87242040 | . $ @ FLASH.. TOTAL REPORTED: 65536 USED: 51200 FREE: 14336 Bluepill ^^^^^^^^ :: Die xy coords: 107741008 Wafer Number: 73 Lot_num ascii encoded [23:0]: 0x00485572 | H U r Lot_num ascii encoded [55:24]: 0x87243926 | . $ 9 & Bluepill ^^^^^^^^ :: Die xy coords: 108265297 Wafer Number: 72 Lot_num ascii encoded [23:0]: 0x00515782 | Q W . Lot_num ascii encoded [55:24]: 0x87061344 | . . . D Bluepill ^^^^^^^^ :: Die xy coords: 108068681 Wafer Number: 73 Lot_num ascii encoded [23:0]: 0x00545682 | T V . Lot_num ascii encoded [55:24]: 0x87055015 | . . P . Bluepill ^^^^^^^^^ This one didn't want to program with st-flash as in the supplied script. Programs fine with openocd :: Die xy coords: 108134227 Wafer Number: 113 Lot_num ascii encoded [23:0]: 0x00544872 | T H r Lot_num ascii encoded [55:24]: 0x67041446 | g . . F Bluepill ^^^^^^^^ :: Die xy coords: 108003154 Wafer Number: 72 Lot_num ascii encoded [23:0]: 0x00565388 | V S . Lot_num ascii encoded [55:24]: 0x87093153 STM32F103CBT6 ^^^^^^^^^^^^^ :: Die xy coords: 108199730 Wafer Number: 52 Lot_num ascii encoded [23:0]: 0x00353254 | 5 2 T Lot_num ascii encoded [55:24]: 0x57012556 | W . % V