Skip to main content
sne_123
Associate III
July 8, 2019
Question

Store text file in stm32 flash

  • July 8, 2019
  • 5 replies
  • 2499 views

How can we store a text file into stm32f103 flash memory and read its contents??

This topic has been closed for replies.

5 replies

Ozone
Principal
July 8, 2019

Define "read its contents".

You can embed the text as constant string/data into the source code.

You can implement a file system (like FatFS) to access a portion of the internal flash.

sne_123
sne_123Author
Associate III
July 8, 2019

sorry but I dint get what you said. How to embed the text as constant string/data into source code???

Also I don't want to implement FatFs . Is there any other way??

After Forever
Senior III
July 8, 2019

> How to embed the text as constant string/data into source code???

static const char *some_text = \
 "Hello world\r\n" \
 "Line 2\r\n" \
 "Line 3\r\n";

Tesla DeLorean
Guru
July 8, 2019

One could also use a simple tool to convert a file into a .H file you could include into your project.

A more complex tools could perhaps that the file and create an object file the linker to pull in.​

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