A file system which can mount, read, and enumerate a file system image which has been appended to the compiled .bin code file before being uploaded to the mbed device.

FLASH File System

This file system can mount, read, and enumerate a file system image which has been appended to the compiled .bin code file before being uploaded to the mbed device. I wrote a utility called fsbld to create images that can be used with this file system. This GitHub repository contains the sources for that utility.

To get the file system image onto the mbed device, you need to concatenate your binary from the compiler with the file system image binary.

  • On *nix this can be done with the cat command. For example:
    cat Test_LPC1768.bin FileImage.bin >/Volumes/MBED/test.bin
  • On Windows this can be done with the copy command. For example:
    copy Test_LPC1768.bin + FileImage.bin e:\test.bin
Committer:
frankvnk
Date:
Sun Apr 05 10:04:44 2015 +0000
Revision:
2:ca35ecd2fae6
Parent:
1:a3cb118c4f6e
2 options added: The ability to include a header file containing the binary file system image built with fsbld and the ability to set the system flash size.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AdamGreen 1:a3cb118c4f6e 1 /* Copyright 2011 Adam Green (http://mbed.org/users/AdamGreen/)
AdamGreen 1:a3cb118c4f6e 2
AdamGreen 1:a3cb118c4f6e 3 Licensed under the Apache License, Version 2.0 (the "License");
AdamGreen 1:a3cb118c4f6e 4 you may not use this file except in compliance with the License.
AdamGreen 1:a3cb118c4f6e 5 You may obtain a copy of the License at
AdamGreen 1:a3cb118c4f6e 6
AdamGreen 1:a3cb118c4f6e 7 http://www.apache.org/licenses/LICENSE-2.0
AdamGreen 1:a3cb118c4f6e 8
AdamGreen 1:a3cb118c4f6e 9 Unless required by applicable law or agreed to in writing, software
AdamGreen 1:a3cb118c4f6e 10 distributed under the License is distributed on an "AS IS" BASIS,
AdamGreen 1:a3cb118c4f6e 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
AdamGreen 1:a3cb118c4f6e 12 See the License for the specific language governing permissions and
AdamGreen 1:a3cb118c4f6e 13 limitations under the License.
AdamGreen 0:5ea6e74c35f7 14 */
AdamGreen 0:5ea6e74c35f7 15 /* Specifies constants and structures used within the FLASH File System. The
AdamGreen 0:5ea6e74c35f7 16 header is used by both the runtime and the tool which builds the image on
AdamGreen 0:5ea6e74c35f7 17 the PC.
AdamGreen 0:5ea6e74c35f7 18 */
AdamGreen 0:5ea6e74c35f7 19 #ifndef _FFSFORMAT_H_
AdamGreen 0:5ea6e74c35f7 20 #define _FFSFORMAT_H_
AdamGreen 0:5ea6e74c35f7 21
AdamGreen 0:5ea6e74c35f7 22
AdamGreen 0:5ea6e74c35f7 23 /* The signature to be placed in SFileSystemHeader::FileSystemSignature.
AdamGreen 0:5ea6e74c35f7 24 Only the first 8 bytes are used and the NULL terminator discarded. */
AdamGreen 0:5ea6e74c35f7 25 #define FILE_SYSTEM_SIGNATURE "FFileSys"
AdamGreen 0:5ea6e74c35f7 26
AdamGreen 0:5ea6e74c35f7 27 /* Header stored at the beginning of the file system image. */
AdamGreen 0:5ea6e74c35f7 28 typedef struct _SFileSystemHeader
AdamGreen 0:5ea6e74c35f7 29 {
AdamGreen 0:5ea6e74c35f7 30 /* Signature should be set to FILE_SYSTEM_SIGNATURE. */
AdamGreen 0:5ea6e74c35f7 31 char FileSystemSignature[8];
AdamGreen 0:5ea6e74c35f7 32 /* Number of entries in this file system image. */
AdamGreen 0:5ea6e74c35f7 33 unsigned int FileCount;
AdamGreen 0:5ea6e74c35f7 34 /* The SFileSystemEntry[SFileSystemHeader::FileCount] array will start here.
AdamGreen 0:5ea6e74c35f7 35 These entries are to be sorted so that a binary search can be performed
AdamGreen 0:5ea6e74c35f7 36 at file open time. */
AdamGreen 0:5ea6e74c35f7 37 } SFileSystemHeader;
AdamGreen 0:5ea6e74c35f7 38
AdamGreen 0:5ea6e74c35f7 39 /* Information about each file added to the file system image. */
AdamGreen 0:5ea6e74c35f7 40 typedef struct _SFileSystemEntry
AdamGreen 0:5ea6e74c35f7 41 {
AdamGreen 0:5ea6e74c35f7 42 /* The 2 following offsets are relative to the beginning of the file
AdamGreen 0:5ea6e74c35f7 43 image. */
AdamGreen 0:5ea6e74c35f7 44 unsigned int FilenameOffset;
AdamGreen 0:5ea6e74c35f7 45 unsigned int FileBinaryOffset;
AdamGreen 0:5ea6e74c35f7 46 unsigned int FileBinarySize;
AdamGreen 0:5ea6e74c35f7 47 } SFileSystemEntry;
AdamGreen 0:5ea6e74c35f7 48
AdamGreen 0:5ea6e74c35f7 49
AdamGreen 0:5ea6e74c35f7 50 #endif /* _FFSFORMAT_H_ */