Its no surprise that Bluepills, such as they were, a smoking sub $2 deal would dry up eventually, taken over by clones, some subtle, some overt. With supply issues still plaguing ST parts for hobbyists, what about these cheap Chinese clone parts? Lets dive into the Air32F103.
I bought 5 of these $1.90 boards. They look like this:
Some notables vs a stock bluepill:
1) Castellated pins with flat underside for use as a module
2) 3 LEDs R/G/B (vs just the G for a bluepill)
3) Clone of ST's peripherals
4) over clockable to 256Mhz (spec is 216Mhz) (original STM32F103CB is 72Mhz)
5) 32K of ram. But, via secret regs, 97K(!)
6) top and bottom debug pads, top for JLINK, bottom, legacy STLINK SWD
7) USB C vs USB mini
8) BOOT as a button vs jumper
9) 2 12bit DACs (STM32F103CB's don't have that)
10) QSPI (hidden support)
11) Undocumented crypto block from MegaHunt (includes: AES/DES/3DES/SHA/SM[1,3,4,7])
As mentioned 256Mhz is possible. One Q is how do they do that? Well, PLLMUL is a 4bit field so 8Mhz * 16 gets a max of 128Mhz. A new bit, bit28 of RCC.CFGR adds 16 to the MUL. So, 31(+1) gets 256Mhz.
So, if you do set that, the code will crash with a usage fault. There is secret code called in the ROM that flips a hidden bit to allow high speed operation (the SysFreq_Set code below)
The RCC init code from:
Here we see the 97K unlock:
In my Ada code, I flip the lock but seem to fail to revert it back.. leaving 97K available.
The magic reg to allow for high speed op is as follows:
-- Hidden system reg block --
-- w/o this.. 216Mhz progs don't run (usage fault) --
Magic_Reg := Magic_Reg or 1;