mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Added in documentation on how to consume from a main project. Added default PORT selection for native POSIX and MINGW platforms.
This commit is contained in:
parent
927ad2d8e5
commit
01987eb1c5
2 changed files with 58 additions and 7 deletions
49
README.md
49
README.md
|
@ -8,7 +8,53 @@ Additionally, for FreeRTOS kernel feature information refer to the [Developer Do
|
|||
### Getting help
|
||||
If you have any questions or need assistance troubleshooting your FreeRTOS project, we have an active community that can help on the [FreeRTOS Community Support Forum](https://forums.freertos.org).
|
||||
|
||||
## Cloning this repository
|
||||
## To consume FreeRTOS-Kernel
|
||||
|
||||
### Consume with CMake
|
||||
If using CMake, it is recommended to use this repository using FetchContent.
|
||||
Add the following into your project's main or a subdirectory's `CMakeLists.txt`:
|
||||
|
||||
- Define the source and version/tag you want to use:
|
||||
|
||||
```cmake
|
||||
FetchContent_Declare( freertos_kernel
|
||||
GIT_REPOSITORY https://github.com/FreeRTOS/FreeRTOS-Kernel.git
|
||||
GIT_TAG master #Note: Best practice to use specific git-hash or tagged version
|
||||
)
|
||||
```
|
||||
|
||||
- Add a freertos_config library (typically an INTERFACE library) The following assumes the directory structure:
|
||||
- `include/FreeRTOSConfig.h`
|
||||
```cmake
|
||||
add_library(freertos_config INTERFACE)
|
||||
|
||||
target_include_directories(freertos_config SYSTEM
|
||||
INTERFACE
|
||||
include
|
||||
)
|
||||
|
||||
target_compile_definitions(freertos_config
|
||||
INTERFACE
|
||||
projCOVERAGE_TEST=0
|
||||
)
|
||||
```
|
||||
|
||||
- Configure the FreeRTOS-Kernel and make it available
|
||||
- this particular example supports a native and cross-compiled build option.
|
||||
|
||||
```cmake
|
||||
set( FREERTOS_HEAP "4" CACHE STRING "" FORCE)
|
||||
# Select the native compile PORT
|
||||
set( FREERTOS_PORT "GCC_POSIX" CACHE STRING "" FORCE)
|
||||
# Select the cross-compile PORT
|
||||
if (CMAKE_CROSSCOMPILING)
|
||||
set(FREERTOS_PORT "GCC_ARM_CA9" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
FetchContent_MakeAvailable(freertos_kernel)
|
||||
```
|
||||
|
||||
### Consuming stand-alone - Cloning this repository
|
||||
|
||||
To clone using HTTPS:
|
||||
```
|
||||
|
@ -36,4 +82,3 @@ FreeRTOS files are formatted using the "uncrustify" tool. The configuration file
|
|||
### Spelling
|
||||
*lexicon.txt* contains words that are not traditionally found in an English dictionary. It is used by the spellchecker to verify the various jargon, variable names, and other odd words used in the FreeRTOS code base. If your pull request fails to pass the spelling and you believe this is a mistake, then add the word to *lexicon.txt*.
|
||||
Note that only the FreeRTOS Kernel source files are checked for proper spelling, the portable section is ignored.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue