Filesystem demo 1.0
File system test
Filesystem-demo-1.0.zip (18 KB)
|Code size:||6 Kb
|Source files included:||yes
|Use circleOS:||yes (4.6)
||Creation date:||2013-07-26 15:52:21
||Modification date:||2013-07-26 16:33:17
|Based on the STM32 Primer:||All
||Average ratings:||0/5 (0 rates)
This application shows how to implement the new CircleOS API to manage files with the new FatFS file sytem :
- copy files,
- compares files,
- gest the file size,
- cheks the end of file,
- gets strings....
The application also shows how to use the "UTIL_SaveScreenBMP" API function, in order to create screenshots on the SD Card in BMP format file.
The project contains one application by platform, sharing the same source file (application.c), that allows to program and debug all corresponding platforms:
- EvoPrimer STM32E,
- EvoPrimer STM32G,
- EvoPrimer STM32C,
- EvoPrimer STM32L,
- EvoPrimer STM3240G.
Select your platform by clicking on the corresponding application in the project tree, then clik on mouse right button and choose "Set as Startup application".
The application calls alternatively two procedures : CopyTest (copy file), and ReadWriteTest (write read and display infos).
Copy files :
The application copies periodically a file, displays the size of the destination file, thanks to the API functions :
Default values : source file = "Original.txt", destination file = "Copy.bak", size : 362 bytes.
Read and write file:
The application writes and reads periodically into a file:
- writes a block of 100 characters into the file,
- tests the end of the file,
- reads back the block,
- compares the read block versus the written block,
- moves to the precedent block in the file,
- reads a string,
- moves to the next block,
- repeats for 100 blocks,
- finally displays the size of the file.
This is done thanks to the API functions :
Default configuration : Default values : "FileTest.txt", size : 10000 bytes.
Push the button to stop.
- The "Evo_Circle_STM32x.elf", "FAT.elf" and "FAT_OP4.elf" files location depends on your Ride installation; delete them from the projet and add it back before building the project.
- This example runs on all platforms that have an SD Card port : Primer2 and EvoPrimer.
- The screenshots have been made thanks to the "UTIL_SaveScreenBMP" API function.
- For more information about the FS API's, see : Circle OS Conception document