2020-06-03 06:54 AM
Hi,
I have stm32f103rb nucleo board
i want to read/write a text file from flash space of the board.
Is there any example for implementing this c ode.
i am using stm32cube ide.
Regards,
Manjunath K S
2020-06-03 07:06 AM
There should be examples for fatfs and internal flash erase/write.
Is there working code you can directly copy, probably not so much.
Going to be relatively small and slow. Pick the block/sector size to match those of the F1 part.
2020-06-03 07:13 AM
Hi @Community member
i got exampoles for reading from sd card, i just want to read a text file for my application.
Regards,
manjunath
2020-06-03 07:24 AM
It is all just a collection of bytes at the end of the day. FatFs works very much like standard C file IO functions. Read a block or buffer full of data, and parse the ASCII data, break it into strings or whatever.
If you just need to output the content of a file and output to a UART, you could open, get length information, and then read a buffer full at a time, sending to the serial device until all the content is consumed and then closed.
2020-06-03 07:32 AM
Hi,
I am just new to this , as in c cant we use FILE pointer for reading the file, if so what will be location of the file in flash.
i am not able to find any sample code or so to figure out the exact steps.
Regards,
manjunath