Example: stock market

UM1721 User manual - st.com

June 2014 DocID025800 Rev 21/26UM1721 user manualDeveloping Applications on STM32 Cube with FatFsIntroductionThe STMCubeTM initiative was originated by STMicroelectronics to ease developers life by reducing development efforts, time and cost. STM32 Cube covers the STM32 Version includes: The STM32 CubeMX, a graphical software configuration tool that allows to generate C initialization code using graphical wizards. A comprehensive embedded software platform, delivered per series (namely, STM32 CubeF4 for STM32F4 series) The STM32 Cube HAL, an STM32 abstraction layer embedded software, ensuring maximized portability across STM32 portfolio A consistent set of middleware components such as RTOS, USB, TCP/IP, Graphics All embedded software utilities coming with a full set of File System is the way in which files ares named and where they are placed logically for storage and retrieval.

June 2014 DocID025800 Rev 2 1/26 UM1721 User manual Developing Applications on STM32Cube with FatFs Introduction The STMCubeTM initiative was originated by STMicroelectronics to ease developers life by

Tags:

  Manual, User, User manual

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of UM1721 User manual - st.com

1 June 2014 DocID025800 Rev 21/26UM1721 user manualDeveloping Applications on STM32 Cube with FatFsIntroductionThe STMCubeTM initiative was originated by STMicroelectronics to ease developers life by reducing development efforts, time and cost. STM32 Cube covers the STM32 Version includes: The STM32 CubeMX, a graphical software configuration tool that allows to generate C initialization code using graphical wizards. A comprehensive embedded software platform, delivered per series (namely, STM32 CubeF4 for STM32F4 series) The STM32 Cube HAL, an STM32 abstraction layer embedded software, ensuring maximized portability across STM32 portfolio A consistent set of middleware components such as RTOS, USB, TCP/IP, Graphics All embedded software utilities coming with a full set of File System is the way in which files ares named and where they are placed logically for storage and retrieval.

2 Its primary objective is to manage access to the data of files, and to manage the available space of the device(s) which contain it. Using a file system allows user to ensure reliability and to organize data in an efficient user manual is intended for developers who use STM32 Cube firmware on STM32 microcontrollers. It provides a full description of how to use the STM32 Cube firmware components with a generic FAT File System (FatFs); this user manual comes also with description of a set of examples based on common FatFs provided refer to the release notes of the STM32 Cube firmware package to know the version of FatFs firmware component document is applicable to all STM32 devices; however for simplicity reason, the STM32F4xx devices and STM32 CubeF4 are used as reference platform.

3 To know more about supported physical media disk and the examples implementation on your STM32 device, please refer to the readme file provided within the associated STM32 Cube FW Rev 2 ContentsAcronyms and definitions .. 61 FAT File System overview .. overview .. Boot Record .. partitions .. license .. 82 FatFs File System .. overview .. architecture .. license .. features .. file access .. file name .. APIs .. low level APIs .. into STM32 CubeF4 .. () .. () .. () .. your own disk to FatFs .. 163 FatFs applications .. drivers configuration.

4 File System configuration .. file name .. sample application .. 214 Conclusions .. 23 DocID025800 Rev 23/26UM1721 Contents35 FAQ .. 246 Revision history .. 25 List of tablesUM17214/26 DocID025800 Rev 2 List of tablesTable and definitions .. 6 Table 2."Diskio_drv_TypeDef" structure .. 14 Table 3."Disk_drv_TypeDef" structure.. 14 Table of FatFs middleware utilization .. 19 Table revision history .. 25 DocID025800 Rev 25/26UM1721 List of figures5 List of figuresFigure level view of an MBR .. 7 Figure FAT partitions on a device .. 8 Figure architecture .. 10 Figure license.

5 11 Figure Middleware module architecture.. 14 Acronyms and definitionsUM17216/26 DocID025800 Rev 2 Acronyms and definitionsTable 1. Acronyms and definitionsAcronymDefinitionANSIA merican National Standards InstituteAPIA pplication Programming InterfaceBPBBIOS Parameter BlockBSPB oard Support PackageCPUC entral Processing UnitCMSISC ortex Microcontroller Software Interface Standard DBCSD ouble Byte Char StringDOSDisk Operating SystemEFIE xtensible Firmware InterfaceFATFile Allocation TableHALH ardware Abstraction TableLFNLong File NameMBRM aster Boot RecordMSDM icro Secure DigitalOEMO riginal Equipment ManufacturerRAMR andom Access MemoryRTCReal Time ClockRTOSReal Time Operating SystemSDSecure DigitalSDRAMS ynchronous Dynamic

6 Random Access MemorySFNS hort File NameSRAM static Random Access MemoryUSBU niversal serial BusDocID025800 Rev 27/26UM1721 FAT File System overview251 FAT File System FAT overviewThe File Allocation Table (FAT) file system was developed by Bill Gates and Marc McDonald. It is a format and some software which stores and organizes files on a storage device, such as a disk drive or a memory device. It is used to facilitate access to files and FAT file system provides a way to time stamp when a file is created or changed and provides a way to identify the size of the file. This system provides a mechanism to store other attributes of a file, such as whether a file is read-only, whether the file should be hidden in a directory display, or whether a file should be archived at the next disk FAT file system is ideal for removable Flash media used in consumer electronic devices, such as digital cameras, media players and Flash FAT file system can be helpful in the following scenarios.

7 Due to the backward compatibility of the FAT file system, users can employ memory stick media or floppy disks to transfer files between a consumer electronic device and a computer that uses an outdated operating system; The FAT file system lets users quickly remove files from electronic devices, as in professional broadcast media; The file system versions, FAT16 or FAT32, may be suitable for a hard disk drive versions would also be useful to a user who wants to boot a computer by using a floppy disk to access data (typically, system recovery tools) on a hard disk drive Master Boot RecordThe Master Boot Record (MBR) is located on one or more sectors at the physical start of the device.

8 The boot region of the MBR contains DOS boot loader code, which is written when the device is formatted (but is not otherwise used by the Dynamic C FAT file system). The partition table follows the boot region. It contains four 16-byte entries, which allow up to four partitions on the device. Partition table entries contain some critical information: the partition type (Dynamic C FAT recognizes FAT12 and FAT16 partition types) and the partition's starting and ending sector numbers. There is also a field denoting the total number of sectors in the partition. If this number is zero, the corresponding partition is empty and 1.

9 High level view of an MBR Z W W W W ^ d d d d d & d D Z D Z LJW d FAT File System overviewUM17218/26 DocID025800 Rev 2 Some devices are formatted without an MBR and, therefore, have no partition table. This configuration is not currently supported in the Dynamic C FAT file FAT partitionsThe first sector of a valid FAT file system partition contains the BIOS Parameter Block (BPB), followed by the File Allocation Table (FAT), and then the Root Directory. The figure below shows a device with two FAT 2.

10 Two FAT partitions on a deviceBIOS Parameter BlockThe fields of the BPB contain information describing the partition: The number of bytes per sector; The number of sectors per cluster; The total count of sectors on the partition; The number of root directory Allocation TableThe file allocation table is the structure that gives the FAT file system its name. The FAT stores information about cluster assignments. A cluster is either assigned to a file, is available for use, or is marked as bad. A second copy of the FAT immediately follows the first directoryThe root directory has a predefined location and size.


Related search queries