Skip to main content
CMura.2
Associate II
June 30, 2021
Question

Hi, please where can I find any example how to open/write/read a file in the flash for the stm32l4?

  • June 30, 2021
  • 7 replies
  • 1271 views

..

This topic has been closed for replies.

7 replies

waclawek.jan
Super User
June 30, 2021

What FLASH?

JW

Uwe Bonnes
Chief
June 30, 2021

A "file" is quite a complex concept. What kind of file do you mean?

CMura.2
CMura.2Author
Associate II
June 30, 2021

txt file

Tesla DeLorean
Guru
June 30, 2021

Just one, of manageable size, perhaps carve some space in the upper reach of the internal flash sectors, store the data, provide means to erase/write new content.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Tesla DeLorean
Guru
June 30, 2021

STM32Cube_FW_L4_V1.16.0\Projects\32L4R9IDISCOVERY\Applications\FatFs\FatFs_uSD_Standalone ??

STM32Cube_FW_L4_V1.16.0\Projects\32L496GDISCOVERY\Examples\FLASH\FLASH_EraseProgram

STM32Cube_FW_L4_V1.16.0\Projects\32L496GDISCOVERY\Examples\FLASH\FLASH_FastProgram

Internal Flash, probably no, its not how people generally approach the problem.

You can create resource trees, or file system type structures, and put them in memory permanently, perhaps wrapping them with file system type access functions to make porting easier.

Perhaps look at MKFSDATA type tools used by LWIP, or similar tools, to create a faux web server

If needing an actual file system, perhap FATFS onto MicroSD cards, or eMMC chips.

Can be done with QSPI NOR Flash, or NAND/NOR Flash generally, but you get to own a lot more of the fine details.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..