Unique device ID (and flash size)

Post your cool example code here.
simonf
Posts: 180
Joined: Sun Jul 26, 2015 4:03 pm

Re: Unique device ID (and flash size)

Post by simonf » Tue Jul 26, 2016 4:52 pm

madias wrote:Hm. My first thinking about an unique ID is setting up a NRF24L01 network and every node is the ID, so you wont have to think about different node names. I just hope that "our" STM32F01 are really *unique* and not chinese clones with the same ID :)

I would probably use the last 16bits as my unique ID there is a 1 in 65000 chance of two having the same id. I remember once a customer of mine struggling with a large network only to find he had two network cards with the same mac address on his network.

alexandros
Posts: 19
Joined: Mon Oct 02, 2017 6:51 pm

Re: Unique device ID (and flash size)

Post by alexandros » Sat Oct 07, 2017 9:26 pm

can the unique device ID be changed programmatically? i mean replaced-overwritten

User avatar
martinayotte
Posts: 1222
Joined: Mon Apr 27, 2015 1:45 pm

Re: Unique device ID (and flash size)

Post by martinayotte » Sun Oct 08, 2017 2:30 pm

Nope !

alexandros
Posts: 19
Joined: Mon Oct 02, 2017 6:51 pm

Re: Unique device ID (and flash size)

Post by alexandros » Sun Oct 08, 2017 10:10 pm

Great!

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

Re: Unique device ID (and flash size)

Post by victor_pv » Sun Oct 08, 2017 11:43 pm

If I remember right there is some write once bytes, so you can program your own ID.
Can't remember it for certain though.

dannyf
Posts: 140
Joined: Wed May 11, 2016 4:29 pm

Re: Unique device ID (and flash size)

Post by dannyf » Mon Oct 09, 2017 11:58 am

I use a macro to do it all:

Code: Select all

#define U_ID			((const unsigned short *) 0x1FFFF7E8)		//U_ID95..0, referenced via U_ID[0], ..., U_ID[5]
The address actually flows from chip to chip so you will need to be aware of it. you can certainly condition it on the target chips.

It is meant to be used as an array of char, not a c-styled string - there is no assurance that it is null-terminated.

alexandros
Posts: 19
Joined: Mon Oct 02, 2017 6:51 pm

Re: Unique device ID (and flash size)

Post by alexandros » Sat Oct 14, 2017 11:02 am

Hey Good day to ya all

Id like to ask something about the flashSize of STM32F103CB
based on the demo code Roger Provided in first post , i got a size of 64K Flash

Now the funny part.
(i set into the arduino IDE variant:STM43F103CB 64K as i should)

I got a sketch that uses 97% of Flash size. , i pushed some extra nonse code to get to the maximum size so i got this beautiful msg
region `rom' overflowed by 5604 bytes

SO i changed the arduino IDE variant:STM32F103CB FROM 64K TO 128K and i gave it a shot
And it worked. :shock: :shock: :o

I also test it with a very large Array with values that checked one by one in a loop and returned me the correct results..


The question is : Is this normal dehavior? does the chip include 128K flash ?? and why i got 64K from the demo code?

dannyf
Posts: 140
Joined: Wed May 11, 2016 4:29 pm

Re: Unique device ID (and flash size)

Post by dannyf » Sat Oct 14, 2017 1:42 pm

This has been discussed to the nth degree. Many of those chips have more flash, more eeprom, more features than those specified in the datasheet and by the on device registers.

It is normal in that they are wide spread. It is not normal in that they are not in compliance with the datasheet.

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

Re: Unique device ID (and flash size)

Post by victor_pv » Sat Oct 14, 2017 7:03 pm

In fact if the MCU is "STM32F103CB" as you wrote, that should have 128KB according to the specs.
The STM32F103C8 (note is a number 8 not upper case b) is supposed to have only 64KB.

So if you have a CB with 128KB, you are exactly within specs.
If you have a C8 with 128Kb, then as Dannyf pointed is common.

Post Reply