Cheap Bluepill, very likely it has fake STM32 right ? - Page 1
Forum section: electronics / general

author: BravoV
author_rank: Super Contributor
timestamp: January 12, 2020, 09:22:10 am
content: EDIT : Update, Noopy took close up photo shoots at this chip and the one at ST-Link V2 clone, at post#134I was given by a friend, two Bluepill boards, he said it was cheap about 2 bucks each.Judging at the price, its a fake STM32 right ?PS : Also watch the supposed to be "RESET" label.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: January 12, 2020, 10:33:35 am
content: The ST-Link utilitycan query the chip. Check what it says.The cheap Blue Pills used to be genuine until someone started remarking STM32s that have half the RAM/flash, and whatever other substitutions they might be performing these days. There's probably overlap in the prices between real and fake.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 12, 2020, 12:55:25 pm
content: Quote from: BravoV on January 12, 2020, 09:22:10 amIt may not be fake, I suspect many are genuine .... genuine recycled e-waste, but if it works, who cares ?Kinda like a genuine Fake Gucci Handbag, only insist on the best !You are welcome to download my bootable usb binary that will enable you to obtain the ID and test to see if it has a HIDDEN extra 64kB of Flash (128kB total).https://mecrisp-stellaris-folkdoc.sourceforge.io/stm32f103c8-diags.htmlfor the details and a binary under 64kB so that ST-Link will flash it.

author: BravoV
author_rank: Super Contributor
timestamp: January 12, 2020, 01:05:46 pm
content: Thanks for the replies guys.A STM32 noob here, infact those are the 1st STM32 in the houseNoob question, can I use that ST-LINK to upload firmware thru the USB ?I use Win7 x64 btw.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: January 12, 2020, 01:16:56 pm
content: I have been trying to get some Blue Pills with the CS32 chip on it, but I actually got the real thing. Furthermore they even had the correct value for R10 mounted.To tell the difference, connect to them using a JTAG probe (not SWD) and scan the bus.An ST part will sayInfo : JTAG tap: auto0.tap tap/device found: 0x3ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x3)Info : JTAG tap: auto1.tap tap/device found: 0x16410041 (mfg: 0x020 (STMicroelectronics), part: 0x6410, ver: 0x1)An CSK part will sayInfo : JTAG tap: auto0.tap tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)Info : JTAG tap: auto1.tap tap/device found: 0x16410041 (mfg: 0x020 (STMicroelectronics), part: 0x6410, ver: 0x1)But about US$ 2 seems to be the price these boards go by these days. Also keep in mind the cheaper offers often have a shipping fee, while the slightly more expensive ones offer free shipping.When I order STM32F103C8T6 at LCSC.com, in large quantities the price drops to about US$ 1, so when these are mass produced, it sounds possible to use the real thing.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: January 12, 2020, 09:48:58 pm
content: Quote from: BravoV on January 12, 2020, 01:05:46 pmIf the Blue Pill has the STM32duino bootloader on it, you can program it through the USB directly from Windows. Otherwise, you connect the ST-Link to that 90° programming header on the opposite end of the board.At the ultra-low price point, it's quite likely the chip hasn't had the bootloader flashed on.

author: BravoV
author_rank: Super Contributor
timestamp: January 13, 2020, 02:15:27 am
content: Ordered ST-Link Mini V2 Programmer.

author: skoehler
author_rank: Contributor
timestamp: January 13, 2020, 02:56:42 am
content: I have that exact model, but with RESET spelled correctly.What has happened in the past is that they use the STMF103C8 instead of the STMF103CB in cheap ST Link clones. The thing is, that the C8 has half the flash compared to the CB. The proper ST Link on Nucleo boards uses a CB chip with 128KB flash. But without much effort, double the whole 128KB can be used, even if the chip is labeled C8. The flash seems to work just fine in many many cases. Background is, that ST probably produces only one chip.Yours is a F103C8 to begin with. I don't think that there's any false advertising going on. Check what the ST Link utility knows about the chip.As far as I know, there are no fake ST chips. The Chinese simply use cheaper chips with half the flash. They don't even bother relabeling them.

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: January 13, 2020, 03:17:01 am
content: Quote from: skoehler on January 13, 2020, 02:56:42 amSadly, that is not correct. The counterfeitersdouse chips with half the flash ... half being32 KiB(and 10 KiB RAM). Basically STM32F103C6remarked as STM32F103C8. This is well documented on the forums.I have a few from TaoBao.https://embeddedtronicsblog.wordpress.com/2018/12/29/fake-stm32-blue-pill-boards/

author: amyk
author_rank: Super Contributor
timestamp: January 13, 2020, 03:19:07 am
content: Quote from: skoehler on January 13, 2020, 02:56:42 amThe digit 8 vs the letter B ? That's a horrible choice of part naming...

author: BravoV
author_rank: Super Contributor
timestamp: January 13, 2020, 03:21:36 am
content: What interesting in the label is :At mine, the "F" character is on the 1st line right after the STM32STM32F103C8T6While others from internet, most are the "F" are placed at 2nd line :STM32F103C8T6

author: thm_w
author_rank: Super Contributor
timestamp: January 13, 2020, 10:32:10 pm
content: Quote from: GromBeestje on January 12, 2020, 01:16:56 pmThere are some on alix where the pictures show CS32 chip, and the reviewers show the same, where I can see the IC:https://www.aliexpress.com/item/32525208361.htmlBut who knows what will show up..QuoteI agree, I haven't seen any evidence that if you get a chip that *has the right chip ID* ie has 128kB of flash, that it is counterfeit. So its easy enough for us here to test, although some other people might be fooled if it came with a GD or CS32 and never used >64kB.

author: BravoV
author_rank: Super Contributor
timestamp: January 14, 2020, 11:44:22 am
content: Ok, connected & fired up ST-Link, attached below the result.So its genuine ?Also tested using techman-001's STM32F103C8 Diagnostics, it has 128KB flash, result ->HERE

author: techman-001
author_rank: Frequent Contributor
timestamp: January 14, 2020, 01:22:23 pm
content: Quote from: BravoV on January 14, 2020, 11:44:22 amIt's genuine all right. I replied to your link above with details.It's a genuine CKS32F103C8T6, which is a Chinese Clone of the STM32F103CB as I understand it.The clue to it being a CKS32F103C8T6 is that the "lot numbers' are in hexadecimal, unlike genuine STM32F103Cx's.

author: BravoV
author_rank: Super Contributor
timestamp: January 14, 2020, 03:10:19 pm
content: Quote from: techman-001 on January 14, 2020, 01:22:23 pmLOL , yeah right.And you know whats funny ?The new cheap ST-Link 2 I bought just to program this BluePill, opened it up, lo & behold, a genuine CKS.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 15, 2020, 12:40:05 am
content: Quote from: BravoV on January 14, 2020, 03:10:19 pmExcellent pictures! I guess this is proof that this "STM32F103C8T6" is in fact fake, being a relabeled CKS32F103C8T6. Your testing this chip with my "STM32F103C8 Diagnostics" binary also proved it has a fully working second 64kB Flash, giving 128kB as indicated by the chips "Flash Size Register"A genuine STM32F103C8T6 will always indicate it has only 64kB flash in the chips "Flash Size Register", even if it has 128kB of flash. This means programs like your ST-Link will show it as only having 64kB Flash and will refuse to flash the second "hidden" 64kB block unless the ST-Link configuration is modified.Now the STM32F103CBT6 and the CKS32F103C8T6 are not identical with the CKS throwing up a USB ID error such as :"Warn : UNEXPECTED idcode: 0x2ba01477 Error: expected 1 of 1: 0x1ba01477" on GDB etc and requiring config file changes before it will work.see:https://www.eevblog.com/forum/microcontrollers/issue-with-chinese-blue-pill-cks32f103c8t6/msg2767816/#msg2767816Interesting information about the cheap ST-Link 2, I wonder if just runs the STM ST-Link 2 binary ?Note that your Windows STM32 ST-LINK Utility picture in one of your previous posts in this thread reports this chip as a "STM32F10xx Medium-density", meaning it can't tell that the chip is in fact a CKS32F103C8T6.My free "STM32F103C8 Diagnostics" binary allows a deeper investigation and conclusion of whats in a Blue Pill, especially with feedback like yoursThe Blue Pill story is certainly one of intrigue, of secret deals in low places and the sophistication of the Chinese "fake" industry. I wonder if someone will write a book about it one day ?

author: BravoV
author_rank: Super Contributor
timestamp: January 15, 2020, 02:45:21 am
content: Quote from: techman-001 on January 15, 2020, 12:40:05 amThanks, I guess its now beyond doubt that my Bluepill boards have the CKS32F103C8T6 isn't it ?Regarding the laser marking on the chip, it looks pretty convincing, at least to me, also remember the "F" character position, its just weird compared to many that I've seen on the net.Quote from: techman-001 on January 15, 2020, 12:40:05 amSorry, just tried to install a freshly downloaded STM32CubeIDE 1.2.0 Windows, it gives me error during the installation, and I have no interest to pursue further.Quote from: techman-001 on January 15, 2020, 12:40:05 amWhat do you mean by that ? See the attached below, screen shots of the ST-Link Utility when upgrading the dongle firmware, its the latest that I downloaded few days ago.This cheap ST-Link V2 dongle can be upgraded just fine, no problem what so ever. I assume the latest ST-Link firmware was downloaded straight from ST's host by the program.Quote from: techman-001 on January 15, 2020, 12:40:05 amInfact, its your fault.I have zero experience in STM32, when visiting, I briefly brought up your discovery with my friend, and then he suddenly gave me this two boards, then here I am now.Quote from: techman-001 on January 15, 2020, 12:40:05 amI guess this will be drowned into the abyss and forgotten by time.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 15, 2020, 04:24:54 am
content: Quote from: BravoV on January 15, 2020, 02:45:21 amBeyond doubt ? only until some logical poster with contrary proof comes alongPersonally I think your chip is a CKS32F103C8T6 based on the following.1) STM32F103C8 chips *always* give their flash size as 64kB, NEVER 128kB like yours2) The LOT numbers are hexadecimal on your chip, STM only use decimal LOT numbers.3) The Die number is very close to a known CKS32F103C8T6 data in my collection.We could do with a correctly positioned, clear pic of that chips marking for future reference, if you have the time. The pic you have supplied is pretty good tho and serves as a example of what fake markings look like in this case.Regarding ST-Link V2, what I meant was that it would seem that the STM ST-Link V2 binary doesn't check for fake chips, perhaps they have no way of telling, don't care or haven't got around to it yet ?Any self respecting manufacturer would block updates to fake chips with a big fat "FAKE DETECTED" and just stop the update. Note: (just in case STM are reading here), they wouldNOTtry and BRICK the chip like FTTDI stupidly did years ago when they discovered Chinese clones of their chips. They have been universally reviled for that ever since, with a suspected massive loss of market share to their competition.You have no interest installing STM32CubeIDE 1.2.0 for Windows ? ... well neither do I, being a Forth userHowever, those boards are in fact pretty useful and the chips are quite fast, running at 72MHz as they do, have tons of peripherals and even USB.They aren't recycled STM32's they're brand new fake STM32's on boards costing under $2!What's not to love apart from the ugly, ugly STM32F10x GPIO register design ?Code:gpioa.GPIOA_CRL (read-write) $44444AA83|3|2|2|2|2|2|2|2|2|2|2|1|1|1|1|1|1|1|1|1|1|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|00 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 0 0GPIOA_CRH (read-write) $888544443|3|2|2|2|2|2|2|2|2|2|2|1|1|1|1|1|1|1|1|1|1|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|0|9|8|7|6|5|4|3|2|1|01 0 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0

author: iMo
author_rank: Super Contributor
timestamp: January 15, 2020, 09:49:32 pm
content: Quote from: techman-001 on January 15, 2020, 12:40:05 amThe BluePills with a genuine STM32F103C8T6 are on the market since ~2014. All have got 128kB of flash and the stlink can program entire 128kB straight - at least I've never heard about an issue with it.After the genuine BPills the GD32F103 BPills came. GD is not a clone of STM32 - it is a different chip. GD32 BPills came in fall 2015.Recently the new CKS32 BPills appear. It could be those CKS are rebranded GD32.

author: BravoV
author_rank: Super Contributor
timestamp: January 16, 2020, 03:45:30 am
content: Quote from: imo on January 15, 2020, 09:49:32 pmWhat are the differences ? Mainly.But its stillpretendingemulating as STM32 right ?

author: langwadt
author_rank: Super Contributor
timestamp: January 16, 2020, 03:57:10 am
content: Quote from: BravoV on January 16, 2020, 03:45:30 amAMD is emulating Intel ?

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: January 16, 2020, 04:05:45 am
content: For starters,it won't overclock as high: 80 MHz versus 128 MHz for a genuine STM32.There are presumably other differences.They were discussed on the STM32duino forum, but I'm not sure how much of that was archived.

author: BravoV
author_rank: Super Contributor
timestamp: January 16, 2020, 05:02:45 am
content: Thanks, beside they're given free, even I bought them my self, at that price level, I have nothing to complain.Regarding the STM32 clones, as they had been for a while in many years, I guess they're also keep perfecting it, at least its comparable by STM32 official's specification, aren't they ?

author: techman-001
author_rank: Frequent Contributor
timestamp: January 16, 2020, 07:20:41 am
content: Quote from: BravoV on January 16, 2020, 05:02:45 amExcellent question, who really knows where the compatibility begins and ends ?One indicator that the CKS32F103C8T6 must be compatible with the STM32F10x is your Chinese SWD programmer, which runs the official STM ST-Link V2 firmware. That means the USB and GPIO peripherals must be compatible at a minimum.For a hobbyist however, is the cheap price of $2 for a clone worth the possible months and years they may spend working thru development problems that later resolve to a incompatibility issue ?My very first STM32F103CB board was a Olimex P103, it cost about $50 but pins are gold plated, the chip is a brand new genuine STM32F103CB with 128kB. The board has a prototype area, rs232 and CAN connector etc. It's a really nice board.https://mecrisp-stellaris-folkdoc.sourceforge.io/stm32-boards.html?highlight=p103#olimex-p103-boardOk, It was $48 more than a Blue Pill, but I've never had any issues or doubts about it over the last 7 years.What is peace of mind worth when developing ? As if the STM32F103 isn't complex enough without worrying about clone issues being the source of your problems ?And let's not forget that the *genuine* STM32F10x had enough bugs and errata all by itself to cause plenty of sleepless nights for developers ?You got your Blue Pills for free, and that's definitely the right price. If you need a 'cat feeder', an 'ice sculpture light controller' or anything that's already developed and has a 'library' that works, I say use them.On the other hand if you want to make something new and original, but it must be cheap, it may be worth checking out Chinese home grown boards such as the 'longan nano' with a RISC-V chip. They're new and exciting, and cheaphttps://mecrisp-stellaris-folkdoc.sourceforge.io/gd32vf103.html

author: techman-001
author_rank: Frequent Contributor
timestamp: January 16, 2020, 09:12:03 am
content: Quote from: imo on January 15, 2020, 09:49:32 pmThe official STM datasheet shows that the STM32F103C8has64kB of Flashas you can see below. Can you point to another official STM document which states otherwise ?The fact that my 10 tested STM32F103C8's had a second hidden 64kB block doesn't alter the STM spec above because any flashing software must check the MCU internal "flash-size-register" first, will read that the STM32F103C8has only 64kB and ignore that second block, it doesn't have any other choice.Reading the MCU "flash-size-register" first is essential for a few reasons one of which is the MCU will throw anexceptionif a program attempts to do anything to Flash that's not actually there.My St-Link would program any size image up to 64kB on the STM32F103C8. If the Image was 100kB, it stopped at 64kB and threw an error as expected.St-Link reads the MCU "flash-size-register" and acts accordingly as it must.On My Olimex-P103 which has a STM32F103CBwith 128kB as shown in the Factory Datasheet above, St-Link would program a 100kB image without complaint because the MCU "flash-size-register" indicates the chip has 128kB of Flash.This is how it works, it's how it's designed and my "STM32F103C8 Diagnostics" bootable binary (under 64kB) will run on any STM32F103 and actually read what's in the MCU "flash-size-register".https://mecrisp-stellaris-folkdoc.sourceforge.io/stm32f103c8-diags.html

author: Rasz
author_rank: Super Contributor
timestamp: January 16, 2020, 10:32:56 pm
content: St-Link will flash full 128KB no problem, just use something other than ST GUI program, like openocd with custom confighttps://web.archive.org/web/20190327110931/http://wiki.stm32duino.com/index.php?title=Blue_Pill#128_KB_flash_on_C8_version

author: skoehler
author_rank: Contributor
timestamp: January 17, 2020, 02:32:41 am
content: Quote from: I wanted a rude username on January 13, 2020, 03:17:01 amFortunately, the blue pills that I ordered from china also have device ID 0x410 (medium density, 64kb flash). I just tested them with ST-Link utility.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 17, 2020, 08:49:56 am
content: Quote from: imo on January 15, 2020, 09:49:32 pmYou raise some interesting points ...Fromhttps://smdprutser.nl/blog/stm32f103-vs-gd32f103/----------------------------------------------------------------------------------The GD32F103C8, manufactured by Gigadevice, has similar specifications and thus many people think the chip is a cloned version of the STM32 part. The chip appears to be the same from a programmers point of view as almost all registers and peripherals are the same. Major differences are the execution speed and flash size. The chip is capable of running a much higher clock frequency (108MHz) and have less wait states for flashrom then the ST counterpart. The size of the flash memory goes up to 3076KB, compared to the 1024KB ST offers.The differences can be explained by the decapping pictures (done by Zeptobars). The chip appears to consist of two dies: one microcontroller die and a separate flash die. They seem to use just one large single design and a varying size flash chip to serve the whole GD32F103 range. On the controller die there is 128KB SRAM caching the flashrom. This explains the 0 wait states for flash access. This is a similar way the ESP8266 runs (albeit the flash is user replaceable). Not very surprising as Gigadevice is a big Chinese flash company. Some tweaks to silicon will allow a higher clockspeed (108MHz) and some people report it being 50% faster then the ST part.Sounds to good to be true! Not very much is found on the internet about this chip, except some people report that not everything is working exactly the same as the STM32------------------------------------------------------------------------------------I have the GD32F103C8 datasheet, that's easy to find.Butno SVD anywhere, does anyone have a GD32F103.SVD or a link ? (to do comparisons of peripherals, registers and bitfields with the STM32F103).Re CKS32F103C8T6:I can't find any info on the CKS32F103C8T6 anywhere on the net, and even "CKS" doesn't list this chip in their products section.http://www.cksic.com/en/about/217.html"China Key System Co., Ltd. (CKS) is a Chinesetechnology company headquartered in Wuxi, Jiangsu province, that designs,develops and manufactures very-large-scale integrated circuits. It was founded in 2008."Perhaps the "CKS32F103C8T6" is a re-branded "GD32F103C8" as you say ?

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 09:27:18 am
content: GD32F - it has been discussed many times here, afaik. The GD32F is a flashless chip - no flash memory on the cortex chip.It has got a sram instead of the flash. Upon reset it moves the stored binary from an external 8pin SPI flash (glued on the top of the cortex chip inside the package) to its internal sram and it executes your program off that sram. Therefore it is faster than the stm32 - no flash wait states.During programming the flash of the GD32 the program gets stored into that external SPI flash.PS: flash wait states - the problem with Flash memories is they are slow. The max read speed is something like 30MHz. That is a big problem with modern fast mcu devices (80-600MHz clock). Therefore you have to add several "wait states" while reading from the flash. And you read from the program flash all the time as your code is executed.STM added in >F4 so called ART accelerator - a mechanism to eliminate the negative effect of the slow flash - a 128bit buffering of the flash data - it helps a bit, but still it is not "zero wait states".The elegant variant is a flash less chip - the sram memories a fully compatible with other logic on the chip, thus no wait states are needed and you read program in a single clock.

author: BravoV
author_rank: Super Contributor
timestamp: January 17, 2020, 10:00:00 am
content: Quote from: imo on January 17, 2020, 09:27:18 amIs there any way to sort of detect if its GD32F vs genuine STM32 by benchmark code maybe ? Especially on the SRAM vs internal flash ?

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 10:04:58 am
content: See PS: in my above post.You may benchmark it easily by running a code in a loop at a clock where the stm32 requires wait states - ie at 72MHz stm32F103 in BluePill needs 2 or 3 ws to be inserted.The exec time of a loop with GD32 (at the same clock freq) should be much shorter than with the same code in stm32F103 at clocks > 24MHz.StmF4xx and higher added the flash ART accelerator - so the exec time difference will be smaller.You may identify the flashless mcu also by measuring the time it needs till the first instruction after the hw reset - ie GD32 needs some XX msecs after reset because it moves the xxx kB data from the external SPI flash into its sram.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: January 17, 2020, 10:17:14 am
content: So, the "fake" is better than the original?

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 10:22:04 am
content: QuoteGD is not a fake. It is a different CM3 MCU, binary and peripherally "compatible" with STM.The GDs are indeed better in "speed" against STM (ie the cheapo GD32F oscilloscope project user atadarov posts here currently).Of course the binary "compatibility" is still the question here, and the dead time after the hw reset is much longer with GD (no problem in most apps). Also modification of the flash content (if even possible) on "the fly" would be much slower with GD, imho.

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 10:45:23 am
content: You may write a short loop in asm toggling a pin, for example, and watch the period with an oscope.Run STM32f103, GD32f103 and CSK32F103 at for example 128MHz clock, the HAL should set the required number of flash waitstates, something like 4ws with STM32f103 (0ws for 0..24MHz, +1ws for each 24MHz), and 0ws with GD for any clock.PS: you may set manually the number of flash ws in the STM32 lower than required by HAL - called "overclocking"I did in past with stm32F100 and 103/407.0ws with F100 (max 48MHz) and 0+1ws/48MHz with F103 worked somehow as I can remember..

author: BravoV
author_rank: Super Contributor
timestamp: January 17, 2020, 11:25:02 am
content: Well, my Bluepill boards are all yours guys, should you want to experiment with it with your codes, sorry, as I mentioned, zero STM32 experience here.

author: up8051
author_rank: Frequent Contributor
timestamp: January 17, 2020, 12:36:52 pm
content: Maybe it's time to change the pills from blue to blackhttps://www.cnx-software.com/2019/12/24/stm32-black-pill-board-features-stm32f4-cortex-m4-mcu-optional-spi-flash/

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 01:00:38 pm
content: People play with that 401/411 BPill already onwww.stm32duino.com(the new forum) ormcu.selfip.com(also the new forum).Looks promising..Supported by STM HAL core and stevestrong's github core.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 17, 2020, 02:41:20 pm
content: Quote from: up8051 on January 17, 2020, 12:36:52 pmIn principle an excellent suggestion, the Cortex-m4 isfar betterin every way than the old STM32F103Cx, but at those prices what's to stop the same things happening all over again, i.e. re-badged poorly documented "compatible" Gigadevice MCU's or worse ?It's the perfect bait and switch, make a few thousand boards with genuine STM32F4's as loss leaders then when the brandname is well known, quietly switch in the clones ... PROFIT!I think there is only one way to be sure, if you must have a board, buy a Nucleo or Olimex and get a guaranteed STM32 MCU or buy the chip only direct from a respected supplier such as arrow.com and put it in your own design ?

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 07:42:10 pm
content: If I were a young hobbyist with a limited budget, who wants to start with a 32bit MCUs, I would be pretty happy to get GD/CKS BluePills for $2 incl. postage.That is the targeted audience for that kind of products. BluePills do not target corporate developers who want to land on Moon or Mars and their budgets are virtually unlimited.On the other hand I would admit a single BluePill is capable enough to land you on the Moon - as we saw it 50y back. In case you targeted such an exercise I would be pretty confident STM may produce for you a radhard STM32F103C8

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: January 17, 2020, 08:10:51 pm
content: Quote from: imo on January 17, 2020, 07:42:10 pmYes, and, on top of that, as most people are going to buy the cheap blue pills you'll have it easier to get help off the inter webs, than with the olimexes. And although I say that, I've bought quite a few Olimexes in my life and never had a problem with them.BTW, there was already an STM32F103blackpill before the Cortex M4 ones.

author: langwadt
author_rank: Super Contributor
timestamp: January 17, 2020, 09:09:34 pm
content: Quote from: techman-001 on January 17, 2020, 02:41:20 pmyeh, price for 401/411 "Black Pill" on Ali $2.79/$3.96, STs budgetary price in qt 10000 $2.13/$2.79

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: January 17, 2020, 09:22:56 pm
content: Quote from: imo on January 17, 2020, 01:00:38 pmstm32duino.com is back?!?! Cool!Quote

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 09:28:05 pm
content: Quote from: langwadt on January 17, 2020, 09:09:34 pmIn the "oscilloscope asic" thread I wrote that a "list price" (or budgetary price) "means nothing" in the business. Happy you are showing that prices - it says "somebody" is getting the stm32f401/411 chips for a fraction of their budgetary price..

author: langwadt
author_rank: Super Contributor
timestamp: January 17, 2020, 10:02:01 pm
content: Quote from: imo on January 17, 2020, 09:28:05 pmyeh the list price is not much more than "is it an expensive part?"the same stm32f401/411 on digikey is ~$2.50@2500 ...

author: iMo
author_rank: Super Contributor
timestamp: January 17, 2020, 10:16:03 pm
content: The BOM costs of the F401 BlueBlackPill board cannot be more that 50cents (provided the shipping is free). And the BOM list is not short..

author: techman-001
author_rank: Frequent Contributor
timestamp: January 18, 2020, 12:30:22 am
content: Quote from: imo on January 17, 2020, 09:28:05 pmOr that theyalreadyhave fake stm32f401/411 chips ?*Pill users have been scammed so many times with cheap shoddy Chinese junk and fake chips yet still assume new *Pills will contain genuine parts. It boggles my mind.

author: iMo
author_rank: Super Contributor
timestamp: January 18, 2020, 01:37:43 am
content: Quote from: techman-001 on January 18, 2020, 12:30:22 amCould you show me an *Pill user who ever got a board with fake stm32 chip, plz?Could you show me a fake stm32 chip, plz?

author: techman-001
author_rank: Frequent Contributor
timestamp: January 18, 2020, 03:19:11 am
content: Quote from: imo on January 18, 2020, 01:37:43 amOf course, proof of both are in this one pic.The photo shows a fake stm32 chip in a Blue Pill board, you can clearly see the labeling says "STM32F103C8T6" but this chip is not made by STM, therefore it's a fake.The backstory is here for anyone interested:https://www.eevblog.com/forum/microcontrollers/stm32f103c8-diagnostic-bootable-binary-freely-available/msg2871198/#msg2871198

author: westfw
author_rank: Super Contributor
timestamp: January 18, 2020, 07:25:38 am
content: What makes it "shoddy"?

author: techman-001
author_rank: Frequent Contributor
timestamp: January 18, 2020, 10:36:25 am
content: Quote from: westfw on January 18, 2020, 07:25:38 amItems such as inadequately anchored USB connectors that snap off after a few uses, incorrect value USB resistor (Google “R10 Blue Pill” for more information), header pin coatings that go rusty and FAKE mcu's.The name "Blue Pill" is the personification of "shoddy".https://www.yourdictionary.com/shoddyshoddy definition: The definition of shoddy is something immoral or sordid, or is something badly made. (adjective) Stealing from people who trust you is an example of shoddy behavior.

author: iMo
author_rank: Super Contributor
timestamp: January 18, 2020, 11:02:43 am
content: Yeah, those are the small annoyances veteran BluePill users learned to live with10k resistor - you do not need to change it (for 1k5), it works fine with 10k.USB connectors - I always resolder the usb connector mounting tips with a tin blobspin headers - the pins they ship are crap, I always solder in the gold plated ones (what doubles the price of the board actually)Do not expect high-end finish with a board for $2 incl. shipping. There is maybe 100 manufacturers of "BluePill" boards and various clones of it (a dozen?). The same with MapleMinis. The bigger Pill pcbs (like F103ZET, F407ZET with 144pin stm32) are of high quality btw, but cost $10-$15.Well, if the traditional BluePill was manufactured in US or EU, the quality would be maybe better, but you would pay 10x more.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: January 18, 2020, 12:23:27 pm
content: Quote from: techman-001 on January 18, 2020, 10:36:25 am*yawn*Quality is defined as conformance to requirements. A carrier bag (for food shopping) is obviously not the same spec as an executive briefcase, but they both meet their quality targets.These boards cost $1.86, really WTF do you expect... Maybe you should find some other windmill to tilt at.

author: OwO
author_rank: Super Contributor
timestamp: January 18, 2020, 04:46:38 pm
content: I'm not sure if there are F4 clones, but on F303 gigadevice cheaped out by keeping the old F1 peripherals layout rather than copy the STM32F303 peripherals, so GD32F303 isn't drop in compatible with STM32F303, but it does have a Cortex-M4 and FPU (unless you are unlucky and get an early 2017 batch which have no FPU). I simply developed my code targeting GD32F303 rather than STM32F303 because the BOM cost in that particular application (NanoVNA V2) is critical.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 18, 2020, 06:25:55 pm
content: Quote from: OwO on January 18, 2020, 04:46:38 pmThanks for the GD information, your NanoVNA V2 looks nicely doneNot that it matters but I wonder if Gigadevices licensed or purchased the old F1 peripherals from STM as they seem to be using them in a lot of their MCU's?The Gigadevices RISC-V GD32VF103 (which also uses most of the F1 peripherals) is quite interesting, I'm playing with one at the moment.https://mecrisp-stellaris-folkdoc.sourceforge.io/gd32vf103.html#gd32vf103-longan-nano

author: iMo
author_rank: Super Contributor
timestamp: January 18, 2020, 08:03:02 pm
content: STM has no cooperation with GD. It is not needed.GD has to talk to ARM to get the license and pay royalties. Nothing to do with STM.F1 peripherals - you may copy it easily, a patent or license for an layout of bits in a register is a joke.Moreover, the peripherals compatibility was in question in past (also USB etc).

author: BravoV
author_rank: Super Contributor
timestamp: January 19, 2020, 01:42:10 am
content: Quote from: techman-001 on January 18, 2020, 10:36:25 amHmm ... my pill's R10 is using the right value, isn't that proof its not shoddy ? ... j/k

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 19, 2020, 01:51:31 am
content: Quote from: techman-001 on January 18, 2020, 06:25:55 pmJust a small correction: you mention that the conditional branches range is +/-2048 bytes, which is not exact. Since instructions can only be aligned to 4 bytes, or 2 bytes for compressed instructions, the 12-bit offset actually encodes an offset that is in multiples of 2 bytes, which is clever, so the range is +/-4096 bytes. (I'm currently actively working on RISC-V so that piqued my attention!)Otherwise, this little MCU seems nice. One thing I'm wondering about, and haven't really seen figures, is the power consumption. If you have a board, could you measure the current draw while the MCU executes code? I'm just curious.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 19, 2020, 02:58:26 am
content: Quote from: SiliconWizard on January 19, 2020, 01:51:31 amThanks for the conditional branch info, I'll update my pageI'll set something up to measure the current drain, all I can really do that be be vaguely informative is a comparison under similar circumstances with a STM32F103, both running a Forth primes program then post the results here and on my doc site. At least they use the same peripherals with a couple of exceptions.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 23, 2020, 12:54:14 pm
content: Quote from: SiliconWizard on January 19, 2020, 01:51:31 amAs promised, avery rough indicator.I have a elcheapo USB power monitor connected to a USB/3.3v dongle, there are two red power leds illuminated on the dongle and the longan-nano (one each) at all times.Time is to reach prime 99991. Not 99991 primes.Time is derived manually as I watch my PC clock, so allow +- 0.5 second !Clock (MHz)DescriptionCurrent (A)Time (seconds)8Idle0.008primes0.002672idle0.0272primes0.023.5104idle0.02104primes0.023The STM32F103 72MHz quiescent was borderline at 0.02A with it jumping to 0.00A about 50% of the time and the primes seemed to take 3.0 seconds rather than 3.5 but the RISC-V Forth I'm running is only experimental compared to the stable STM32F103 release.So my very uninformed and adhoc impression is that the (genuine) STM32F103 is using less power than the GD32VF103.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 23, 2020, 02:43:22 pm
content: I took a deeper look at the datasheet:https://www.gigadevice.com/products/microcontrollers/gd32/risc-v/Comparing with the figures given in the F103 datasheet, it should draw less power/MHz in run mode, but of course there's a number of factors to take into account, such as which peripherals are enabled, etc, and the frequency you ran them at was also not the same obviously. Still, for the STM F103, they state ~50mA @72MHz with all peripherals enabled (which is not terribly impressive), and for the GD32VF103, 33.7mA @108Mhz (also all peripherals enabled), which looks definitely better. Now that remains to be confirmed with measurements. Thanks for the couple measurements you made, unfortunately the tool you used is not really accurate enough... but we are definitely in the ballpark stated in the datasheets.Other than power consumption at the typical 3.3V, I noticed two points that are worth considering when using a GD32VF103.* First, min. VDD is 2.6V (vs. 2V for the STM32F103), which probably also says a thing or two about the process node they must have used. Or maybe it's all due to the flash memory... (which I suspect, see below!)* Second, the startup time is very significant at 132ms... (and also the wakeup from standby mode which is almost as much...) They are much shorter on a STM32F103. Not sure what explains this as I haven't found clear documentation on the "boot" process. I'm suspecting that the internal flash is first copied to an internal SRAM block (which would allow 1/ cheap flash on a separate die and 2/ easily allow the zero-wait-state that is advertised), but I haven't seen that clearly stated (unless I missed it), and the block diagram makes it look like the core would have direct access to flash memory.

author: iMo
author_rank: Super Contributor
timestamp: January 23, 2020, 03:06:59 pm
content: That is the same booting process as with the GD32F. I think the GigaDevices has taken the same road with GD32V chips as well (2 chips in the package).Btw, a pretty clever decision. No need to cope with slow flash on the chip (like STM does with ART).An you may design 1GHz mcu with zero ws.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 23, 2020, 03:11:36 pm
content: Quote from: imo on January 23, 2020, 03:06:59 pmYeah, several clues are there that indicate it must be this.It's definitely something to keep in mind. It may not matter in some applications, and may in others.

author: iMo
author_rank: Super Contributor
timestamp: January 23, 2020, 03:14:26 pm
content: Sure, but what is the percentage of apps where you have to start your MCU app in XX clocks after a power on?

author: BravoV
author_rank: Super Contributor
timestamp: January 23, 2020, 03:27:56 pm
content: Noob question, in order to identify STM32F103 vs GD32VF103, say both set @72MHz, run a tight loop, say many-many iterations that will make it significant, between the loop accessing the SRAM at GD32 vs Flash at STM32, and blinks the PC13 led after certain millions of iterations that human eyes can spot it ?

author: iMo
author_rank: Super Contributor
timestamp: January 23, 2020, 03:37:18 pm
content: Do you mean GD32F vs STM32F?Run the same code (ie a benchmark) and count clocks with the internal DWT_CYCCNT counter.

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 23, 2020, 03:48:27 pm
content: Quote from: imo on January 23, 2020, 03:14:26 pmIn significantly less than >100ms, quite a few actually. Can be even more of a problem when getting out of standby mode if you use it, or simply after a reset (from watchdog for instance).The 2.6V min can also be a concern in many low-power applications (although these days I would probably never use either the STM32F103 or the GD MCU for a low-power design anyway...)Then, the fact flash is copied at startup can also pose some specific security concerns, so it's not necessarily the best approach for all designs. Sure is cheap though.All this to emphasize some of the significant differences between the two MCUs (apart from having a different ISA) that could matter depending on specific requirements and that may not be obvious if you don't read the specs carefully.Of course, it's likely that most users of "Bluepill" boards wouldn't care about any of the above. (But those, OTOH, will care about the two chips being actually not at all as compatible, at least peripheral-wise, as they could initially assume, which I think was an earlier thread in itself...)

author: techman-001
author_rank: Frequent Contributor
timestamp: January 23, 2020, 08:25:00 pm
content: Quote from: SiliconWizard on January 23, 2020, 02:43:22 pmBoth MCU's had exactly the same peripherals enabled, the GPIOS and a USART. The Longan-Nano is a $5 board, it's tiny and has no quick method to measure only the MCU power (like any STM32 Discovery or Nucleo board), hence the rough indication of my quick test.GD use a "flash into ram overlay" at bootup, hence zero wait states at 108MHz and the longer boot up time. I guess 132ms isn't *that* long in a world where all Windows users are conditioned to wait five minutes while their PC boots up ;-)The GD documentation is very poor in comparison to ST Micro, for instance:I can find no reference to SYSRESETREQ in the literature other than the reset-logic pic in the GD32VF103 User Manual V1.2 PDF (which I suspect is just paste from the GD32F103 PDF). What this means is thereseemsto be no simple way to reset all the peripherals to power-up-defaults as can be done on STM32.This is achieved in the GD32VF103 sample factory code using a long list of individual peripheral register resets.

author: langwadt
author_rank: Super Contributor
timestamp: January 23, 2020, 08:29:51 pm
content: Quote from: imo on January 23, 2020, 03:06:59 pmwith the down side that RAM uses much more die area than flash, and uses much more power doing nothing like in sleep mode

author: westfw
author_rank: Super Contributor
timestamp: January 23, 2020, 09:06:52 pm
content: QuoteIs that in addition to oscillator startup time, or "in parallel" somehow?(I'll note that the normal Atmel AVR crystal oscillator start-up time is ~65ms. But the STM32s start on an internal oscillator and you have to enable the crystal oscillator separately. In theory, that could mean additional time (132ms to copy the flash to RAM, start running, enable the crystal oscillator and wait another few 10s of ms for that to stabilize...)

author: techman-001
author_rank: Frequent Contributor
timestamp: January 23, 2020, 10:08:13 pm
content: Quote from: westfw on January 23, 2020, 09:06:52 pmGood points. One of the things I appreciate about the MSP430 is the 'instant' USART wake up from deep sleep.And let's not overlook the ESP2866 which also uses the same serial FLASH technique at boot-up as the GD MCU's. That boot-up delay hasn't stopped millions of them being sold and deployed because of their low price, high clock speed and WiFi capability.

author: westfw
author_rank: Super Contributor
timestamp: January 24, 2020, 08:39:03 am
content: QuoteDoes it? I thought ESP8266 has XIP Serial flash with RAM Cache, plus a fair amount of code in ROM?(A bit of everything, it appears:https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/general-notes.html)

author: iMo
author_rank: Super Contributor
timestamp: January 24, 2020, 12:32:16 pm
content: GD32F/V includes some sort of ROM (or a state machine) too - the bootloader accessing the external flash (in case of the GD the second die inside the package). Thus ESP and GD are "flashless" mcus.https://zeptobars.com/en/read/GD32F103CBT6-mcm-serial-flash-Giga-Devices

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: January 24, 2020, 02:34:25 pm
content: But thestartegyis completely different,the Giga Devices chip upon reset copies the entire flash contents into RAM and boots from the copy at full speed, but the esp32 can't do it because there's no way to copy (up to) 16MB of flash into 520kB of RAM, so it's got a flash caching mechanism that, as with all caches, if your code happens to jump all over the place^W flash address space too often, penalizes execution speed. For time critical code (interrupts!) or anything you need or want to have cached at all times no matter what, you can tell the compiler to leave it mapped permanently on to RAM with the IRAM_ATTR attribute.https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/general-notes.html#application-memory-layoutEdit:That "copy flash to RAM on reset" thing is nowhere to be seen in any of the Giga Devices datasheets. I said it because I read itsomewherein a forum on the interwebs, but now I don't think it's true.

author: bingo600
author_rank: Super Contributor
timestamp: January 24, 2020, 06:09:06 pm
content: On topicUser madias (over there), just got this "It's Fake" letter from STMhttps://www.stm32duino.com/viewtopic.php?f=7&t=127/Bingo

author: iMo
author_rank: Super Contributor
timestamp: January 24, 2020, 06:56:43 pm
content: Is the silicon die inside the package original STM?Where the die comes from?

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: January 24, 2020, 07:14:15 pm
content: Send it to noopy

author: thm_w
author_rank: Super Contributor
timestamp: January 25, 2020, 12:02:29 am
content: Quote from: bingo600 on January 24, 2020, 06:09:06 pmInteresting, and the response said certain ADC functions were allegedly not working properly.MYS = malaysia? Oddly the fake STM32 chips I received were PHL (phillipines).Most of the genuine parts I have here are CHN, with some older KOR. Wonder if it means anything at all.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 25, 2020, 02:32:18 am
content: Quote from: bingo600 on January 24, 2020, 06:09:06 pmHey Bingo, if you're a member over there, any chance you could tell them about my free diagnostics binary that may help them determine if a STM32F1x is a fake ?https://mecrisp-stellaris-folkdoc.sourceforge.io/stm32f103c8-diags.htmlCheers:)

author: Rasz
author_rank: Super Contributor
timestamp: January 25, 2020, 05:46:56 am
content: Quote from: GeorgeOfTheJungle on January 24, 2020, 07:14:15 pmor zeptobarshttps://zeptobars.com/en/, or electronupdatehttps://www.youtube.com/user/electronupdate/videos?disable_polymer=1

author: bingo600
author_rank: Super Contributor
timestamp: January 25, 2020, 07:10:02 am
content: Quote from: techman-001 on January 25, 2020, 02:32:18 amDone/Bingo

author: techman-001
author_rank: Frequent Contributor
timestamp: January 25, 2020, 09:38:26 am
content: Quote from: bingo600 on January 25, 2020, 07:10:02 amThanks Bingo!I does appear that wecan usemy diagnostic program to tell if a chip marked as STM32F is a fake by reading theLOT NUMBERs.I have a few reader submitted data that show the LOT Numbers of CS32F103C8T6 chips are in Hexadecimal, ie 0x004D3512 while genuine STM chips are in Decimal only.I only have a report from one user with a GD32F103 and that chip USB failed to work with the error "Device descriptor request failed".Does anyone else here have a GD32F103 Blue Pill or board that they could try my diagnostic program on and report the DEVICE ID data ?

author: iMo
author_rank: Super Contributor
timestamp: January 25, 2020, 10:59:36 pm
content: They may take an stm32F103C6 or C4 (32k/16k), sand the markings off the package and print a "fake" marking with ie. the famous 991 KA on it.Would be interesting to read the IDs of those chips.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 25, 2020, 11:31:03 pm
content: Quote from: imo on January 25, 2020, 10:59:36 pmHmm, maybe I'll release a 31kB version of my STM32F103 Diags bootable binary for users to read the Flash Size Register and ID codes on a 32Kb STM32F103C6.The minimum image size of Mecrisp-Stellaris is about 18kB so I can't do a 16kB version.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 25, 2020, 11:39:42 pm
content: Quote from: Rasz on January 25, 2020, 05:46:56 amHoly Moley!I just spent hours viewing zeptobars, what an excellent decapping site, such clear die pictures, it's like chocolate to a tech such as IWhat really shocked me wasHOW MANY FAKESthere are now ! There are fakes of just about every generic chip these days from 555's to op-amps etc.Amazing.

author: Noopy
author_rank: Super Contributor
timestamp: January 26, 2020, 03:51:36 pm
content: Quote from: Rasz on January 25, 2020, 05:46:56 amGot one!https://www.richis-lab.de/STM32.htmNow a genuine one would be interesting to see...

author: Rasz
author_rank: Super Contributor
timestamp: January 26, 2020, 04:22:29 pm
content: https://smdprutser.nl/blog/category/stm-vs-gd32/some investigation of GD differences

author: thm_w
author_rank: Super Contributor
timestamp: January 28, 2020, 12:15:28 am
content: Quote from: techman-001 on January 25, 2020, 09:38:26 amI am the user, since I can't get your binary to work with USB enumeration, read GD32 with jlink instead:UID:1FFFF7E8 = 2E CB 39 34 38 34 38 0F 33 37 39 38 FF FF FF FF1FFFF7F8 = FF FFcontains hex similar to cs32 right?xy = 876202798wafer number = 56Flash size register:1FFFF7E0 = 40 00 = 0x0040 = 64kBUID [31:0]: X/Y coordinates on Wafer (BCD coded)UID [39:32]: Wafer number (8-bit unsigned number)UID [95:40]: LOT number (ASCII encoded)

author: techman-001
author_rank: Frequent Contributor
timestamp: January 29, 2020, 01:03:37 pm
content: Quote from: thm_w on January 28, 2020, 12:15:28 amThanks for the followup!I'm assuming that your register 0x1FFFF7E8 contents = 0x2ECB3934 (as the register is 32 bits)?If you have a USB/3.3 volt dongle and don't mind connecting it to your BluePill unit, I can make you a bootable binary to use instead of the boards non working USB ?I'm doing a improved V2 atm, any chance you could followup with the 32 bitHex contentsof these registers as you're the only one with a GD32F103 Blue Pill who has responded ?Code:0x1FFFF7E0 =0x1FFFF7E8 =0x1FFFF7EC =0x1FFFF7F0 =Here are the contents of one of my STM32F103C8 MCU's for comparison but as we know your numbers will be different.Code:id (STM32F103C8)0x1FFFF7E0 = 0xFFFF00400x1FFFF7E8 = 0x066FFF530x1FFFF7EC = ox555071500x1FFFF7F0 = 0x87042957

author: bingo600
author_rank: Super Contributor
timestamp: January 29, 2020, 09:03:50 pm
content: Quote from: bingo600 on January 24, 2020, 06:09:06 pmWuutt ...Aliexpress rejected the Official STM document , about fake chips/Bingo

author: iMo
author_rank: Super Contributor
timestamp: January 29, 2020, 09:05:07 pm
content: Sure, Ali assumes the STM document might be a fake

author: thm_w
author_rank: Super Contributor
timestamp: January 29, 2020, 10:30:24 pm
content: Quote from: techman-001 on January 29, 2020, 01:03:37 pmIts in reverse order right, LSB first? so the 32-bit value would be 0x3439CB2E.I'm reading the memory locations which are printed in one byte at a time in ascending order.Code:0x1FFFF7E0 = 0x001400400x1FFFF7E8 = 0x3439CB2E0x1FFFF7EC = 0x0F3834380x1FFFF7F0 = 0x38393733Its not a bluepill but a chip on my PCB so don't worry about making another version, thanks.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 29, 2020, 10:54:26 pm
content: Quote from: bingo600 on January 29, 2020, 09:03:50 pmThey must still be in shock over at Alibaba at this unbelievable claim from Madias?Hmm, that reminds me of a story my mother read to me as a small boy ... but what was the name of it ?Ahh, I remember now, it was "Alibaba and the 40 honest people" !

author: iMo
author_rank: Super Contributor
timestamp: January 30, 2020, 12:14:38 am
content: Now, how to order a not-faked BluePill for example??Is there any recommendation on a specific seller (ebay, ali)?Would a comment in the Order like "Genuine STM32F103C8 only" be enough?

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: January 30, 2020, 12:46:43 am
content: What if the fab in China or Taiwan that makes the fakes makes the original STs too? Then maybe ST themselves are selling fakes too...What a mess!

author: rhodges
author_rank: Frequent Contributor
timestamp: January 30, 2020, 12:58:00 am
content: Last August (2019) I ordered from seller "cctv008008" and the chips were marked as expected. I ordered from "everbuyingo" and got chips marked "CKS32F103". The CKS chip appears to have 64k of flash, as I wrote earlier.I do not remember if the one I tested at 128k flash was from "cctv008008" or an earlier purchase. I will do a test on one from that seller.I should probably start marking my boards when I get them, or keep them in marked containers.I had a similar story with the W1209 boards. The good ones have an STM8S003, and I have a lot of libraries for that chip. But some of them have a Nuvotron 8051 family chip, and I can't do anything useful (*) with those. I could have complained "not as described", because the picture shows an STM8S003. But the text does not say what CPU it has.I think that in the big picture, the seller has no idea exactly what the warehouse will send, and adding a comment won't help.(*) Well, I can always use them as thermostats.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 30, 2020, 01:36:04 am
content: Quote from: GeorgeOfTheJungle on January 30, 2020, 12:46:43 amDon't buy from Taiwan or China perhaps ?I'm still using my hoard of 480 STM32F051's (64kB flash. 8kB ram, QFN32) I bought from Avenet (Dallas) in 2014 for $0.56 USD each. They're sealed in chip carriers in silver packs with nitrogen gas and special moisture monitors, plus each pack includes a traceable printout for the product, utterly professional.This is a far cry from the usual Chinese chip purchase which usually come in a envelope.The shipping was $65 at the time which was a lot back then but I amortized it over all the chips in that shipment. The other amazing thing is that the order was 3 days from payment to my door! I can't even get stuff in that time using the Australian Postal service from Melbourne, which is only 1000km away from me.I've also bought from Arrow.com which have really low prices from time to time on old/excess stock etc. They are FAST delivery with similar packaging to Avenet.No way either of those two business above supply fake chips.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 30, 2020, 04:26:21 am
content: Quote from: thm_w on January 29, 2020, 10:30:24 pmMany Thanks againYes Little Endian by default.Of course, it's your own board with a GD32F103! error = "Device descriptor request failed"Here is my new layout and data for comparison.Code:\ test-STM32F103C8-live\ Flash Bytes: 65536\ [31:00] $066FFF53 | . o . S | <--Hex char detected\ [63:32] $55507150 | U P q P |\ [95:64] $87042957 | . . ) W |\ test-GD32VF103-live (RISC-V)\ Flash Bytes: 131072\ [31:00] $3641294D | 6 A ) M | <--Hex char detected\ [63:32] $00123736 | . . 7 6 |\ [95:64] $FFFFFFFF | . . . . | <--Hex char detected\ test-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-supplied-data\ $1FFFF7E0 = $00140040\ $1FFFF7E8 = $3439CB2E\ $1FFFF7EC = $0F383438\ $1FFFF7F0 = $38393733

author: OwO
author_rank: Super Contributor
timestamp: January 30, 2020, 04:56:45 am
content: If you want a "genuine" chip with 128/256KB of flash, search GD32F103C8T6 on aliexpress. I have not seen a fake GD32 yet

author: I wanted a rude username
author_rank: Frequent Contributor
timestamp: January 30, 2020, 05:07:30 am
content: Quote from: OwO on January 30, 2020, 04:56:45 amTop kekQuote from: GeorgeOfTheJungle on January 30, 2020, 12:46:43 amCompletely off topic, but your sig triggers me in all the best ways.

author: bingo600
author_rank: Super Contributor
timestamp: January 30, 2020, 04:47:44 pm
content: I'm done with F103's - Chance of fake is to big.I'll be buying F401/f411 boards ... Until they fake those too./Bingo

author: BravoV
author_rank: Super Contributor
timestamp: January 30, 2020, 05:02:51 pm
content: Quote from: Noopy on January 26, 2020, 03:51:36 pmBoth boards, the Bluepill at 1st post that with the fake STM32F (with "F" at 1st line instead of 2nd), and the ST-Link V2 that has CKS32F103C8T6 are on their way to Noopy.

author: OwO
author_rank: Super Contributor
timestamp: January 30, 2020, 05:08:14 pm
content: Not sure about the CKS32, but the GD32 peripherals compatibility with STM32 is pretty good. I've used the GD32 in a real design that uses DMA ADC, DMA SPI, USB, flash writing, and all the timers, all using libopencm3 and based on the STM32 documentation. I've yet to notice any difference in any of the peripherals. All existing STM32 code runs unmodified on the GD32. Unmodified STM32F103 binaries run on the GD32F303 too!!I would say don't worry too much about clones. You most likely won't ever notice the difference unless you check the idcode or use ST's tools which check idcode (which btw I don't recommend using because they force you to write spaghetti code that is unmaintainable).

author: techman-001
author_rank: Frequent Contributor
timestamp: January 30, 2020, 07:03:25 pm
content: Quote from: OwO on January 30, 2020, 05:08:14 pmI wouldn't worry too much about a cloned Gucci handbag but a genuine STM32F103C8 has 33 peripherals, 466 registers and 3503 bitfields.Considering just not reading the genuine STM32F10x errata can get one into trouble, that's a curious opinion from an engineer especially as some of the 'clone' differences are rather glaring such as the fact that GD use a serial Flash, glued right on top of the MCU die which loads into Ram at boot up and STM does not.As they say, "an Elephants compatibility with a Sherman tank is pretty good, mainly in terms of weight, but they can't breed"

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 30, 2020, 07:09:22 pm
content: Quote from: techman-001 on January 30, 2020, 07:03:25 pm

author: iMo
author_rank: Super Contributor
timestamp: January 31, 2020, 10:52:33 am
content: Quote from: OwO on January 30, 2020, 05:08:14 pmThat is encouraging! Would be great to get some detailed report on the actual compatibility of the GD32F parts. Except never-endingwe only see some naive tests. I do like the GD32F/V concept, but I've been missing concrete information what could be expected in real life..

author: GromBeestje
author_rank: Frequent Contributor
timestamp: January 31, 2020, 11:38:40 am
content: I'm working on comparing some *32F103 parts. (https://www.eevblog.com/forum/other-blog-specific/*32f103-comparison)Indeed, any test is likely to only cover a small portion of the chip. Each peripheral has a dozen of options, and there are a lot of corner cases. Like a communication peripheral that works fine when everything is connected right, but the error handling is implemented differently. So to run a complete test, it's hard to cover all possible corner cases.Also from hardware perspective it is hard to test many combinations of crystals and capacitors. I've already run into some issues when exchanging STM32 and GD32 (https://www.eevblog.com/forum/microcontrollers/crystals-and-caps)edit: it seems the * broke the auto url tags, fixed it.addition: also one thing to keep in mind regarding STM32 vs GD32, the voltage range differs.

author: techman-001
author_rank: Frequent Contributor
timestamp: January 31, 2020, 12:40:58 pm
content: Quote from: GromBeestje on January 31, 2020, 11:38:40 amI agree.Personally, I think a complete and accurate comparison of the STM32F103 with any clones isimpossiblebecause there are too many peripherals, registers and bitfields, hence too many permutations.I can say with confidence however that ONLY a genuine factory STM32F103 is 100% compatible with another genuine factory STM32F103 and because there are no reputable and comprehensive studies available regarding the STM32F103 and the 'clones', any claims of 'compatibility' are only opinions of the author.I'm using some GD32VF103's at the moment and they appear to be a decent MCU. Many of the peripherals *appear* to be clones of the STM32F103 but every peripheral, register and bitfield has a different name to those used in the STM32F103.Personally I prefer this as the GD32VF103 will stand on its own laurels, no one will ever claim that a GD32VF103 is in any way compatible with any STM32Fxx even tho some of the peripherals are similar.In time a new GD32VF103 respin may well be a major seller, and given that the RISCV core is open, OSS community support for the GD32VF103 may dominate other chips.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: January 31, 2020, 01:27:40 pm
content: I'll only be able to tell it's compatible with my code. I'll be doing some DMA transfers to timers to control WS2812 LEDS for example. I'll have to think about some more tests to do, but it will never test every possible configuration. Also, thinking about some tests to identify the part. In the end, all it will say whether it's good enough for my purposes. So far, in my opinion, only STM and GD are worth considering. That is based on the presence of documentation and availability of the chip itself.The parts I've under test are sold as APM32F103 and CS32F103. For this test I don't have any clones labelled as ST parts that I am aware of.So far I've only seen the GD32VF103 on Longan Nano boards, but I've not yet seen the chip itself for sale. My thought about the chip is it to be a GD32F103 with the ARM core replaced with a RISC-V code, and the peripherals and pinout remain unchanged. So you could replace the chip in an existing design (if it has a full JTAG header available, as no ARM means no SWD).

author: rhodges
author_rank: Frequent Contributor
timestamp: January 31, 2020, 03:46:47 pm
content: I am testing the "most recent" blue pills I got from ebay seller "cctv008008" in August 2019.These are "RESRT" boards. The surface mount components are soldered nicely, but the 6-pin headers for BOOT0 and BOOT1 appear to be hand soldered, two rather poorly. The CPU markings are:STM32F103C8T69910X RR93MYS 99 907(ST LOGO)When I ran openocd, it complained that the id code 0x2ba01477 was wrong, it expected 0x1ba01477. I think someone has already written about this. At first, I was unhappy that I might not be able to use hardware debugging on these chips. But it looks like changing the code in the openocd config file works:--- stm32f1x.cfg 2020-01-01 22:34:41.000000000 -0700+++ stm32fake103.cfg 2020-01-31 08:24:23.754265000 -0700@@ -31,7 +31,7 @@set _CPUTAPID 0x3ba00477} {# this is the SW-DP tap id not the jtag tap id- set _CPUTAPID 0x1ba01477+ set _CPUTAPID 0x2ba01477}}> st-info --probeFound 1 stlink programmersserial: 303030303030303030303031openocd: "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31"flash: 131072 (pagesize: 1024)sram: 20480chipid: 0x0410descr: F1 Medium-density deviceI did get gdb to load an ELF file to flash and it looks like debugging works normally.

author: rhodges
author_rank: Frequent Contributor
timestamp: January 31, 2020, 04:15:03 pm
content: Continuing with the same board, I have the USB Forth diagnostics loaded.stm32idDie xy coords: 81699Wafer Number: 45Lot_num ascii encoded [23:0]: 0x004D3812 | M 8 .Lot_num ascii encoded [55:24]: 0x004E4B43 | . N K CFlash Size Register = 131072 BytesTesting 64kB Flash block: 0x10000 - 0x1FFFFErasingFlash with 1010101010101010 (0xAA)Testing for 0xAA - OKErasingFlash with 0101010101010101 (0x55)Testing for 0x55 - OKErasing~~~~~ ALL TESTS PASSED ~~~~~

author: rhodges
author_rank: Frequent Contributor
timestamp: January 31, 2020, 04:29:21 pm
content: Here is another board from the same order:stm32idDie xy coords: 594193Wafer Number: 45Lot_num ascii encoded [23:0]: 0x004D3812 | M 8 .Lot_num ascii encoded [55:24]: 0x004E4B43 | . N K COnly the XY coordinates changed.

author: techman-001
author_rank: Frequent Contributor
timestamp: February 01, 2020, 06:16:53 am
content: Quote from: GromBeestje on January 31, 2020, 01:27:40 pmAgree again, if ones project tests ok on any chip then all is goodI haven't seen any pricing on the GD32VF103 chips either, and frankly STM32 will do me perfectly for the next few years.I think GD have quite a battle on their hands as ARM own the embedded market, are cheap (I believe that individual chip prices are a very minor part of any project cost), reliable and very well documented.It will be a interesting new decade for embedded indeed

author: techman-001
author_rank: Frequent Contributor
timestamp: February 01, 2020, 06:40:38 am
content: Quote from: rhodges on January 31, 2020, 04:15:03 pmThanks for the feedbackThe only chips I've seen that:1. connect to the diagnostic image with USB2. advertise 128kB Flash3. contain "M" in the "Lot_num ascii encoded [23:0]:"are CKS32F103C8T6, so I think that's what you have.Given the USB Id's are also wrong, it's looking like FAKES once again as the chips are marked STM32F103.

author: OwO
author_rank: Super Contributor
timestamp: February 01, 2020, 07:49:04 am
content: Has anyone tried using the flash SRAM mirror on the GD32 as actual ram? I haven't yet figured out how to write to it. All writes seem to be ignored as I'm reading back the old value (this is with a volatile pointer pointing to a flash address). If I unlock the flash for writing it still ignores the write unless I erase the page first. It seems to track which pages are erased because only the first write after each erase sticks (rather than some AND/OR of the old and new value). Writes to the aliased address (starting at 0x0) instead of the flash address (0x08000000) seem to be always ignored even with a prior erase and with flash writing enabled. I'm looking for a way to make it think the flash is smaller and use the remaining space as ram.

author: iMo
author_rank: Super Contributor
timestamp: February 01, 2020, 08:48:15 am
content: There are 2 different physical blocks of sram inside - sram_sram and flash_sram. Most probably the access to flash_sram is limited. Otherwise they would have created a single contiguous block of sram for both flash and sram with uniform access..PS: the picture of CBT6 on zeptobar site shows 4x32kB flash_sram, 2x10kB sram_sram and 4x512B reg_sram(?) blocks..

author: techman-001
author_rank: Frequent Contributor
timestamp: February 01, 2020, 09:37:17 am
content: Quote from: imo on February 01, 2020, 08:48:15 amI'm sure someone at CKS knows what's going on in their chips ?Is it too much to ask for a detailed datasheet explaining what they are doing so designers can use that knowledge in their designs, or is the clone world all about secrets due to counterfeiting etc ?I'll take a genuine STM32 any day over one of these poorly documented Chinese 'clone' chips.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 01, 2020, 10:11:09 am
content: Quote from: techman-001 on February 01, 2020, 09:37:17 amThe flash ram thing is about GigaDevice parts (GD32), not about the China Key Systems part (CKS32)? GigaDevice has datasheets, user manuals, errata, etc. on their website. I'd say GigaDevice is good. Using the flash shadow RAM as generic RAM, it's not the intended use, but is more like a hack to get more RAM then advertised for the part. This idea has been discussed since the architecture of the GD32, having an external flash with a shadow RAM had been pointed out. So far, I've only read about people wondering whether it is possible, but I haven't seen anyone do it yet.However, the CKS32 or CK32 (are they the same part of different parts?) I haven't even found evidence it is even China Key Systems manufacturing them. There is no mention of the part of their site. So, manufacturer unknown, no datasheet or any other documentation. The CKS32 part is a no go.

author: techman-001
author_rank: Frequent Contributor
timestamp: February 01, 2020, 10:31:46 am
content: Quote from: GromBeestje on February 01, 2020, 10:11:09 amI only have GD32VF103's (risc-v) and the docs are ok but there are some major errors, such as pasting the reset method from the GD32F103 into the GD32VF103 doc when it's totally different as far as I can tell.GD do list their chips on their website with doc and I quite like the GD32VF103 myself, I think it may have a bright future, time will tell. They certainly seem like a bonafide and honest chip maker to me.As you said in a earlier post, be nice to see the GD chips for sale standalone. Perhaps a respin to fix the USB loader issue first ?Totally agree re the 'CKS' CS32, as you say it's not listed on the CKS website, but it's for sale everywhere. I wonder why the CKS website doesn't have a notice about this chip, some kind of advisory 'be advised this is not a CKS chip' etc ?Definitely seems a bit dodgy and the 'CKS' CS32 chips are now in Blue Pills also.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: February 01, 2020, 11:46:18 am
content: GD32F103: A STM32F103 on steroids!https://www.rogerclark.net/gd32f103-a-stm32f103-on-steroids/GigaDevices Cortex-M3 GD32F1xx GD32F2xx (2015):https://archive.eettaiwan.com/www.eettaiwan.com/STATIC/PDF/201507/GigaDevice.pdfGigaDevices Cortex-M4 GD32F3xx GD32F4xx (2017):https://site.eettaiwan.com/events/iot_2017/sources/GigaDevice_D32_series_of_Cortex-M_MCU_Introduction.pdfGD32 MCU Platform (2018):https://site.eettaiwan.com/events/iot_embed_2018/sources/07_GigaDevice.pdfSTM32 fakes:https://github.com/keirf/Greaseweazle/wiki/STM32-FakesFake STM32 “Blue Pill” Boardshttps://embeddedtronicsblog.wordpress.com/2018/12/29/fake-stm32-blue-pill-boards/CS32 MCU Clone of STM32 Makes it into Bluepill Boardhttps://www.cnx-software.com/2019/02/10/cs32-mcu-stm32-clone-bluepill-board/Chinese clones attack STM32 microcontrollershttps://olimex.wordpress.com/2015/11/09/chinese-clones-attack-stm32-microcontrollers/

author: Noopy
author_rank: Super Contributor
timestamp: February 02, 2020, 02:35:03 pm
content: Hi all,have done some more decapping:https://www.richis-lab.de/STM32.htmFirst one is one of the confirmed fake STM32.Second one is from an other blue-pill-board.Third one is from Aliexpress.Fourth one is from an ST-Link V2.Except the first one are all original STM32.In the upper left corner of the fake-die there is a really small thing. Possibly some manufacturer marking. Possibly only dirt…You clearly can see the difference between the dies.Does anybody know the figures in the silicon art?

author: martinayotte
author_rank: Regular Contributor
timestamp: February 02, 2020, 04:15:25 pm
content: It looks like rotated fishes ...

author: nigelwright7557
author_rank: Frequent Contributor
timestamp: February 02, 2020, 06:05:46 pm
content: Quote from: bingo600 on January 30, 2020, 04:47:44 pmI bought in some Chinese irfp240/9240 transistors because they were slightly cheaper.They lasted 10 minutes until a spike on the mains blew them up.I replaced them with parts from a "reputable" uk dealer and still going over a year on.While these copy parts are often functional you dont know what corners have been cut.I opened one up and the die is about half the size of the genuine part.The moral of the story is pay a little more and get genuine parts and their will be much less heartache.I now just use Farnell and RS Components in the UK and not had any problems.

author: GeorgeOfTheJungle
author_rank: Super Contributor
timestamp: February 02, 2020, 08:00:42 pm
content: Quote from: Noopy on February 02, 2020, 02:35:03 pmThat's what engineerds do!

author: techman-001
author_rank: Frequent Contributor
timestamp: February 02, 2020, 09:20:22 pm
content: Quote from: nigelwright7557 on February 02, 2020, 06:05:46 pmWhile viewing theoutstandingly cleardecapping PR0N pics athttps://zeptobars.com/en/the author comments noted that many of the clones (and there are a LOT) whilst quite nicely designed, seemed to view silicon die area reduction as a priority.In other words, many of the 'clone' dies are a lot smaller than the genuine articles so in the case of your irfp240 clones this reduction in die size probably didn't bode well when dealing with hundreds of volts ?

author: OwO
author_rank: Super Contributor
timestamp: February 03, 2020, 05:08:53 am
content: Die size reduction on the GD32 is because of using a newer process. The fake transistors you got are most likely relabeled crap and not a proper "clone". If you go the effort of actually designing a clone ASIC there is no reason to skimp on reliability because it doesn't cost more to design it properly.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 09, 2020, 08:37:50 pm
content: I've been playing around with the STM32F103 GD32F103 CS32F103 and APM32F103. I've written some code that can tell them apart. I use the content of the ROM TABLE to tell them apart. There is no fancy user interface, it puts its result in the USB string of the Interface.The USB ID is DEAD:BEEF, so to capture the output, you can do something like thisCode:[andre@8570w ~]$ lsusb -d dead:beef -v | grep iInterfacecan't get device qualifier: Resource temporarily unavailablecan't get debug descriptor: Resource temporarily unavailableiInterface 4 STM32 Cortex-M3 r1p1 V:1 CONT: 0 ID: 32 PART: 410 REV: 0The iInterface string will containSTM32/GD32/CS32/APM32Cortex M3 rnpn: The ARM Core used: STM32 uses r1p1, clones usually r2p1Content of the PID in the ROM TABLE (JP106 Identifier)I'm curious about those fake STM32F103 chips, what they will output with this little test. I wonder whether they're relabelled CS32/APM32 or something completely different.Source code:https://github.com/a-v-s/ucdev/tree/32F103Detect/demos/usbd/stm32f1Details about the ROM TABLE content:https://www.blaatschaap.be/?p=166

author: techman-001
author_rank: Frequent Contributor
timestamp: February 10, 2020, 12:18:39 am
content: Quote from: GromBeestje on February 09, 2020, 08:37:50 pmI'm curious also and is where I am so far on V2 of my STM32F103 diagnostics. It now prints a short summary, with some observations, and a optional XML table with just the data as collected.The "DUID" is the Derived Unique Identifier to be used a as filename for any XML files for records, stats and further analysis.Sample output from my genuine STM32F103C8:Device Short Summary--------------------duid: $D43BA754Flash bytes, declared: 65536Debug_idcode: Not readable, candidates:STM32F1xscb_cpuid: STM32F1 seriesudid[95:64] $87042957 |..)W|udid[63:32] $55507150 |UPqP|udid[31:00] $066FFF53 |.o.S|<?xml version='1.0' encoding='UTF-8'?><DEVICE xs:noNamespaceSchemaLocation='STM32F103_DIAGNOSTICS_V2.0.XSD'><DEBUG><IDCODE>0 </IDCODE></DEBUG><DERIVED><DUID>$D43BA754 </DUID><FLASH-SIZE>65536 </FLASH-SIZE></DERIVED><EXTERNAL-MARKINGS><STM32F103C6>0 </STM32F103C6><STM32F103C8>0 </STM32F103C8><STM32F103CB>0 </STM32F103CB><CKS32F103C8T6>0 </CKS32F103C8T6><GD32F103C8T6>0 </GD32F103C8T6><OTHER>0 </OTHER></EXTERNAL-MARKINGS><FLASH><SIZE-REGISTER>$FFFF0040 </SIZE-REGISTER><SECOND-64KB-BLOCK>0 </SECOND-64KB-BLOCK></FLASH><SCB_CPUID><BITS-31:24>$41</BITS-31:24><BITS-23:20>$1 </BITS-23:20><BITS-19:16>$F </BITS-19:16><BITS-15:4>$C23 </BITS-15:4><BITS-3:0>$1 </BITS-3:0></SCB_CPUID><UNIQUE-DEVICE-ID-REGISTER><BITS-95:64><HEX>$87042957 </HEX><ASCII>..)W</ASCII></BITS-95:64><BITS-63:32><HEX>$55507150 </HEX><ASCII>UPqP</ASCII></BITS-63:32><BITS-31:0><HEX>$066FFF53 </HEX><ASCII>.o.S</ASCII></BITS-31:0></UNIQUE-DEVICE-ID-REGISTER></DEVICE>

author: techman-001
author_rank: Frequent Contributor
timestamp: February 10, 2020, 11:16:42 am
content: Quote from: GromBeestje on February 09, 2020, 08:37:50 pm"There is no fancy user interface, it puts its result in the USB string of the Interface."That's a bit low rent, aren't we paying you enough ;-)"Interface 4 STM32 Cortex-M3 r1p1 V:1 CONT: 0 ID: 32 PART: 410 REV: "That has to be the easiest way to get data out with C, short of using Morse Code via a User LEDAccording to my doc and chips, PART: 0x411 is also valid "0x411FC231 (STM32F1 series)" and is what I get with my STM32F103C8's with the hidden extra 64kB Flash

author: Jul8
author_rank: Newbie
timestamp: February 14, 2020, 12:23:01 pm
content: Quote from: GromBeestje on February 09, 2020, 08:37:50 pmThanks! I would like to include your code (stm_romtable() an dependents) into a project of mine. What license does your code have? libhalglue is MIT, but ucdev doesn't tell.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 14, 2020, 05:21:06 pm
content: ucdev is a container project with a number of submodules containing external repos.As the code in that branch is a testing / proof of content, I haven't labeled it yet, but that code will be MIT was well.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: February 23, 2020, 02:59:17 pm
content: Quote from: Jul8 on February 14, 2020, 12:23:01 pmThe ROMTABLE parser is now part of libhalglue (https://github.com/a-v-s/libhalglue/blob/master/common/arm_cpuid.c)And the demos in ucdev have been updated to include a license header.

author: Noopy
author_rank: Super Contributor
timestamp: February 29, 2020, 10:57:34 pm
content: Quote from: BravoV on January 30, 2020, 05:02:51 pmGot them and took some pictures.I have reworked my STM32-page to outline what I already have done:https://richis-lab.de/STM32.htmFirst the CKS32:https://richis-lab.de/STM32_03.htmAnd the Bluepill-STM32:https://richis-lab.de/STM32_04.htmThis one was interesting. It´s not a fake like this one:https://richis-lab.de/STM32_01.htmBut it´s also no STM32, it´s a relabeled CKS32:Interesting!

author: BravoV
author_rank: Super Contributor
timestamp: March 01, 2020, 08:26:38 am
content: Quote from: Noopy on February 29, 2020, 10:57:34 pmThanks Noopy, really appreciate your works there.I guess this is it, all those 2 dollars BluePill boards and 2 dollars STMLink V2 use this CKS32.Especially the one at the STLink V2, which they clearly labelled CKS, not as STM32, looks like they're pretty confident of their CKS32, aren't they ? (CKS chip designer)

author: Noopy
author_rank: Super Contributor
timestamp: March 01, 2020, 08:42:58 am
content: I like opening chips!Money makes the world go round. As Long as the CKS32 is cheaper manufaturer will place them on their boards.And with the correct label it´s perfectly legal.With some awareness and enough quality the (cheap) "CKS" could even be a sales argument.

author: techman-001
author_rank: Frequent Contributor
timestamp: March 01, 2020, 11:36:22 am
content: Quote from: Noopy on March 01, 2020, 08:42:58 amExcellent work, I love your pics.It looks like the CKS CS32F was sanded down in the second picture then the external markings printed. I bet the depth of the circular indent is less in the fake STM32F103 as a result of the grinding ?With the assistance of your work, and my diagnostics feedback it's becoming more obvious to me what the fakers are doing now.I think the CS32F103 will never be legal, for instance no one seems to know where it comes from. The CKS website doesn't even list the part ...is it even made by CKS?There is no User Manual or Tech Manual for the CS32F103 either, and some people have had issues with certain peripherals that won't run code that works on the STM32F103.I doubt any cost saving is worth it given the lack of a comprehensive data sheet listing the differences between the CS32F103 and the STM32F103 ?I think it's only any good to scam Blue Pill buyers and pass an initial quick test. The chip is so complex that hobbyists who buy them and can't get a project to work (due to a CS32 difference) probably just think it's their lack of experience. Most wouldn't know the chip is a fake, so your pictures help here as well.

author: Noopy
author_rank: Super Contributor
timestamp: March 01, 2020, 11:47:55 am
content: Quote from: techman-001 on March 01, 2020, 11:36:22 amThanks!If anyone has an other "strange looking" STM32 I can do more investigations.Well I´m no expert regarding these STM32-clones.I wondered why it was labeled CKS32. A lot of websites talk about "CS32*" and the die marking shows also CS32...

author: BravoV
author_rank: Super Contributor
timestamp: March 01, 2020, 12:05:53 pm
content: Quote from: techman-001 on March 01, 2020, 11:36:22 amHave you track on what kind of specific code is that ?

author: techman-001
author_rank: Frequent Contributor
timestamp: March 01, 2020, 12:20:12 pm
content: Quote from: BravoV on March 01, 2020, 12:05:53 pmNo, that would be a massive task, plus I don't use the clones myself. I don't even use the STM32F103, preferring Cortex-M0 for what I do.The pic is from somewhere onhttps://www.stm32duino.com

author: techman-001
author_rank: Frequent Contributor
timestamp: March 01, 2020, 12:29:33 pm
content: Quote from: Noopy on March 01, 2020, 11:47:55 amEveryone wonders about that, but here in the West, no one seems to know what's going on.I think the bottom line is "don't waste your time with fakes". I'm sure it's better to pay $10 for a STM32F779AIY6TR with comprehensive and accurate documentation, 97 Peripherals , 2 MB flash and 500kB ram that runs up to 216Mhz than waste months on afake16 year old STM32F103 with zero documentation ?One can't even get a decent meal for $10 nowadays!

author: Noopy
author_rank: Super Contributor
timestamp: March 01, 2020, 01:10:25 pm
content: Quote from: techman-001 on March 01, 2020, 12:29:33 pmI fully agree!

author: iMo
author_rank: Super Contributor
timestamp: March 01, 2020, 01:43:47 pm
content: CKS32F103datasheet..

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 01, 2020, 02:53:24 pm
content: Quote from: techman-001 on March 01, 2020, 12:29:33 pmOh I really agree with this of course.But this obsession for low cost, even when low cost doesn't matter, all comes down to how "greedy" we have become IMO. Whereas tracking a cent could of course matter if you're designing cheap products that you'll sell by the million, how could that ever matter, as you said, for hobbyist use? A typical hobbyist may buy a couple dev boards a year. Big deal. You spent more money just talking about it that buying genuine stuff, and it kills "local" business on top of that. And nobody fucking cares.This attitude is mind-boggling, and I think it's here to stay.

author: OwO
author_rank: Super Contributor
timestamp: March 01, 2020, 05:46:02 pm
content: I would disagree. A MCU is usually just a small part of a complete system, and if all component costs were to double, it would double the cost and thus price of the final product. In a dev board it really doesn't matter, but in a real product it does. If a STM32 costs $5, frequency synthesizers cost $5, op-amps cost $5, RF switches cost $1, then the NanoVNA wouldn't be possible. It would cost $300 and no-one would buy it (maybe a few would but most hobbyists wouldn't afford it). Btw in the V2 design I specifically chose a GD32F303 rather than a STM32F303 (even though it is not a compatible clone), because that dollar of BOM cost reduction really matters. Shave a dollar here and there, and the result is something affordable to any hobbyist and enables you to see things you would have needed a $500 instrument to see before."local" is relative. What you call offshore is "local" to me. If I'm designing something and local alternatives offer better bang for buck, of course I'll use that. Telling me to design in genuine STM32 is like me telling you to use some overpriced chinese piece of crap rather than your own local brand that is cheaper and better.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: March 01, 2020, 07:47:26 pm
content: Quote from: Noopy on March 01, 2020, 11:47:55 amI have some chips here, another "STM32F103 compatible" part the APM32F103. I could send you a sample if you like. Also, I have the cs32f103c8t6 and cs32f103cbt6. I wonder if they are the same as the cks32 labelled part.

author: Noopy
author_rank: Super Contributor
timestamp: March 01, 2020, 09:10:45 pm
content: Quote from: GromBeestje on March 01, 2020, 07:47:26 pmI like!I´ll write you a PN...

author: techman-001
author_rank: Frequent Contributor
timestamp: March 01, 2020, 10:47:28 pm
content: Quote from: imo on March 01, 2020, 01:43:47 pmThanks, but this is just the CKS32F103 'electrical' doc, there is no information on the registers and so on.

author: techman-001
author_rank: Frequent Contributor
timestamp: March 02, 2020, 12:44:04 am
content: Quote from: OwO on March 01, 2020, 05:46:02 pmRemember this thread is about fake STM32's which are a plague in the West, illegal by our laws and have caused a massive distrust of Chinese sellers as a result.Do Chinese vendors consider the short term gains of ripping of their Western buyers in this way a good idea ?Do they not care that people so affected will probably never buy from China again ?

author: OwO
author_rank: Super Contributor
timestamp: March 02, 2020, 04:37:08 am
content: CKS/gigadevice aren't doing that. Random ebay sellers sell relabelled crap, what do you expect? Don't vet your vendors properly and you will get relabelled chips regardless of country. Why don't you just raise a dispute with the seller?GD32 is a legit brand with an official store on taobao. If I want true genuine chips with no chance of fakes, I can buy GD32 at reasonable price from their official store, but to buy genuine STM32 would require paying extortionate prices at one of the big 3 distributors. GD32 has already displaced STM32 in real (end user) products here, not relabelled ones but ones with "GD32Fxxx" printed on the chip.

author: OwO
author_rank: Super Contributor
timestamp: March 02, 2020, 04:48:45 am
content: Part numbers are not generally considered trademarks here. If I produce a transistor that adheres to all 2n3904 specifications, I can sell it as a 2n3904, even if some characteristics not on the datasheet are a bit different. Similarly if I make a chip that functions just like a STM32 and runs most code unmodified (except maybe for very few corner cases), it's generally considered a-ok to sell it as a STM32. The generics mindset here is strong, and it's not considered ok for one manufacturer to monopolize a part number, especially when compatible substitutes are produced. "STM32" is a generic name for a MCU with these peripherals in this layout, just like U.FL is a generic name for a connector with these dimensions. If that's a problem for you just buy from the big distributors.

author: techman-001
author_rank: Frequent Contributor
timestamp: March 02, 2020, 05:26:10 am
content: Quote from: OwO on March 02, 2020, 04:37:08 amI'm not trying to persuade YOU to buy STM32, why is this STILL unclear to you ?I'm suggesting Western buyers avoid Chinese products with "STM32F103 chips" because of all the ripoff's.People have raised counterfeit disputes with the Chinese vendor and have been utterly ignored, even when supplying proof of forgery. please see the picture below.

author: OwO
author_rank: Super Contributor
timestamp: March 02, 2020, 06:18:15 am
content: Yes, people just need to understand that "stm32" on ebay/aliexpress doesn't mean "stmicroelectronics stm32", it means "stm32 compatible" which generally adheres to the datasheet and reference manual. Code that depend on undocumented behavior may not work across all manufacturers, but in all my tests of the peripherals including ADC, DMA, timers, USB, SPI, and flash writing I've not found anything that deviates from the spec sheet. Maybe if you use a broken USB library (the one supplied by ST is broken!) it won't work on a CKS32, but so far with libopencm3 all peripherals including USB worked perfectly on all compatibles I've tried.For someone new to STM32, I don't think the compatibles are a bad choice, and I'd even recommend testing your code on all compatibles including a genuine ST STM32 from mouser so that you can be sure your code is portable and doesn't depend on unspecified behavior. Just like you should test your web app on several browsers, and not just a Genuine Microsoft (R) internet explorer (TM).

author: panoss
author_rank: Frequent Contributor
timestamp: March 02, 2020, 09:29:20 am
content: Quote from: OwO on March 02, 2020, 06:18:15 amPeolple don't need to understand anything.When somebody orders an STM32 and receives an "stm32 compatible" it's simply a fraud.And he will have to make the seller 'understand' this.

author: BravoV
author_rank: Super Contributor
timestamp: March 02, 2020, 10:02:03 am
content: Quote from: OwO on March 02, 2020, 04:48:45 amIn the olde days, among "big" manufacturers used to practice that among them selves.Your example on the popular transistor, or chips like LM317, LM324, 78xx regulator and etc.Its just in those days the electronics communities didn't use ugly words like "clone" , "copy" and etc, they used the nice word called ... "cross referenced" .

author: langwadt
author_rank: Super Contributor
timestamp: March 02, 2020, 10:26:15 am
content: Quote from: BravoV on March 02, 2020, 10:02:03 amand each put their logo on them so if you wanted a specific type you could tell them apart. And an MCU is many orders of magnitude more complicated than a voltage regulator/opamp etc.

author: BravoV
author_rank: Super Contributor
timestamp: March 02, 2020, 10:28:28 am
content: Quote from: blueskull on March 02, 2020, 10:13:54 amAgree, that is simply a crime.

author: techman-001
author_rank: Frequent Contributor
timestamp: March 02, 2020, 01:22:49 pm
content: Quote from: OwO on March 02, 2020, 06:18:15 am" I'd even recommend testing your code on all compatibles including a genuine ST STM32"I think your advice is for Chinese users of the home grown 'compatibles' but I wouldn't do that because I'm only using genuine ST STM32 chips, and their documents tell me exactly what to expect, there is no ambiguity here for me.My situation here in the West is the reverse of yours, I can buy the genuine STM32 chips at a good price, there is no need to try and buy them from China which is now far too risky given that I may receive up to 3 different 'compatible' non genuine chips, marked as STM32F103x instead. My motivation to buy 'compatibles' is exactly zero." but in all my tests of the peripherals ... I've not found anything that deviates from the spec sheet "There is no single "spec sheet", there are many STM32F1x documents, including ones from ARM. It takes months just to read them all.Furthermore the STM32F1xx has 37 peripherals, 413 registers and 3044 bitfields, so I don't believe you could have tried more than a few combinations.We have a old saying here in the West, "lack of proof is not the same as proof of lack".I don't want to give the impression I'm anti Chinese, because I'm not. I'm only anti counterfeit and fakes, which are illegal in the West.I think the Chinese people have made a terrible mistake with the STM32F103 counterfeit chips, at least from a perspective of selling them here in the West. I believe those chips will mainly be sold in China now as no one wants them here.Contrast the 'compatibles' to the GD32VF103, it has the open source RISC-V core which anyone is free to use, and a lot of the STM32F103 peripherals which have their own GD32VF103 names now. It's not a 'compatible' of anything, it's a new chip, all Chinese. There is a GD datasheet that's ok, but has some terrible errors.I have no complaints about the chip, I received a couple of GD32VF103's in different boards and they seem to work ok, tho it's early days yet. GD may possibly sell a *lot* of the GD32VF103 here when they are available as chips only, and if the price is good.Look at the excitement the Padauk PMS150C "3 cent micro controller" has caused since it came out, it's not a copy of anything, the documentation is great, the IDE and programmer software (windows only) is free to download and they have hardware simulators to develop applications so buckets of OTP PMS150C's aren't required for development. I think it's a excellent, honest product with first class documentation and support.I believe that honest, reliable, innovative and low priced Chinese MCU's may sell well in the West, but we have long memories and don't like being ripped off with counterfeits and fakes.I believe you may see the impact of this in lower chip sales to the West eventually because the buyers here know they can't trust they will get what they paid for when buying electronics from China.Earning back buyer trust may take China decades.

author: techman-001
author_rank: Frequent Contributor
timestamp: March 02, 2020, 03:45:29 pm
content: Quote from: blueskull on March 02, 2020, 01:48:15 pmIt should be fairly obvious I only have problems with counterfeits. You must have seen the decapping pics by Noopy in the recent posts which included a CS32 which was clearly relabeled as a STM32F103 and that's *exactly* the kind of ripoff I mean.A legal clone is what we call a 'second source', and that's perfectly acceptable, no problems there. I wish the legit Chinese semiconductor industry all the best, innovation and competition is good for tech consumers like me.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 02, 2020, 04:02:54 pm
content: Quote from: techman-001 on March 02, 2020, 03:45:29 pmAgreed. (Also - let's not forget the original thread was about the Bluepill, which is a cheap dev board, which is why I personally focused on the hobbyist use case.)Counterfeits are just illegal, and the additional downside for the user is that they can't be guaranteed in any way usually.Now China (in particular) has a lot of regular clones (not counterfeits), and even a lot of original and very low-cost MCUs these days, so the point of choosing a counterfeit over those if you're targetting low-cost and chinese vendors is completely dubious. There's just no reason to do it, except to effectively rip-off the original vendor (leveraging their popularity, dev tools, code base, etc.)

author: HwAoRrDk
author_rank: Super Contributor
timestamp: March 02, 2020, 05:04:21 pm
content: The mention of part numbers and trademarks sparked something in my mind...ST have a trademark on the term "STM32". It's a stupid thought, but what if the reason why these CKS/GD chips re-marked to be ST are marked with "STM32F" is because they are being careful not to tread on the exact trademark term? Although, perhaps not, given that most IP protections only seem to warrant a passing thought in China.If they ever tried to pursue legal action, I'm guessing ST would dearly hope that a court would not decide that the mark "STM32" does not go the way of Intel and be deemed to have been 'genericised'. Back in the '90s Intel famously lost the case against AMD using the term "386", and had their trademark invalidated. This then set the course for Intel to start using names like "Pentium" for their CPU range.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 02, 2020, 05:09:14 pm
content: I don't know whether ST has ever tried to take action on those counterfeits or not.Since ST seems relatively popular in China (and probably has an interesting market there), they may just kindly ignore the problem in order not to irritate the chinese. Dunno.

author: techman-001
author_rank: Frequent Contributor
timestamp: March 02, 2020, 11:11:21 pm
content: Quote from: SiliconWizard on March 02, 2020, 04:02:54 pmExactly.I personally ranted against the Bluepill because I thought the STM32F103 was too old. Even tho it's still very capable there are literally a ton of far better models for hobbyists to spend time learning. As a Forth user I operate close to the metal and I see the STM32F103 issues intimately.Compared to the STM32F0xx that old chip is a pig. A very fast pigThen the Bluepills started coming out with the counterfeit chips and customer confidence plummeted. It was never that high to start with due to issues with the USB port breaking off, no bootloader, bad USB resistors etc.The clone situation and resultant confusion here prompted me to make my bootable USB Forth based STM32F103-diagnostics program, and along the way I came to appreciate the STM32F103 a bit more than I had before. At the end of the project I had become so used to the response of a 75MHz STM32F103 that my STM32F051 development system is now (over)clocked at 75 MHz also.$2 for a Bluepill was insanely cheap and hobbyists couldn't resist them, as you say it's a new age of "cheap at any cost" insanity. Kids have grown up thinking a $20 MCU is expensive, but those of us who paid $175USD for a Motorola MC6800 think otherwise.But cheap doesn't have to mean crap, look at the Padauk PMS150 ?I did because I thought it would be utter rubbish but after looking at the website I changed my mind totally, it's a very classy product ... great job Padauk!In summary I think the Bluepill's days are over, no one in the West trusts them any more because of the counterfeits. Greed killed off old grandfather Bluepill in so many ways.Perhaps it's time for honest homegrown $2 Chinese GD32Pills or a CS32Pills (if anyone can find a CKS32 technical reference) ?If they come with the MCUs promised there may still be room for them in the ultracheap hobbyist parts boxes?

author: mskeete
author_rank: Contributor
timestamp: March 03, 2020, 03:56:34 pm
content: Quote from: HwAoRrDk on March 02, 2020, 05:04:21 pmIntel lost because the courts ruled that you cant trademark a number. 386 / 486 are just numbers and no-one has an exclusive right to them.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: March 04, 2020, 08:02:11 am
content: Quote from: techman-001And now ST put their libraries on GitHub. The Drivers are under a 3 Clause BSD license so can legally be used by any compatible devices. There are some parts still under SLA0044 license, such as the USB Middleware. A high level USB implementation is easy enough to replace. (I wrote some stuff to replace it)Quote from: techman-001Well... that's the problem with the C(K)S32. The lack of any documentation. Not even mentioned on the CKS website, so is it even made by them?For the GD32, there are datasheets, technical reference manuals, errata, libraries, everything is available. There are distributors in the West. I would trust making a design using GigaDevice parts.Maybe some Pills with a MM32F103CBT6 by MindMotion. There are datasheets, reference manuals and libraries at their site. This beast can run at 168 MHz, but is not STM32F103 compatible. To achieve that speed the layout of the RCC registers is changed. I'd have to go through the documentation to see what else has changed.I just checked LCSC, and a new *32F103 variant popped up. There is an HK32F103CBT6. From what I can tell it is made byhttp://www.hsxp-hk.com/but their website is down (Error 522 from a Cloudflare-like service)

author: thm_w
author_rank: Super Contributor
timestamp: March 04, 2020, 10:09:03 pm
content: Quote from: GromBeestje on March 04, 2020, 08:02:11 amIt says CPU = 96MHz, is 168MHz guaranteed or is it just added to the PLL table?https://lcsc.com/product-detail/mindmotion_MindMotion-Microelectronics-MM32F103CBT6_C316700.htmland now its even more confusing, they have a STM32L373, which doesn't exist from ST:https://lcsc.com/product-detail/Microprocessor-Microcontroller_MindMotion-Microelectronics-MM32L373PS_C212250.htmlHK32F103 basic datasheet attached.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: March 05, 2020, 07:39:25 pm
content: It seems they've pulled that from their datasheets. It used to say, speed 96 MHz, Turbo mode 168 MHz. Unfortunately my hard disk crashed and I've lost the version of their datasheet making that claim.I've found the reference:http://www.mindmotion.com.cn/userfiles/images/MM32F103XiLieWenDang/DS_MM32F103xx_o_V1.13_EN.pdfUnder "1.2Product Feature" it says:QuoteThis one is missing fromhttp://www.mindmotion.com.cn/userfiles/images/MM32F103XiLieWenDang/DS_MM32F103xx_n_V1.05_EN.pdfIt is not clearly stated what the difference between the "n" and "o" is, but one thing I noticed in the datasheets is that the "n" version has 64 or 128 KiB flash and the "o" has 256 or 512 KiB flash.Quote from: thm_w on March 04, 2020, 10:09:03 pmThe most confusing part is that the MM32F103CBT6 is not compatible with an STM32F103CBT6. But at least there is documentation.Quote from: thm_w on March 04, 2020, 10:09:03 pmThanks! It looks like another 5,5 Volt capable one. Just like the BLM32 and MM32. Those two are not STM32 compatible, and I haven't been able to locate any manuals for the BLM32. Oh well. I've ordered a few to see what they are, and add them to my comparison.Edit: found the 168 MHz reference

author: Noopy
author_rank: Super Contributor
timestamp: March 26, 2020, 12:06:35 pm
content: Quote from: GromBeestje on March 01, 2020, 07:47:26 pmThanks to GromBeestje I have some more parts to look inside.The first two are the least interesting ones (now I have looked inside): cs32f103c8t6 and cs32f103cbt6https://www.richis-lab.de/STM32_03.htmI didn´t even upload the dies because they are equal to the csk32f103c8t6 I already had (viewed from a high level).=> csk32f103c8t6 == cs32f103c8t6 == cs32f103cbt6

author: Noopy
author_rank: Super Contributor
timestamp: March 30, 2020, 07:40:05 pm
content: NEWSToday I have a APM32F103C8T6 for you (Thanks to GromBeestje again):https://www.richis-lab.de/STM32_05.htmIt seems that SEC-CHIP has done a lot of the design.I found only little information about SEC-CHIP. They seem to cooperate a lot with APEXMIC.There is kind of a small similarity to the CKS32/CS32:https://www.richis-lab.de/STM32_03.htmThese two testpads inside the logic block...Overview here:https://www.richis-lab.de/STM32.htm

author: profdc9
author_rank: Frequent Contributor
timestamp: April 01, 2020, 04:42:33 pm
content: Despite the fact that STM32F1 is old, it is good enough for some projects. When designing hobbyist or open source projects (which I know is not the main concern here), there isn't the quantity to ensure part availability long into the future. I have made open source projects for NXP parts and many of them are still available, but hard to get, and could be end-of-life soon. The STM32F1 seems like it is used widely enough that it should be available long into the future. If, for example, STM32F4 or STM32F7 had similar widespread adoption, I would use it. However, it is not necessarily the cost that makes it attractive for projects, but the low cost makes it more likely to be used, which raises demand and therefore increase the likelihood that it will be available in the future. There are definitely frustrations and limitations of the STM32F1, but because of its ubiquity there is a strong incentive to use it if it is sufficient for the purpose.

author: Noopy
author_rank: Super Contributor
timestamp: April 02, 2020, 06:41:21 pm
content: Hi all!Thanks to GromBeestje I was able to add a GD32 to my collection: A GD32F103CBT6 and a GD32F101CBT6. They both look the same although the 101 has less RAM and no USB interface. Probably the 101 and the 103 are the same parts…https://www.richis-lab.de/STM32_06.htmIt´s the interesting die-stack zeptobars already has decapped.Very interesting: Since zeptobars has decapped the GD32F103CBT6 they apparently have reduced the die size of the flash memory!Some dies get really dirty while glueing the dies together.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: April 03, 2020, 09:22:16 am
content: The GD101 checks though. When I flash a binary compiled for 20 KiB of RAM, it immediately hardfaults. Trying to enable USB doesn't trigger a hardfault but it just doesn't work. So I guess, there is some hidden area in the flash containing the configuration. Setting the amount of memory, and selecting the enabled peripherals. Kinda like the wounding Cypress uses in their PSoC4 series.

author: Noopy
author_rank: Super Contributor
timestamp: April 03, 2020, 11:14:30 am
content: I´m pretty sure the manufacturer can somehow configure the GD32.It´s possible that the configuration is placed in the flash but it´s also possible that there are some fuse bits on the big die. Perhaps there are real fuses or some other one time programmable memory bits.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: April 03, 2020, 12:13:30 pm
content: Some articles how this is handled on the PSoChttp://www.dmitry.gr/?r=05.Projects&proj=23.%20PSoC4http://www.dmitry.gr/?r=05.Projects&proj=24.%20PSoC4%20confidentialIt has been speculated the GD32 copies the content from flash to some designated RAM area and start executing from there. So I'd imagine they've some bootrom that performs this task, as well as configure the available features. In some article, when the GD32 was hot, was wondered whether one could "unlock" this memory area to have some more RAM. However, after the initial burst of interest, there has been little written about this GD32.

author: iMo
author_rank: Super Contributor
timestamp: April 06, 2020, 03:01:05 pm
content: Btw, there is the APM32F103 with simple memory mapped FPU inside (most probably add/sub/mult/div only). Their SDK shows the FPU is indeed real.Mind it is CM3..https://www.apexmic.com/en/newproduct/apm2/16

author: ale500
author_rank: Frequent Contributor
timestamp: April 06, 2020, 03:02:59 pm
content: QuoteIf this is true, it will be a hard sell:Quote

author: iMo
author_rank: Super Contributor
timestamp: April 06, 2020, 03:09:22 pm
content: I will run it at 96mHz clock then..

author: Noopy
author_rank: Super Contributor
timestamp: April 07, 2020, 07:09:41 pm
content: Today (with thanks to the GromBeestje) I have a MM32F103CBT6 for you:https://richis-lab.de/STM32_07.htm

author: GromBeestje
author_rank: Frequent Contributor
timestamp: April 07, 2020, 07:52:59 pm
content: Keep in mind, the MM32F103 is not compatible with STM32F103. It got some different RCC registers (I haven't compared the other peripherals yet). Furthermore it has a different Device ID, such that tools designed to work with STM32F103 (eg OpenOCD) cannot flash/debug it. It seems there is support for it in SEGGER J-Link. There are datasheets and reference manuals available, as well as peripheral libraries.

author: Noopy
author_rank: Super Contributor
timestamp: April 08, 2020, 02:43:46 pm
content: And one more: BLM32F103CBT6https://richis-lab.de/STM32_08.htm

author: Noopy
author_rank: Super Contributor
timestamp: April 15, 2020, 07:26:32 pm
content: I already had a STM32-fake containing a CKS32:https://richis-lab.de/STM32_04.htmNow I know what die is inside the second STM32-fake:https://richis-lab.de/STM32_01.htmIt´s a Hangshun HK32:https://www.richis-lab.de/STM32_09.htmCredits to GromBeestje

author: Noopy
author_rank: Super Contributor
timestamp: April 21, 2020, 05:25:34 pm
content: I have decapped a GD32VF103 but since it´s no more a real STM32-clone I have posted it here:https://www.eevblog.com/forum/microcontrollers/risc-v-microcontrollers-from-gigadevice/msg3027160/#msg3027160Credits to GromBeestje

author: GromBeestje
author_rank: Frequent Contributor
timestamp: April 21, 2020, 06:39:29 pm
content: Thanks for the pictures Noopy.Can I ask you something? If I understood correctly, you started decapping your first fake because you ran into some compatibility issues. What were these compatibility issues?

author: Noopy
author_rank: Super Contributor
timestamp: April 21, 2020, 07:10:29 pm
content: Quote from: GromBeestje on April 21, 2020, 06:39:29 pmNo, I neverworkedwith the STM32. I prefer analog electronics. Digital is ok but Software only if it´s absolutely necessary.The first STM32, the bluepill-fake was sent to me by a member of the mikrocontroller.net: It came from Matthias D. (madias) who started the topic you know already. He had problems with the DMA Controller.

author: Jul8
author_rank: Newbie
timestamp: April 24, 2020, 04:18:12 pm
content: Quote from: GromBeestje on February 09, 2020, 08:37:50 pmHow about the HK32F103? Would you add detection of the HK32F103 as well?

author: jaromir
author_rank: Unknown
timestamp: April 24, 2020, 07:06:50 pm
content: Quote from: Noopy on February 02, 2020, 02:35:03 pmIt looks like STM32 families do have internal nicknames. Sometimes the nicknames do "leak to public" via various documents. For example STM32F103 seems to belong to "Piranha" family, mentioned for example herehttp://www.farnell.com/datasheets/1443552.pdfThat may explain the artwork.If you happen to take a look at STM32F4xx internals, you'll probably find different artwork on it , as it belongs to "Manta" family, for examplehttps://www.mouser.com/PCN/STMicroelectronics_8451.pdfI wonder what other aquatic animals are hiding inside STM32 devices.

author: Noopy
author_rank: Super Contributor
timestamp: April 24, 2020, 08:04:23 pm
content: Quote from: jaromir on April 24, 2020, 07:06:50 pmVery interesting! Sounds reasonable!I agree with you, I should check some other variants.I have a new fake provided by GromBeestje:https://www.richis-lab.de/STM32_04.htmIt came with an order of CK32.The marking is different but still bad.In the package I found another CKS32-die.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: June 21, 2020, 02:21:32 pm
content: Quote from: Jul8 on April 24, 2020, 04:18:12 pmI've added detection for the HK32F103, however, USB is not working on my HK32 board.

author: profdc9
author_rank: Frequent Contributor
timestamp: June 23, 2020, 02:59:53 am
content: In case any of you get desperate for a real STM32F103CBT6 bluepill, I designed one and I just made it so it can be populated by JLCPCB's assembly service. You can find the gerbers at:https://github.com/profdc9/STM32surfaceIt uses all basic and easy to obtain parts for the parts not available from JLCPCB, for example 6 mm buttons and USB B connectors. You can put a STM32F303CCT6 on it if you want something better. The kicad 3D image of the PCB is below.Also, one of the reasons I designed my own is so I could lay it out better and make it more noise immune, and the ADC definitely seems to be somewhat less noisy with this board.Dan

author: Jul8
author_rank: Newbie
timestamp: June 23, 2020, 09:15:30 am
content: Quote from: GromBeestje on June 21, 2020, 02:21:32 pmThank you!

author: Doctorandus_P
author_rank: Super Contributor
timestamp: July 29, 2020, 11:59:44 am
content: I just had a brainfart (good smelling variant) and did a search for the F103 on LCSC without the "STM", and they sell 7 different variants.https://lcsc.com/search?q=32F103C8T6Prefix: Mgf:CSK CSKHK HKAPM ApexmicBLM Shenzhen Better Life ElecGD GigaDevicesMM MindMotion MicroelectronicsST STMicroelectronicsThe MM part was labeled as a 5V part which is very unusual for Cortex M3, but the datasheet seems to confirm it:http://www.mindmotion.com.cn/userfiles/images/MM32F103XiLieWenDang/DS_MM32F103xx_o_V1.13_EN.pdfFor me this probably the end of buying "Blue Pill" boards from China / Ali.In the latest batch I had to change the ID number to get them programmed at all, and a test program of GRBL for STM32 does not save it's settings in Flash.I have no interest in figuring out the incompatibilities between those different variants, and Ali Sellers relabeling everything as "STM32" makes it impossible to know what you buy.Quite a shame, because I liked the form factor a lot. They fit on Breadboads and on matrix board, and I used to solder in the thin round pins instead of the thick square pins, so they can be used in much lower profile sockets.I also liked the very small ST-Link V2 programmers with Aluminum housing and pinout labeled on the outside.I never liked the bulky Discovery boards and their on board programmers.If some western manufacturer sold the "Blue Pill" boards for somewhere around EUR5 I would buy them.From what I've read, LCSC should be a trustworthy seller. The STM variant is their most expensive, (and slowest, least peripherals probably) but I really don't care about that. Just that it works according to the datasheet, and you don't with those re-labled uC's on the Pills.STM is USD 1.5 (10 up) from LCSC, while if you look at Octopart, no western seller has them below USD 4 (10 up).

author: Noopy
author_rank: Super Contributor
timestamp: July 29, 2020, 12:56:10 pm
content: Quote from: Doctorandus_P on July 29, 2020, 11:59:44 amAffirmative!Had them all:https://www.richis-lab.de/STM32.htm

author: rhodges
author_rank: Frequent Contributor
timestamp: July 29, 2020, 02:20:43 pm
content: Quote from: Doctorandus_P on July 29, 2020, 11:59:44 amAny opinions on JLCPCB? Their parts library gives $1.18 for STM32F103C8T6, quantity 30, and it is a "basic part".

author: OwO
author_rank: Super Contributor
timestamp: July 29, 2020, 02:33:51 pm
content: I haven't bought any bluepills since 2017. Designing a PCB is so trivial that I don't fuck with arduinos or *pills anymore and simply drop a MCU into any design, even MCUs I've never used before.If you really insist, it'd probably take 30 minutes to design a compatible blue pill PCB with passives all on the bottom side, so it can be easily assembled by JLC SMT. Then you could easily product a batch to sell.

author: profdc9
author_rank: Frequent Contributor
timestamp: July 30, 2020, 04:32:41 pm
content: You can get my Bluepill design made at JLCPCB with SMT assembly:https://github.com/profdc9/STM32surfaceThis includes BOM and placement files as xlsx format. It uses all basic parts from JLC PCB. You can get five made for about $28.Dan

author: GromBeestje
author_rank: Frequent Contributor
timestamp: September 17, 2020, 08:19:53 pm
content: Quote from: Doctorandus_P on July 29, 2020, 11:59:44 amYou might have a look at Cypress. They used to have a CY8CKIT-049 (PSoC 42xx series) for $4 on their website. Unfortunately they seem no longer available. But those have been around for many years. I'm kinda surprised that a board from a western manufacturer, at that price point, hasn't become popular in the hobby community.For a slightly higher price, $10, they still sell their CY8CKIT-043 (PSoc 42xxM series) and CY8CKIT-059 (PSoC5L series).In Europe you can get them at RS. The -043 sells for € 8,62 and the -059 for € 13,08.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 19, 2020, 07:09:57 am
content: I was unfamiliar with the PsoC, though I have a vague memory I heared taht letter comination sometimes.A quick look at:https://www.cypress.com/documentation/development-kitsboards/psoc-4-cy8ckit-049-4xxx-prototyping-kitsand it reads:QuoteThe STM32F103C8T6 has 64kB Flash, 20kB RAM, and it's among the smaller parts of it's family.On reason for choosing STM32 was a (nearly?) seamless grow path into uC's with more pins, power, and peripherals than I am ever likely to need in my uC projects.In the last few years now I've been tinkering a little bit with the things and it took me quite a lot of hours of searching the web and experimenting to find a toolchain and development environment I'm reasonably happy with. I would have found those PsoC uC's interesting when I was doing comparisons of different uC's to get out of the limits of the small Atmel AVR's, but that was years ago.The CY8CKIT-043 has more flash, but still Cortes M0, twice the price and comes with the attached programmer, which I want separate. I was thinking along the lines of buying 3 or 4 programmers for some redundancy, and 20 or so boards, so those other 15 attached programmers will end up in landfill somewhere.It's for those relatively simple project where I don't want to design a PCB and have it manufactured in China, but just grab a uC board and dump it on a Matrix board for one -off projects.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: September 19, 2020, 08:42:52 pm
content: The programmers are snap-off. Their firmware can be switched between KitProg and CMSIS-DAP firmware. I would separate them before using them anyways.And if you would get the 049, use one with them, as the 049 comes with some USB-UART instead.The Cypress PSoCs, I guess, they are good for their analog features, like a current DAC.But their software suite only runs on Windows. That's a downside in my opinion. You need that software to generate some code to run it.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 21, 2020, 11:33:00 pm
content: I was looking for a new uC family when I grew out of the AVR's, and decided on STM32.It's very unlikely I will be using any other uC family in the coming 10 years or so, and as this is an STM32 thread about the Blue Pill, please keep it a bit on topic.

author: Kjelt
author_rank: Super Contributor
timestamp: September 22, 2020, 08:02:19 am
content: Anyone knows of bluepill pcbs with a lqfp64 STM32F1xx on it (also ok if fake).I still have 10 pcs of original STs lying with 256kB flash and 48kB ram, i could just replace the uC or design own board, still weighing the choices.

author: josip
author_rank: Regular Contributor
timestamp: September 23, 2020, 08:03:59 am
content: Quote from: Doctorandus_P on July 29, 2020, 11:59:44 amThere is LPC845-BRK that is not powerful as Blue Pill M4, but for 5 euros you get CMSIS-DAP debug probe that can be used with any NXP device.https://mcuoneclipse.com/2019/02/02/tutorial-transforming-the-nxp-lpc845-brk-into-a-cmsis-dap-debug-probe/

author: profdc9
author_rank: Frequent Contributor
timestamp: September 23, 2020, 01:13:25 pm
content: I made a PCB that takes STM32F405RGT6 but can also take STM32F103R types with a few component swaps:https://github.com/profdc9/STM32F4ThruPill

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 29, 2020, 01:55:44 pm
content: I just bumped into the link below.It's the globe upside down.ST has made a chip that is pin compatible (and improvement?) with the Allwinner A13.The A13 and ST32FM15x are Linux capable SOC's, and although "slow" by today's standard, that is not relevant when they fit in industrial processes where it's enough to get the job done. I also find the temperature range from -45c to +125c impressive.https://olimex.wordpress.com/2020/05/20/industrial-grade-4585c-stmp1-som-is-almost-completely-routed-and-pin-to-pin-compatible-with-a13-som/

author: thm_w
author_rank: Super Contributor
timestamp: September 29, 2020, 09:03:24 pm
content: Quote from: Doctorandus_P on September 29, 2020, 01:55:44 pmThe SOM (system on module) is pin compatible.

author: robca
author_rank: Frequent Contributor
timestamp: October 10, 2020, 07:27:45 pm
content: Just leaving this here.I was disappointed in discovering that the good old Blue Pill was dead as a development platform thanks to all the clones and fakes around. So while looking at replacements, I found that the STM32F4x1 "Black Pill"https://stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0.htmlare a much better board for just about the same price as the original Blue Pill (before the huge price drop due to the fakes)Especially the STM32F411 variant has a ton more memory (flash/RAM), faster at 96/100MHz (need to set the clock to 96MHz if you want to use the USB) and ART flash caching, much better M4 core, and USB C connector. There is also a slightly cheaper STM32F401, but I'm not sure it's really worth it for the tiny cost reduction. Same footprint as the Blue PillAnd, at least so far, no reported clones of the STM32F411 chips...

author: profdc9
author_rank: Frequent Contributor
timestamp: October 11, 2020, 03:31:14 pm
content: I have made versions of the Bluepill for LQFP-48 and LQFP-64 parts that can be fabricated at SMT populated using JLCPCB:https://github.com/profdc9/STM32F4surfacehttps://github.com/profdc9/STM32surfaceIt's slightly more expensive in small quantities than the cheapies ($5 to $6 a piece for Qty 5 , PCB fabrication and population), but the quality is better. You can also substitute STM32F303CCT6 in the BOM for STM32F103CBT6 if you want for the LQFP-48 part.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: October 11, 2020, 04:41:22 pm
content: Quote from: robca on October 10, 2020, 07:27:45 pmit's a question of time until those boards are cloned too.A safe bet for developing are ST's Nucleo Boards; they have a fair price compared to its features and they are readily available from reliable sources like Digikey or Mouser.

author: phil from seattle
author_rank: Super Contributor
timestamp: October 11, 2020, 08:20:55 pm
content: Yes, part of the problem with the "pills" is there is no official definition so engineering and market entropy sets in pretty quickly.I agree with the Nucleo suggestion though I truly loathe the Arduino form factor. The pill/stamp/teensy/... form factor is so much easier to use - both on a solderless breadboard or a pcb of your own creation.

author: newbrain
author_rank: Super Contributor
timestamp: October 12, 2020, 08:20:00 am
content: Quote from: phil from seattle on October 11, 2020, 08:20:55 pmNucleo boards come in three sizes:Small,Nucleo-32: Arduino nano format.Cores: F031K6, F042K6, F301K8, F303K8, L011K4, L031K6, L412KB, L432KCMedium,Nucleo-64: ~Arduino uno format.Cores: F030R8, F070RB, F072RB, F091RC, F103RB, F302R8, F303RE, F334R8, F401RE, F410RB, F411RE, F446RE, L010RB, L053R8, L073RZ, L152RE, L452RE and L476RGLarge,Nucleo-144: A bit larger than an Arduino uno.Cores: F207ZG, F303ZE, F412ZG, F413ZH, F429ZI, F439ZI, F446ZE, F722ZE, F746ZG, F756ZG, F767ZI and H743ZIWRT a blue/black pill, they all have an integrated ST-Link 2.1 (so with virtual serial and mass storage for easy flashing) and the build quality is not even comparable.On the larger sizes, the ST-Link can be snapped off and/or be used stand alone.While the choice of MCU on the 32 models is somewhat limited, it is still quite good.Edit:Link to Nucleo-32 is now correct, thanks robca.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: October 12, 2020, 11:39:58 am
content: for my projects, I'm mostly using 48pin STM32, so I use a matching Nucleo-64, skipping the not available pins on the 48pin series, so mostly PORTC and PORTD that I can easily port later to the smaller chip for my project matching PCB

author: robca
author_rank: Frequent Contributor
timestamp: October 13, 2020, 06:53:32 pm
content: Quote from: newbrain on October 12, 2020, 08:20:00 amJust FYI, your first link is to the Nucleo 144 (duplicate of the last), methinks you wanted to use this onehttps://www.st.com/resource/en/user_manual/dm00231744-stm32-nucleo32-boards-mb1180-stmicroelectronics.pdfProblem with those small boards is that you have fewer pins than a F411-based black pill (20 or 22, depending on how you use the OSC pins), which has 28 fully usable pins, plus USB and SWDIO (which if really needed, you can also repurpose). On the other hand, there is an integrated STLink, which for some can be great. And the many solder bridges can be used to configure, not to mention higher quality layout and noise immunityAnd still cost 3 times more than an F411 black pill. I bought a few and I consider them almost disposable for quick projects. After seeing the Blue Pill cloned and ruined, I decided to buy enough not to worry about future clones. Especially for USB-centric projects those are great, allowing a simulated mouse or joystick to send data to a PC at 1kHz rate (1ms polling). Quality can be all over the place, granted, like many direct from China electronics

author: paf
author_rank: Regular Contributor
timestamp: October 13, 2020, 08:09:26 pm
content: One reliable source of "Pills" could be these guys:https://robotdyn.comMy experience with them:1- The pins are very easy to solder and have the right size for using them on breadboards.2- They sell you "blues pills" in "black" with a real STM32F103C8T6 or a cheaper version with the APM32F103CB.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 26, 2020, 06:33:55 pm
content: I just took a look at AliExpress. It looks like the price of Blue Pills is rising. Any idea what's going on?

author: Kjelt
author_rank: Super Contributor
timestamp: October 26, 2020, 06:45:03 pm
content: Quote from: GromBeestje on October 26, 2020, 06:33:55 pm$1.35 - $1.85 tens of sellers, what are you talking about ? Of course fake no real ST but that was already known.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 26, 2020, 07:37:13 pm
content: Quote from: Kjelt on October 26, 2020, 06:45:03 pmI was looking at the "free shipping" option. I guess it's the shipping that has gone up these days.

author: Kjelt
author_rank: Super Contributor
timestamp: October 26, 2020, 10:13:25 pm
content: Depends if you choose ali shipping, then it is $2 something but you can order many pieces before that increases again.

author: ColCon
author_rank: Contributor
timestamp: October 31, 2020, 02:31:25 am
content: No CAN tho on those 401/411.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: October 31, 2020, 11:37:54 am
content: I guess I see it now. The price went up on eBay but not on Ali.Other things of note: It seems other variants have hit, F030 and F072 boards are now for sale as well. (They existed for long time, but only sold in China it seems). Their price seems to be within the usual Blue Pill range, so check what you buy.Furthermore, it seems vcc-gnd.com made a new revision of the Blue Pill. vcc-gnd.com also has done a Black Pill (F4), with different pinout then the WeAct one.Also, WeAct (the designer of the F4 Black Pill) also designed a Blue Pill. Like WeAct's Black Pill, it has 5 volts where the vcc-gnc.com Blue Pill has GND. So check the pinout.Also, there are some more Pills on the market. A seller named FeedoK got some variants out there with chips in the L0, L4, F4 and G4 series, and a GD32 board. FreedoK is a bit more expensive then your usual Pills.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 31, 2020, 10:14:36 pm
content: I think you mis -spoke (-wrote) here:Quote from: GromBeestje on October 31, 2020, 11:37:54 amI consider none of these boards "expensive".In US language, "cheap" seems to be a curse word, as some connotation between low price and low quality, and that is exactly what the average "Blue Pill" board has become. Quality has deteriorated that I would not accept the USD1.5 boards if someone gave them to me for free.[Edit:] Clarification: Figuering out which of the "clone" chips it is, because the type number has been erased and reprinted as "STM", or even if it has one of the 8 other type numbers on it, and then trying to keep track of the incompatibilities costs more of my time than the USD1.5 price of these boards. With the Robotdyn boards you can be reasonably sure it's a real STM part (if you buy the second cheapest they have), and that is well worth the extra money to me.Other quality issues are the mediocre PCB layout. I have not used the ADC yet, but apparently you can get 8 or 9 "true" bits out of the 12 bit ADC. and over 11 true bits if you have a good PCB layout.I had a look athttp://vcc-gnd.com/Not much language I can understand there, the shop redirects to taobao, which is a bridge too far for me, and on top of that, I find the stuttering and moving background annoying.Also had a look at FeedoK:https://www.aliexpress.com/store/group/STM32/5565045_518691931.htmlCould be interesting if you want a particular chip (they have 50+ variants), but for prices between USD7 and USD14, it adds a bit up if you want to buy a few handfuls for "generic" projects.Robotdyn still seems to be the best choice for me. Very reasonable prices (Around USD 3.5) with a promise to have real STM chips and they have some affiliate connection with (almost) local shops here in the EU (And also on other parts of this world).

author: Kjelt
author_rank: Super Contributor
timestamp: October 31, 2020, 10:51:35 pm
content: Quote from: Doctorandus_P on October 31, 2020, 10:14:36 pmYou mean the "fake" stm32 on it or what other "quality" issues are there ?

author: GromBeestje
author_rank: Frequent Contributor
timestamp: November 01, 2020, 12:00:38 pm
content: Quote from: Doctorandus_P on October 31, 2020, 10:14:36 pmTheir AliExpress link ishttps://vcc-gnd.aliexpress.com/( it is linked as "Friends outside Chine to buy links" )They're launched a new website. The old one was rather simple. No annoying stuff...The interesting part is the first link: The schematics and design files.http://121.36.161.22:8080/zl/STM32coreboard/(Unfortunately they used Altium which I don't have)

author: AE7OO
author_rank: Regular Contributor
timestamp: February 11, 2021, 08:28:37 pm
content: Some times you run across a REALLY REALLY good deal.The best one I ever got was March of last year from Newark.I got 73 PIC32MM0256GPM0XX's(28, 36 and 48) for a GRAND TOTAL of, wait for it, $00.10!I don't have a clue why they were marked down to .001 and .002 cents each.I had not dealt with any PIC's in years, nor did I have a clue what I would use them for, but at that price, who cares.And then I got lucky again. After determining that neither my ICD2 nor my PicKit2 would program these puppies, I went looking for a programmer. And found out that Microchip had just recently release their MPLAB SNAP debugger/programmer that they were selling for 50% off, so I grabbed 2 for $14.95.Yes, I know Newark is a major player, but still....

author: Kjelt
author_rank: Super Contributor
timestamp: February 11, 2021, 09:52:01 pm
content: Quote from: AE7OO on February 11, 2021, 08:28:37 pmI understand that you are excited with your deal but what I do not understand what this has to do with STM32 bluepills?Did you also get 73 STM32F103s for $1 ?

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: February 24, 2021, 09:43:06 pm
content: Quote from: techman-001 on January 15, 2020, 12:40:05 amSeems like this thread has kept referring to the sophistication and Chinese fakes angle so I'll grab techman's open question. Someone has already written a book about the sophistication of the Chinese "fake" industry. Its not really fake, its more of a cultural thing in Chinese tech hub city. They have an equivalent to Open Source Hardware that the west has for Open Source software but its self regulated instead of protected by central bodies. All the proprietary/company eyes only documents are publicly posted in the city and anyone can get all the design documents and files. The expectation is you don't simply clone and resell cheaper trying to use the name and trademarks of the original designer or company but instead you are expected to take the design and improve upon it in some way in your variant. That could be cost reduction or it could be feature enhancements. To just try to clone and undercut the original will lead to blackballing ostracizing in the community and you'll get your access cut off.The book that opens up and explains the whole culture and industry in China is written by none other than Andrew "bunnie" Huang and is titled The Hardware Hacker, Adventures in Making and Breaking Hardware published 2017. He may have gone over this in his 2016 work titled The Essential Guide to Electronics in Shenzhen but I have not seen that work to comment on it. The Hardware Hacker was information enough to open a westerners eyes to what really goes on in Shenzhen hardware hacker culture enough to know that we woefully characterize the whole enchilada incorrectly or maybe correctly from a western eyes perspective.Now I have to figure out what to try and getto add a few STM32 to my collection, EDIT: kind of hard for me to decide or justify as I get ESP32s for $5.33 ea with 1 day shipping from Amazon in 3 packs.

author: techman-001
author_rank: Frequent Contributor
timestamp: February 24, 2021, 10:51:45 pm
content: My personal perspective ... if a MCU:* Is new in every way, then it is the "original of the type". Example STM32F1xx back in 2004.* Imitates the behavior of the original of the type, but is a clean new design and has a unique part number, then it's a CLONE. Example CS32F103 or CKS32F103 (are they the same chip?)* Has had the original part number removed and replaced with the part number and logo of the original of the type, then it's a FAKE.The whole BluePill issue came about because of FAKES. If those Chinese manufacturers/seller had sold CLONES instead and waited until the market accepted them, then they would have had their own home grown, massively popular, cheap product without the distrust and suspicion that now exists. Short term thinking for a quick buck, not very smart.That suspicion and distrust is now ingrained in Western buyers who have lost all faith in ordering anything from China because they have been ripped off before, possibly multiple times.Western buyers don't care what excuses a liar gives for selling them FAKES, they won't forget nor will they buy there again.I personally only buy from the USA now, where my MCU's come in dated, sealed aluminumized bags with color coded moisture detecting cards and chain of supply data. My preferred supplier is Arrow.com who also have free UPS economy shipping over a certain amount and their prices are more than reasonable. I'm in Australia and usually receive my parts within a week, which is incredible here.

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: February 24, 2021, 11:17:37 pm
content: When I lived in Oz I faced the same problems so understandable. Unfortunately US suppliers are buying up fakes too. Even the military has fakes issues since 2011 when refurbished Boeing P-8 Poseidons had key systems failing during a bad refurbishment. Some of the Chinese chips are refurbished, removed from e-waste as western countries use China as an e-waste shipping destination. The others are factory rejects and prototype runs that are bough on the cheap from the scrap heap before being processed as scrap. There is also a large push in China to create pin-compatible pats as supply chain defense against being pulled from access to western technology. Or remarking engineering samples. We all started feeling this with the whole fake SD cards that seemed to flood everywhere, especially on flea-bay. The intensive is money, any individual buyer or manager for an otherwise legitimate tech company in China would effectively double their take-home pay each month if they could pull off this cheat without getting caught. Even FPGAs have been hit. On the more legitimate side when Chinese companies assemble products with components they can specify contractually just as Western companies do the acceptable failure rate, etc. for orders from suppliers. Some Chinese companies order with a high failure rate as that shifts the financial costs of testing the components on the buyer but instead of doing QC on purchased components they find it cheaper to use the components as is directly on the finished products as they see it as cheaper to simply replace a defective unit for a given customer with another unit. This happened a lot in Chinese mobile phones, not sure if they still do this today. The only way forward seems to find someone you trust and then when you experience aberrant behaviour decap and investigate whats hidden beneath the packaging.Edit: the Chinese culture words if anyone is curiousGongkai culture and the Shanzhaihttps://www.bunniestudios.com/blog/?cat=20

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: February 25, 2021, 01:18:38 pm
content: Yes, most of them have counterfeit MCUs on them.I've encountered some fake STM32s that have a silicon bug that causes the timers to work differently from the original. Timers run at double the speed with the same clock divider settings when compared to a genuine STM32. Others were clearly fakes with poorly made packages, but worked as expected.With the current lead time problems, expect to see more fake parts on the market.

author: dreamcat4
author_rank: Frequent Contributor
timestamp: February 25, 2021, 01:46:13 pm
content: Well I didn't want to chime in earlier. Because you guys were having such a very interesting discussion about Chinese manufacturing practices! But since you have now covered that. I guess it might be OK to maybe redirect this conversation a wee bit. Here is my viewpoint:Well even if you get a genuine STM32F103, it still has about 42 pages of errata. Quite a few hardware bugs. Mostly conflicts around the IO peripherals. And similar stuff like that. This can be frustrating to lookup in the docs and 'be aware of' while developing firmware. Which is of course that is purely for the official ST versions. In addition and extra to any of the other unexpected bugs for being one of the clones / faked ones.So even if genuine, i would instead 'generally recommend' the black pill (=stm32f4) these days. Over the older, more buggy f103.Apparently ST redid the IO blocks in the f4. And made that part a lot better. Although I have not looked into the details myself. Surely it would then have a much shorter errata document? It would make sense to check / compare that.Ah but you say: well the F103 is cheaper! The F4 costs more. But it seems there is a cheaper version of the official f4 from places like digikey and the other reputable suppliers. For about $2.50 a pop. So those 'low end' F4 part (usually 48 pin). Are probably supposed to deprecate and replace the older f103. And be like a substitute part. Especially if it's saying 'f103 is no longer manufactured anymore'. And they seem to cost tons more now anyway. The official F103s.What else?Very interested in hearing if these newer F4 chip on '$3 Chinese black pill' are also counterfeit chips. Or re-lasered rejects / whatever. Nice to find out more about these possible f4 variations, if anybody else has a similar interest and knows more? Would love to hear about that. Many thanks.

author: techman-001
author_rank: Frequent Contributor
timestamp: February 25, 2021, 07:46:02 pm
content: Quote from: dreamcat4 on February 25, 2021, 01:46:13 pmI agree with you, the STM32F1xx was released in 2004, it was STMicro's first ever Cortex-M chip and I've been ranting that it shouldn't be used in new projects for years given the availability of much more recent mcu's. At 16 years of age it's been time to move on from the STM32F103 for quite a while.But there are still a couple of very good reasons for buying a cheap Bluepill board, (which don't seem to be as cheap as they once were anymore) :* Make a Black Magic Probehttps://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-bmp.html* Make a SWD/USB programmerhttps://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-stlink-programmer.html#bluepill-stlink-v2-programmer-debuggerPersonally I use the STM32F051 for most things and I'm playing around with some STM32F746's at the moment. A STM32H7xx will get you a clock speed of nearly 500 MHz and so on.I think those frontier days of the "bluepill" gold rush are over now and the gold has all petered out.Talking about the STM32F1xx I/O blocks, the GPIO configuration is unique among the STM32 MCU range. They changed it for everything else and me, who learnt the STM32F051 (Cortex-M0) first, seeing the F103 GPIO doc for the first time was a real WTF! moment.The STM32F1xx Port Configuration Register documentation is very confusing which has caused a lot of people to write code to try and make it manageable. In a way it's a bit of a cruel joke.I realized recently that the STM32F1xx Port Configuration Register could be simplified by rewriting the MODE and CONF Bitfields into one Bitfield named “MODER”.When this is done a simplified truth table becomes obvious giving seven simple GPIO config options:-Code:MODER-xFunction0000input, analog0001output, push-pull, 10 mhz0100input, floating0101output, open-drain, 10 mhz1000pulldown ODR = 0 pullup ODR = 11001output, alt func, push-pull, 10 mhz1101output, alt func, open-drain, 10 mhzFor the full story (warning: some small amounts of Forth code) see.https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill/bluepill-gpio/doc/readme.html

author: Topazio
author_rank: Newbie
timestamp: June 02, 2022, 05:16:01 am
content: Quote from: I wanted a rude username on January 12, 2020, 10:33:35 amYes the most are clones, and they do work for the most, I don't know why the clones they don't work with the HID bootloader..If you are lucky you will have a legit clone marked CKS32F103C8T6 or CKS32F103CBT6 these microcontroller are from a Chinese company that payed the royalties to make the clone according to SMT projects...They work 100% I used these in many projects especially when the semiconductor market went to crisis due to CovidYou may read this about cloneshttps://hackaday.com/2020/10/22/stm32-clones-the-good-the-bad-and-the-ugly/

author: grantb5
author_rank: Regular Contributor
timestamp: June 02, 2022, 03:42:33 pm
content: Interesting about the CKS parts. I think the parts shortage is still going on quite strongly. Where did you source the CKS parts? I would like to give one a shot.

author: mon2
author_rank: Frequent Contributor
timestamp: June 03, 2022, 01:26:32 pm
content: We chased the CKS brand for a while through Alibaba. Many advertise the part but then want $6-$8 USD for the part that sells for $0.80 USD in Shenzhen. Do not blame the middle agent from making a profit but 10x ?? They can keep it. The vendors who probably meet to lock the market together said 'go to ST and check their pricing'.I think a trick is to seek out a local in the Shenzhen / China market and hire them to negotiate a 'Chinese' price.Locally in North America, Gigadevices / Geehy are claiming the CKS are illegal and blatant copies of the ST IP so not sure on the legality of using in a product. We attempted to buy some boards to test but magically, they were not shipped out and Aliexpress gave us a refund. Perhaps just bad covid-19 luck.In the meantime we are wasting our limited braincells to use these alternate devices. While we do plan to use Gigadevices memory devices - brain dead simple to deploy, do not feel the same about the micros. We wanted a drag & drop DAP interface and thought it would be a few hours of fun to port over but so far, has not been the case. The vendor has a tool that is similar and supports the same features - for which no source code is available; even the binaries are not available to the public. What ?? No factory support as we see it. Do not want to invest months to use a sub-mainstream microcontroller and also at a fairly high cost as compared to ST. ST is just guilty of being too popular.If we are going to fight to use and code our own IP, we will spend our $$ on the devices we select and from who offers the support. Blind leading the blind will not take us very far.

author: Algoma
author_rank: Frequent Contributor
timestamp: June 03, 2022, 01:44:19 pm
content: I've long since replaced all my Bluepill inventory with far better documented and supported RP2040 Pico units. Plenty of availability and support, and there appears to even exist pin comptable boards to the old Bluepill layout.

author: GromBeestje
author_rank: Frequent Contributor
timestamp: June 03, 2022, 01:58:22 pm
content: Quote from: mon2 on June 03, 2022, 01:26:32 pmI did some testing on the clones again the other day. I am looking at ways to tell them apart. In order to do so, I decided to look at the "System ROM", containing the UART bootloader. My APM103 chips are from the days they were still ApexMic, but it turned out both my APM32 and CS32 contain an unmodified copy of the bootrom as found on an STM32F103CBT6. On other manufactures I have found other bootroms, GD32, HK32, and CH32 have different content in there.Current day Geehy APM32 might be different from ApexMic, but I doubt it. Both CS32 and APM32 contain ST's IP in the form of that bootloader. I have some Geehy parts ordered, but it might take some time to arrive, as the tracking information says it's stuck at customs.

author: robca
author_rank: Frequent Contributor
timestamp: June 03, 2022, 03:22:37 pm
content: For a hobbyist, the widely available STM32F401 and STM32F411-based "Black Pill" are a much better choicehttps://stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0.htmlThose cost around $3 each (plus shipping), are much more capable than a F103, use USB C connectors and, as far as I can tell, use genuine ST chips. Complete toolchain support even in Arduino. Only downside, apart from having to adapt any exiting code, is that those can't be easily made into an STLink like the Bluepill could. But there are plenty of STLink clones available, and the much better STLink 3.0 MODS from ST is less than $10 and a significant upgrade over the usual STLink clones

author: GromBeestje
author_rank: Frequent Contributor
timestamp: June 03, 2022, 07:40:18 pm
content: Yeah, we live in strange times, where an F4 Black Pill became cheaper then an F1 Blue Pill. Those Black Pills are nice indeed.But it's not only the code you need to adopt, the Blue Pill and Black Pill pinout also differ.When you have the USB port on the left, the top row of pins differ. Most important, the top left is GND on the Blue Pill and 5V on the Black Pill,

author: rthorntn
author_rank: Frequent Contributor
timestamp: November 25, 2024, 03:22:35 am
content: Quote from: profdc9 on June 23, 2020, 02:59:53 amI need a 128K CBT6 Blue-Pill for a eurorack modular build, is having some made the way to go in 2024?Thanks!

author: robca
author_rank: Frequent Contributor
timestamp: November 25, 2024, 05:17:38 pm
content: Quote from: rthorntn on November 25, 2024, 03:22:35 amLast time I checked (a few months ago) many Aliexpress sellers offered genuine STM Bluepills. Most sellers offered a choice of genuine STM or clones. These days, there's no problem finding genuine STM32 processorsThese days, though, unless you already have code written for a specific processor, I would look at the blackpills with the STM32F411 or even better the STM32G431. Much more powerful, and roughly same price

author: rthorntn
author_rank: Frequent Contributor
timestamp: November 26, 2024, 03:03:44 am
content: Thanks, could you provide a link to a seller that does both please?Yesterday I ordered 5PCS-STM32F103CB fromhttps://www.aliexpress.com/item/1005004918334754.html,they were only $4 each though, surely they can't be genuine, the CBT6 MCU alone on Digikey is more than that at quantity?I need this chip specifically as the HEX code is supplied by the module designer.

author: grantb5
author_rank: Regular Contributor
timestamp: November 26, 2024, 03:25:22 am
content: They are not expensive. I've had boards made at JLCPCB and the MCU was maybe $2.https://www.lcsc.com/search?q=STM32F103CBEdit: Where is the firmware? Dump the hex code and see if you really need all that space.

author: rthorntn
author_rank: Frequent Contributor
timestamp: November 26, 2024, 04:06:58 am
content: Is the LCSC stuff genuine though, $12 for 10, I mean digikey and mouser are $50 for 10, 4x the price, ask me how I know lol?

author: rthorntn
author_rank: Frequent Contributor
timestamp: November 26, 2024, 04:13:55 am
content: This is the firmware:https://sound-force.nl/wp-content/uploads/2019/12/braids.hex_.zipFrom this site:https://sound-force.nl/?page_id=3179It's a through-hole bluepill version of mutable braids.

author: grantb5
author_rank: Regular Contributor
timestamp: November 26, 2024, 09:32:16 pm
content: Very interesting. It does seem like you need the larger part.

author: grantb5
author_rank: Regular Contributor
timestamp: November 27, 2024, 01:57:09 pm
content: So, according to this video, and it seems plausible, the smaller STM32F1 part actually has the larger flash, it's just not tested/characterized as such.https://youtu.be/UQ76YSmVNnw?t=435This same video guy's previous video was on the PTH Braids module, and this Beaks/Peaks video is a followup to that.