From: Spencer O. <sp...@sp...> - 2012-07-18 15:56:40
|
On 18 July 2012 16:33, Laurent Charpentier <lau...@ya...> wrote: > Hi Everyone, > > I would like to write to the OTP (One Time Programmable) memory of the STM32F2 thru openocd. > > The OTP is part of the Flash according to the reference manual (RM0033 Reference manual from ST). The OTP_START_ADDR is 0x1FFF7800. However the OTP memory is not considered as a memory bank (memory banks are used to store programs - range is 0x0800 0000-0x080F FFFF). > > I tried to write to the OTP memory using: > set OTP_START_ADD 0x1FFF7800 > set foo [format "%02X%02X%02X%02X" 0 111 111 102 ] # this is string "foo" > flash fillw $OTP_START_ADD $foo 1 > > and openocd return the following error: > "No flash at address 0x1fff7800" > > Looking at the source code for "src/flash/nor/core.c" I saw that the "flash fillw" is coded in a way that only addresses within one of program banks can be used (i.e. 0x0800 0000-0x080F FFFF). > > Question: how to write to OTP thru openocd? > I am afraid it is not currently supported for the stm32f2x driver, even writing the options is not supported. If you fancy having a go then have a look at the stm32ff1x driver as a reference. Cheers Spen |