cancel
Showing results for 
Search instead for 
Did you mean: 

[STM32F2xx] FLASH_ProgramOTP implementation?

root
Associate II
Posted on July 15, 2011 at 16:16

Hello,

Going through file stm32f2xx_flash.c, line 620 there is a mention to function FLASH_Status FLASH_ProgramOTP(uint32_t Address, uint32_t Data) but there seems to be no implementation of it ...

As there seems to be no unique device ID in the STM32F2xx (what a pity :( ) I'll need to use the OTP to store a crafted unique id.

Has this function an implementation somewhere, or will I need to implement it myself (which should not be a problem, but I'd prefer to have a supported implementation).

Regards,

Thomas.

PS : having no unique ID is a pity security wise ... I mean if someone can copy my code, and can put it into a new STM32F2xx chip and write the same OTP data, it will run. With unique ID written in factory, you can prevent the code from running if the unique ID is not the one expected, the copier will have to find a chip with the same unique ID to make it run, what is virtually impossible.

2 REPLIES 2
Posted on July 15, 2011 at 17:14

With unique ID written in factory, you can prevent the code from running if the unique ID is not the one expected, the copier will have to find a chip with the same unique ID to make it run, what is virtually impossible.

 

Then again, if you're smart enough to pull the code off, you're certainly smart enough to patch the code to ignore the check, or pass back what's expected. If the processor can read the ''Unique ID'', assume you're adversaries can too.

The way to provide more protection would be to put the key in memory which is destroyed by the tamper detection.

You should really pull a copy of the system rom from a couple of parts, and confirm whether they are different or not. The wafer data and other OTP stuff programmed into the STM32F1 parts at the back end of the ''ROM'' would seem to be too useful to have been totally discarded.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Gawie
Associate II
Posted on July 15, 2011 at 17:23

As there seems to be no unique device ID in the STM32F2xx (what a pity :( )

The STM32F2xx definitely has a unique ID - see RM0033 section 33.1 

Unique device ID register (96 bits)