cancel
Showing results for 
Search instead for 
Did you mean: 

How to program the FLASH_OPTR register in stm32G0B1KE through i2c in-application programming?The offset mentioned as 0x020 for FLASH_OPTR register.what is the offset referred here?

VSoun.1
Associate II

How to write the register values using offset address in flash memory?what is the base address to consider for offset values?

4 REPLIES 4

It's the off the base address of the FLASH peripheral within the ARM's 4GB address space. Perhaps search source for FLASH or USART3 to find their address. Likely to be in DM or RM docs for part. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
VSoun.1
Associate II

If FLASH register's offset[ex:FLASH_OPTR offset:0x020] refers from the address of Flash memory,writing the user code in flash memory starting address [0x08000000] will overwrite the existing flash registers data?

KnarfB
Principal III

Just saw your other post. See reference manual RM0444 Rev 5:

0x1FFF 7800 - 0x1FFF 787F 128B Option bytes

0x0800 0000 - 0x0807 FFFF 512KB Main Flash memory

0x4002 2000 - 0x4002 23FF 1KB FLASH <-- register block

hth

KnarfB

VSoun.1
Associate II

Thanks for the reply.

So the flash registers use the AHB FLASH address[0x4002 2000] as the base address for read/write.I tried to read the flash registers using the base address of 0x40022000 through i2c.I received NACK.How to read and write flash registers using i2c programming?