mirror of
https://github.com/azure-rtos/filex.git
synced 2025-01-25 01:32:54 +08:00
Updated readme
This commit is contained in:
parent
e1a306d59a
commit
540ad5ac56
75
README.md
75
README.md
@ -1,3 +1,74 @@
|
||||
# FileX
|
||||
# Azure RTOS FileX
|
||||
|
||||
TODO: Description here
|
||||
This is a high-performance, file allocation table (FAT)-compatible file system that’s fully integrated with Azure RTOS ThreadX and available for all supported processors. Like Azure RTOS ThreadX, Azure RTOS FileX is designed to have a small footprint and high performance, making it ideal for today’s deeply embedded applications that require file management operations. FileX supports most physical media, including RAM, Azure RTOS USBX, SD CARD, and NAND/NOR flash memories via Azure RTOS LevelX.
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation for this library can be found here: http://docs.microsoft.com/azure/rtos/filex
|
||||
|
||||
# Building and using the library
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Install the following tools:
|
||||
|
||||
* [CMake](https://cmake.org/download/) version 3.0 or later
|
||||
* [GCC compilers for arm-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
|
||||
* [Ninja](https://ninja-build.org/)
|
||||
|
||||
## Cloning the repo
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/azure-rtos/filex.git
|
||||
```
|
||||
|
||||
## Building the threadx static library
|
||||
|
||||
Each component of Azure RTOS comes with a composible CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake command `add_subdirectory()`.
|
||||
|
||||
While the typical usage pattern is to include threadx into your device code source tree to be built & linked with your code, you can compile threadx as a standalone static library to confirm your build is set up correctly.
|
||||
|
||||
```bash
|
||||
$ cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake -GNinja .
|
||||
|
||||
$ cmake --build ./build
|
||||
```
|
||||
|
||||
# Repository Structure and Usage
|
||||
|
||||
## Branches & Releases
|
||||
|
||||
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library.
|
||||
|
||||
## Releases
|
||||
|
||||
Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.0-rel`.
|
||||
|
||||
## Directory layout
|
||||
|
||||
```
|
||||
- cmake
|
||||
- common
|
||||
- inc
|
||||
- src
|
||||
- ports
|
||||
- cortex_m0/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m3/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m4/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m7/gnu
|
||||
- inc
|
||||
- src
|
||||
- samples
|
||||
```
|
||||
|
||||
# Contribution, feedback and issues
|
||||
|
||||
If you encounter any bugs, have suggestions for new features or if you would like to become an active contributor to this project please follow the instructions provided in the contribution guideline for the corresponding repo.
|
||||
|
||||
For general support, please post a question to [Stack Overflow](http://stackoverflow.com/questions/tagged/azure-rtos+threadx) using the `threadx` and `azure-rtos` tags.
|
29
cmake/arm-none-eabi.cmake
Normal file
29
cmake/arm-none-eabi.cmake
Normal file
@ -0,0 +1,29 @@
|
||||
# Toolchain settings
|
||||
set(CMAKE_C_COMPILER arm-none-eabi-gcc)
|
||||
set(CMAKE_CXX_COMPILER arm-none-eabi-g++)
|
||||
set(AS arm-none-eabi-as)
|
||||
set(AR arm-none-eabi-ar)
|
||||
set(OBJCOPY arm-none-eabi-objcopy)
|
||||
set(OBJDUMP arm-none-eabi-objdump)
|
||||
set(SIZE arm-none-eabi-size)
|
||||
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||
|
||||
# this makes the test compiles use static library option so that we don't need to pre-set linker flags and scripts
|
||||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||
|
||||
set(CMAKE_C_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} ${SPEC_FLAGS} -fdata-sections -ffunction-sections -mlong-calls" CACHE INTERNAL "c compiler flags")
|
||||
set(CMAKE_CXX_FLAGS "${MCPU_FLAGS} ${VFP_FLAGS} -fdata-sections -ffunction-sections -fno-rtti -fno-exceptions -mlong-calls" CACHE INTERNAL "cxx compiler flags")
|
||||
set(CMAKE_ASM_FLAGS "${MCPU_FLAGS} -x assembler-with-cpp" CACHE INTERNAL "asm compiler flags")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${MCPU_FLAGS} ${LD_FLAGS} -Wl,--gc-sections" CACHE INTERNAL "exe link flags")
|
||||
|
||||
SET(CMAKE_C_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "c debug compiler flags")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g -ggdb3" CACHE INTERNAL "cxx debug compiler flags")
|
||||
SET(CMAKE_ASM_FLAGS_DEBUG "-g -ggdb3" CACHE INTERNAL "asm debug compiler flags")
|
||||
|
||||
SET(CMAKE_C_FLAGS_RELEASE "-O3" CACHE INTERNAL "c release compiler flags")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE INTERNAL "cxx release compiler flags")
|
||||
SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm release compiler flags")
|
13
cmake/cortex_m0.cmake
Normal file
13
cmake/cortex_m0.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
# Name of the target
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
|
||||
|
||||
set(THREADX_ARCH "cortex_m0")
|
||||
set(THREADX_TOOLCHAIN "gnu")
|
||||
|
||||
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m0")
|
||||
set(VFP_FLAGS "")
|
||||
set(SPEC_FLAGS "--specs=nosys.specs")
|
||||
# set(LD_FLAGS "-nostartfiles")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)
|
13
cmake/cortex_m3.cmake
Normal file
13
cmake/cortex_m3.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
# Name of the target
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
|
||||
|
||||
set(THREADX_ARCH "cortex_m3")
|
||||
set(THREADX_TOOLCHAIN "gnu")
|
||||
|
||||
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m3")
|
||||
set(VFP_FLAGS "")
|
||||
set(SPEC_FLAGS "--specs=nosys.specs")
|
||||
# set(LD_FLAGS "-nostartfiles")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)
|
13
cmake/cortex_m4.cmake
Normal file
13
cmake/cortex_m4.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
# Name of the target
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m4)
|
||||
|
||||
set(THREADX_ARCH "cortex_m4")
|
||||
set(THREADX_TOOLCHAIN "gnu")
|
||||
|
||||
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m4")
|
||||
set(VFP_FLAGS "")
|
||||
set(SPEC_FLAGS "--specs=nosys.specs")
|
||||
# set(LD_FLAGS "-nostartfiles")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)
|
13
cmake/cortex_m7.cmake
Normal file
13
cmake/cortex_m7.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
# Name of the target
|
||||
set(CMAKE_SYSTEM_NAME Generic)
|
||||
set(CMAKE_SYSTEM_PROCESSOR cortex-m7)
|
||||
|
||||
set(THREADX_ARCH "cortex_m7")
|
||||
set(THREADX_TOOLCHAIN "gnu")
|
||||
|
||||
set(MCPU_FLAGS "-mthumb -mcpu=cortex-m7")
|
||||
set(VFP_FLAGS "")
|
||||
set(SPEC_FLAGS "--specs=nosys.specs")
|
||||
# set(LD_FLAGS "-nostartfiles")
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/arm-none-eabi.cmake)
|
15
cmake/utilities.cmake
Normal file
15
cmake/utilities.cmake
Normal file
@ -0,0 +1,15 @@
|
||||
# Add the required subdirectory and register it for linkage
|
||||
function(add_azrtos_component_dir dirname)
|
||||
# Store the current list in a temp
|
||||
set(tmp ${azrtos_targets})
|
||||
# Add the subdir
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/lib/${dirname})
|
||||
# If there is a linker script defined, use it
|
||||
if(EXISTS ${LINKER_SCRIPT})
|
||||
target_link_options(${dirname} INTERFACE -T ${LINKER_SCRIPT})
|
||||
endif()
|
||||
# Add this target into the temp
|
||||
list(APPEND tmp "azrtos::${dirname}")
|
||||
# Copy the temp back up to the parent list
|
||||
set(azrtos_targets ${tmp} PARENT_SCOPE)
|
||||
endfunction()
|
35
rebuild.sh
35
rebuild.sh
@ -1,35 +0,0 @@
|
||||
#!/bin/bash
|
||||
# A simple shell script for building the demo app
|
||||
# Written by Peter Provost <peter.provost@microsoft.com>
|
||||
#
|
||||
# Usage:
|
||||
# ./rebuild.sh [target_arch]
|
||||
#
|
||||
# Notes:
|
||||
# - target_arch must match the name of the appropriate file in the
|
||||
# cmake/ directory. Do not include the .cmake extension.
|
||||
# Default is "cortex_m4".
|
||||
|
||||
# Use paths relative to this script's location
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
BASEDIR=$(dirname "$SCRIPT")
|
||||
BUILDDIR="$BASEDIR/build"
|
||||
|
||||
[ -z "$1" ] && TOOLCHAIN_NAME="cortex_m4" || TOOLCHAIN_NAME=$1
|
||||
TOOLCHAIN_FILE=$BASEDIR/cmake/${TOOLCHAIN_NAME}.cmake
|
||||
|
||||
echo "Using CMake toolchain ${TOOLCHAIN_FILE}"
|
||||
|
||||
# If you want to build into a different directory, change this variable
|
||||
|
||||
# Create our build folder if required and clear it
|
||||
mkdir -p $BUILDDIR
|
||||
rm -rf $BUILDDIR/*
|
||||
|
||||
# Generate the build system using Ninja
|
||||
cmake -B"$BUILDDIR" -GNinja -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE $BASEDIR
|
||||
# Generate the build system using the system default
|
||||
# cmake -B"$BUILDDIR" -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE $BASEDIR
|
||||
|
||||
# And then do the build
|
||||
cmake --build $BUILDDIR
|
Loading…
x
Reference in New Issue
Block a user