1

I want to declare 4 large arrays of each can store 48000 float_32 constants.

I am using STM32F4, so i figured out ram isnt enough and i should use flash instead. Upon my research, seems like everyone is talking about one should never use flash for write/read processes on runtime, go for eeprom instead. I am aware of the risks, but why do 1mb flash memory is in there if i should never use it? What is it used for?

On my real problem, i just want to be able to write and generate a sampling array and write it on flash for once the device is initialized, and never be touched again. It is safe this way, but I can't find any useful and easy to understand tutorials anywhere for writing on flash. Is it forbidden? Should we not use 1mb of huge space available on the chip? Please point me to a nice tutorial on writing/reading STM32F4 flash.

Can Uysal
  • 43
  • 1
  • 6
  • 1
    Reading the flash is like reading from the memory: just use the flash address. Writing the flash is basically `HAL_FLASHEx_Erase` + `HAL_FLASH_Program` (+lock/unlock). STM32 firmware package contains FLASH_EraseProgram code sample, about 20 code lines. Quite enough to implement your own functionality. – Alex F Aug 20 '18 at 12:33
  • i will check it out, thanks alex. – Can Uysal Aug 20 '18 at 21:30
  • there is an answer for this question here. You can check it out. https://stackoverflow.com/questions/44443619/how-to-write-read-to-flash-on-stm32f4-cortex-m4/44855815#44855815 – Gürtaç Kadem Nov 29 '18 at 04:36

0 Answers0