2011-01-29 05:51 AM
flash read and write (urgent)
2011-05-17 05:23 AM
There is a good example within Keil, and probably IAR too
C:\Keil\ARM\Examples\ST\STM32F10xFWLib\Examples\FLASH\Program\main.c FLASH_ClearFlag(FLASH_FLAG_BSY | FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR); FLASHStatus = FLASH_ErasePage(0x08002000); FLASHStatus = FLASH_ProgramWord(0x08002000, 0x12345678); Reading is just like any other memory, set a pointer to it and read, nothing magic. u32 *mem = (u32 *)0x08002000; printf(''%08X\n'', *mem);2011-08-24 05:50 AM
Hi,
My question is related to this thread. I want to store user data into flash and read it on power up. I suppose I can use the example you give to read and write, but my question is why did you choose memory address 0x08002000 ? Is that some random address? Where do I find the right address for storing data? I have STM32F103RBT6 (which says 128k flash). In the Keil MDK of the example, I see in the configuration that the read/only memory area is from IROM1: 0x8000000 and size 0x20000. Also the read/write memory area is from IRAM1 0x20000000 and size 0x5000. Thank you in advance. Antonis2011-08-24 08:09 AM
The 0x08002000 is an arbitrary address that works for pretty much the entire STM32 range. It may well have been picked by the original poster, but one of the forum crashes may have eaten the post, at least based on the timestamps. You can put your data anywhere you want. You should/could also shrink the space that Keil thinks it has available to protect the area you want to use.
For example shrink the allocation to 0x1F000 from 0x20000, and then use 0x0801F000 to store user data (up to 4KB in this example)2011-09-22 07:49 PM
now with something new error
.\Release\STM32F10x.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.i am using this exampleC:\Keil\ARM\Examples\ST\STM32F10xFWLib\Examples\FLASH\Program\main.c