BluePill and Friends - Flash size info

Generic boards that are not Maple or Maple mini clones, and don't contain the additional USB reset hardware
Post Reply
User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

BluePill and Friends - Flash size info

Post by Pito » Thu Mar 09, 2017 7:13 pm

Hi,
could somebody try to run the below code on a BP or friends?
It shall return the on-chip information on the flash size.
Interested to see whether there are BP C8 chips returning 128kB.
My BP is returning 64 and MapleMini 128.

Code: Select all

// STM32Fxxx Flash size from on-chip HW ID 
#define FLSHSIZE_ID_F1    0x1FFFF7E0
// #define FLSHSIZE_ID_F4    0x1FFF7A22
// #define FLSHSIZE_ID_F7    0x1FF0F422
// #define FLSHSIZE_ID_L0    0x1FF8007C
void setup() {
 Serial.begin(115200);
 // wait on USB
 while(!Serial.isConnected()); 
 int flashsize = (*(int*)FLSHSIZE_ID_F1 & 0xFFFF);
 Serial.print("Chip Flash Size [kB]= ");
 Serial.println(flashsize);
}
void loop() {
}
Last edited by Pito on Thu Mar 09, 2017 8:00 pm, edited 6 times in total.
Pukao Hats Cleaning Services Ltd.

User avatar
Rick Kimball
Posts: 1038
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: BluePill and Friends - Flash size info

Post by Rick Kimball » Thu Mar 09, 2017 7:37 pm

red pill ...

Chip Flash Size [kB]= 64

chip marking

stm32
f103c8t6
990MY 9U
MYS 450
-rick

victor_pv
Posts: 1681
Joined: Mon Apr 27, 2015 12:12 pm

Re: BluePill and Friends - Flash size info

Post by victor_pv » Thu Mar 09, 2017 8:33 pm

Pito wrote:Hi,
could somebody try to run the below code on a BP or friends?
It shall return the on-chip information on the flash size.
Interested to see whether there are BP C8 chips returning 128kB.
My BP is returning 64 and MapleMini 128.

Code: Select all

// STM32Fxxx Flash size from on-chip HW ID 
#define FLSHSIZE_ID_F1    0x1FFFF7E0
// #define FLSHSIZE_ID_F4    0x1FFF7A22
// #define FLSHSIZE_ID_F7    0x1FF0F422
// #define FLSHSIZE_ID_L0    0x1FF8007C
void setup() {
 Serial.begin(115200);
 // wait on USB
 while(!Serial.isConnected()); 
 int flashsize = (*(int*)FLSHSIZE_ID_F1 & 0xFFFF);
 Serial.print("Chip Flash Size [kB]= ");
 Serial.println(flashsize);
}
void loop() {
}

I believe a C8 MCU will return 64KB even if it has 128KB. Will be interesting to see if there is any c8 that returns 128KB though.

I have several c8, RC and RF boards, they return the size according to spec, but I have confirmed them to have the maximum flash for the series:
MCU Reported Actual
C8 64KB 128KB
RC 256KB 512KB
RC(ram) 48KB 64KB
RF 768KB 1MB

That's what I got on mine, but I have not tested every single board I have of each, I normally order 2 or 3 of the same just in case something arrives broken or breaks later.

Joe Crabhammer
Posts: 2
Joined: Tue May 16, 2017 4:44 am

Re: BluePill and Friends - Flash size info

Post by Joe Crabhammer » Tue Jun 20, 2017 9:42 am

I'm pretty sure we're dealing w/ counterfeit devices from Chinese foundries who've used the same die for both c8 and cb. I have some bluepills that are 64k and others that are 128k. I wouldn't bet on any of them using genuine devices.

Post Reply