### Build FreeRTOS Examples for KC705 Board (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Invokes `xt-make` to build all FreeRTOS examples in the current directory, targeting the Xilinx KC705 FPGA development board. This command should be run from the appropriate context for building examples. ```Shell xt-make all TARGET=kc705 ``` -------------------------------- ### Build FreeRTOS Examples for ML605 Board (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Invokes `xt-make` to build all FreeRTOS examples in the current directory, targeting the Xilinx ML605 FPGA development board. This command should be run from the appropriate context for building examples. ```Shell xt-make all TARGET=ml605 ``` -------------------------------- ### Building FreeRTOS with Custom CFLAGS (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Example command using xt-make to build the FreeRTOS library and example application, overriding the default CFLAGS with specific optimization and preprocessor defines. ```Shell xt-make CFLAGS="-O2 -DXT_USE_THREAD_SAFE_CLIB" ``` -------------------------------- ### Debugging FreeRTOS Application on Xtensa Simulator (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Command to launch the Xtensa Xplorer GUI debugger with an example FreeRTOS application on the simulator. ```Shell xplorer --debug example.exe ``` -------------------------------- ### Change Directory to Simulator Demo (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Changes the current directory to the location of the FreeRTOS examples designed to run on the Xtensa instruction set simulator (ISS). This is a prerequisite step before building the simulator examples. ```Shell cd demos/cadence/sim ``` -------------------------------- ### Build FreeRTOS Examples for Simulator (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Invokes `xt-make` to build all FreeRTOS examples located in the current directory (assumed to be the simulator demo directory). By default, this command targets the Xtensa instruction set simulator (ISS). This is equivalent to `xt-make all TARGET=sim`. ```Shell xt-make all ``` -------------------------------- ### Running FreeRTOS Application on Xtensa Simulator (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Command to execute an example FreeRTOS application on the Xtensa simulator. The --turbo option enables faster, non-cycle-accurate simulation (requires Xtensa Tools v7+). ```Shell xt-run [--turbo] example.exe ``` -------------------------------- ### Build FreeRTOS Examples with Custom CFLAGS (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Builds all FreeRTOS examples for the simulator target using `xt-make`, while overriding the default compilation options with custom CFLAGS (`-O2 -Os -g`). This allows fine-tuning the compiler optimization levels and debug information. ```Shell xt-make all TARGET=sim CFLAGS="-O2 -Os -g" ``` -------------------------------- ### Build FreeRTOS Examples for Simulator (Explicit) (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Explicitly invokes `xt-make` to build all FreeRTOS examples in the current directory, specifically targeting the Xtensa instruction set simulator (ISS). This command is functionally identical to `xt-make all` when run from the simulator demo directory. ```Shell xt-make all TARGET=sim ``` -------------------------------- ### Generating SMP Build Files with CMake (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Uses CMake to generate build files for the Symmetric Multi-Processing (SMP) FreeRTOS configuration within a `build` directory, sourcing from `examples/coverity` and enabling the SMP example. This prepares the SMP project for analysis. ```Shell cmake -B build -S examples/coverity -DFREERTOS_SMP_EXAMPLE=1 ``` -------------------------------- ### Minimum Task Stack Size Macro (C) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Defines the minimum required stack size for any task in the Xtensa FreeRTOS port. Using a smaller size is risky and can lead to hard-to-debug errors. ```C XT_STACK_MIN_SIZE ``` -------------------------------- ### Build FreeRTOS Library for Simulator (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Invokes the `xt-make` utility to build the FreeRTOS library (`libfreertos.a`) for the default target, which is the Xtensa instruction set simulator (ISS). This command assumes the current directory is the Xtensa port directory. ```Shell xt-make ``` -------------------------------- ### Build FreeRTOS Library for Board (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Invokes `xt-make` to build the FreeRTOS library (`libfreertos.a`) specifically targeting a supported Xtensa evaluation board. The specific board type does not need to be specified at this stage. This command assumes the current directory is the Xtensa port directory. ```Shell xt-make TARGET=board ``` -------------------------------- ### Build FreeRTOS Library with Custom Config (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Builds the FreeRTOS library using `xt-make`, explicitly specifying the Xtensa processor configuration (`XTENSA_CORE`) and the registry path (`XTENSA_SYSTEM`). This is necessary if the desired configuration is not the default or not in the default registry. Additional build options can follow. This command assumes the current directory is the Xtensa port directory. ```Shell xt-make XTENSA_CORE= XTENSA_SYSTEM= ... ``` -------------------------------- ### Enable Thread-Safe C Library Macro (C) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Preprocessor macro used to enable support for reentrancy when using the C library with the Xtensa FreeRTOS port. Can be defined via compiler flags like -D. ```C XT_USE_THREAD_SAFE_CLIB ``` -------------------------------- ### Change Directory to Xtensa Port (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/XCC/Xtensa/readme_xtensa.txt Changes the current directory to the Xtensa port directory within the FreeRTOS source tree, which is the location of the FreeRTOS library makefile. This is a prerequisite step before building the FreeRTOS library for Xtensa. ```Shell cd lib/FreeRTOS/portable/XCC/Xtensa ``` -------------------------------- ### Defining Interrupt Priorities for port_asm.s (Non-RX700v3_DPFPU Ports) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX200/readme.txt These definitions specify the kernel interrupt priority and the maximum interrupt priority from which FreeRTOS API functions can be called. They must be provided in PriorityDefinitions.h for the port_asm.s file when using ports other than RX700v3_DPFPU. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Disabling Task DPFPU Support in FreeRTOSConfig.h (RX700v3_DPFPU Port) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX200/readme.txt This snippet shows how to disable task double-precision FPU support when using the RX700v3_DPFPU port with MCUs that do not have a double-precision FPU. This definition should be placed in the FreeRTOSConfig.h file. ```C #define configUSE_TASK_DPFPU_SUPPORT 0 ``` -------------------------------- ### Generating Single-Core Build Files with CMake (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Uses CMake to generate build files for the single-core FreeRTOS configuration within a `build` directory, sourcing the project files from `examples/coverity`. This prepares the project for compilation and analysis. ```Shell cmake -B build -S examples/coverity ``` -------------------------------- ### Adding FreeRTOS Configuration Include Directory Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Adds the `../template_configuration` directory as an interface include directory for the `freertos_config` library. ```CMake target_include_directories(freertos_config INTERFACE "../template_configuration" ) ``` -------------------------------- ### Building Project for Coverity Analysis (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Changes the current directory to the `build` directory created by CMake and then uses `cov-build` to wrap the `make coverity` command. This compiles the project and captures the compilation units and dependencies needed for static analysis. `--emit-complementary-info` includes additional data. ```Shell cd build/ cov-build --emit-complementary-info --dir cov-out make coverity ``` -------------------------------- ### Linking Libraries to Executable Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Links the `freertos_kernel` and `freertos_config` libraries to the executable target. ```CMake target_link_libraries(${PROJECT_NAME} freertos_kernel freertos_config) ``` -------------------------------- ### Adding FreeRTOS Configuration Interface Library Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Adds an interface library named `freertos_config` which will be used to manage configuration include directories. ```CMake add_library(freertos_config INTERFACE) ``` -------------------------------- ### Running Coverity Static Analysis (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Executes the Coverity static analysis on the captured build results located in the `cov-out` directory. It applies the specified coding standard configuration (`coverity_misra.config`) and uses a pattern to include only relevant `.c` files while excluding `main.c` and `port.c`. ```Shell cov-analyze --dir ./cov-out \ --coding-standard-config ../examples/coverity/coverity_misra.config \ --tu-pattern "file('[A-Za-z_]+\.c') && ( ! file('main.c') ) && ( ! file('port.c') )" ``` -------------------------------- ### Adding FreeRTOS Kernel Subdirectory Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Includes the FreeRTOS kernel source directory as a subdirectory in the build, allowing its CMakeLists.txt to be processed. ```CMake add_subdirectory(${FREERTOS_KERNEL_PATH} FreeRTOS-Kernel) ``` -------------------------------- ### Defining CMake Project Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Defines the name of the CMake project. ```CMake project(example) ``` -------------------------------- ### Configuring FreeRTOS Kernel with Raspberry Pi Pico SDK using CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2350_RISC-V/CMakeLists.txt This CMake script initializes the build process for the FreeRTOS kernel, ensuring the correct version of the Pico SDK is present and imported. It defines the project, sets C/CXX standards, determines the kernel source path, and conditionally includes necessary build files or initializes the SDK based on the project's structure (top-level or subdirectory). ```CMake cmake_minimum_required(VERSION 3.13) if (NOT TARGET _FreeRTOS_kernel_inclusion_marker) add_library(_FreeRTOS_kernel_inclusion_marker INTERFACE) # Pull in PICO SDK (must be before project) include(pico_sdk_import.cmake) if (PICO_SDK_VERSION_STRING VERSION_LESS "2.0.0") message(FATAL_ERROR "Require at least Raspberry Pi Pico SDK version 2.0.0") endif() if (NOT FREERTOS_KERNEL_PATH) get_filename_component(FREERTOS_KERNEL_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../.. REALPATH) endif () message(DEBUG "FREERTOS_KERNEL_PATH is ${FREERTOS_KERNEL_PATH}") project(FreeRTOS-Kernel C CXX) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) pico_is_top_level_project(FREERTOS_KERNEL_TOP_LEVEL_PROJECT) # if the SDK has already been initialized, then just add our libraries now - this allows # this FreeRTOS port to just be added as a sub-directory or include within another project, rather than # having to include it at the top level before pico_sdk_init() if (TARGET _pico_sdk_inclusion_marker) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.2") message(FATAL_ERROR "Require at least Raspberry Pi Pico SDK version 1.3.2 to include FreeRTOS after pico_sdk_init()") endif() include(${CMAKE_CURRENT_LIST_DIR}/library.cmake) else() # The real work gets done in library.cmake which is called at the end of pico_sdk_init list(APPEND PICO_SDK_POST_LIST_FILES ${CMAKE_CURRENT_LIST_DIR}/library.cmake) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.2") # We need to inject the following header file into ALL SDK files (which we do via the config header) list(APPEND PICO_CONFIG_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/include/freertos_sdk_config.h) endif() if (FREERTOS_KERNEL_TOP_LEVEL_PROJECT) message("FreeRTOS: initialize SDK since we're the top-level") # Initialize the SDK pico_sdk_init() else() set(FREERTOS_KERNEL_PATH ${FREERTOS_KERNEL_PATH} PARENT_SCOPE) set(PICO_CONFIG_HEADER_FILES ${PICO_CONFIG_HEADER_FILES} PARENT_SCOPE) set(PICO_SDK_POST_LIST_FILES ${PICO_SDK_POST_LIST_FILES} PARENT_SCOPE) endif() endif() endif() ``` -------------------------------- ### Adding Executable Target Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Defines an executable target with the project name (`${PROJECT_NAME}`) using the source file `main.c`. ```CMake add_executable(${PROJECT_NAME} main.c ) ``` -------------------------------- ### Setting FreeRTOS Kernel Compile Options Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Applies specific compile options to the `freertos_kernel` target, including warnings and error settings for GNU and Clang compilers, and suppressing certain warnings for Clang. ```CMake target_compile_options(freertos_kernel PRIVATE ### Gnu/Clang C Options $<$:-fdiagnostics-color=always> $<$:-fcolor-diagnostics> $<$:-Wall> $<$:-Wextra> $<$:-Wpedantic> $<$:-Werror> $<$:-Wconversion> $<$:-Weverything> # Suppressions required to build clean with clang. $<$:-Wno-unused-macros> $<$:-Wno-padded> $<$:-Wno-missing-variable-declarations> $<$:-Wno-covered-switch-default> $<$:-Wno-cast-align> ) ``` -------------------------------- ### Conditional SMP Build Configuration Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Conditionally adds compile options for Symmetric Multi-Processing (SMP) if the `FREERTOS_SMP_EXAMPLE` variable is defined and set to '1'. ```CMake if (DEFINED FREERTOS_SMP_EXAMPLE AND FREERTOS_SMP_EXAMPLE STREQUAL "1") message(STATUS "Build FreeRTOS SMP example") # Adding the following configurations to build SMP template port add_compile_options( -DconfigNUMBER_OF_CORES=2 -DconfigUSE_PASSIVE_IDLE_HOOK=0 ) endif() ``` -------------------------------- ### Setting Minimum CMake Version Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Specifies the minimum required version of CMake to build the project. ```CMake cmake_minimum_required(VERSION 3.15) ``` -------------------------------- ### Setting C Standard for FreeRTOS Kernel Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Sets the C standard property for the `freertos_kernel` target to C90. ```CMake set_property(TARGET freertos_kernel PROPERTY C_STANDARD 90) ``` -------------------------------- ### Configuring FreeRTOS Kernel with Raspberry Pi Pico SDK using CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2350_ARM_NTZ/CMakeLists.txt This CMake script sets up the build process for the FreeRTOS kernel integrated with the Raspberry Pi Pico SDK. It ensures the Pico SDK is included, checks for minimum required SDK versions, determines the FreeRTOS kernel path, sets C/CXX standards, and conditionally initializes the SDK or passes configuration to a parent project. ```CMake cmake_minimum_required(VERSION 3.13) if (NOT TARGET _FreeRTOS_kernel_inclusion_marker) add_library(_FreeRTOS_kernel_inclusion_marker INTERFACE) # Pull in PICO SDK (must be before project) include(pico_sdk_import.cmake) if (PICO_SDK_VERSION_STRING VERSION_LESS "2.0.0") message(FATAL_ERROR "Require at least Raspberry Pi Pico SDK version 2.0.0") endif() if (NOT FREERTOS_KERNEL_PATH) get_filename_component(FREERTOS_KERNEL_PATH ${CMAKE_CURRENT_LIST_DIR}/../../../.. REALPATH) endif () message(DEBUG "FREERTOS_KERNEL_PATH is ${FREERTOS_KERNEL_PATH}") project(FreeRTOS-Kernel C CXX) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) pico_is_top_level_project(FREERTOS_KERNEL_TOP_LEVEL_PROJECT) # if the SDK has already been initialized, then just add our libraries now - this allows # this FreeRTOS port to just be added as a sub-directory or include within another project, rather than # having to include it at the top level before pico_sdk_init() if (TARGET _pico_sdk_inclusion_marker) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.2") message(FATAL_ERROR "Require at least Raspberry Pi Pico SDK version 1.3.2 to include FreeRTOS after pico_sdk_init()") endif() include(${CMAKE_CURRENT_LIST_DIR}/library.cmake) else() # The real work gets done in library.cmake which is called at the end of pico_sdk_init list(APPEND PICO_SDK_POST_LIST_FILES ${CMAKE_CURRENT_LIST_DIR}/library.cmake) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.2") # We need to inject the following header file into ALL SDK files (which we do via the config header) list(APPEND PICO_CONFIG_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/include/freertos_sdk_config.h) endif() if (FREERTOS_KERNEL_TOP_LEVEL_PROJECT) message("FreeRTOS: initialize SDK since we're the top-level") # Initialize the SDK pico_sdk_init() else() set(FREERTOS_KERNEL_PATH ${FREERTOS_KERNEL_PATH} PARENT_SCOPE) set(PICO_CONFIG_HEADER_FILES ${PICO_CONFIG_HEADER_FILES} PARENT_SCOPE) set(PICO_SDK_POST_LIST_FILES ${PICO_SDK_POST_LIST_FILES} PARENT_SCOPE) endif() endif() endif() ``` -------------------------------- ### Link Libraries to Executable (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Links the 'freertos_kernel' and 'freertos_config' libraries to the project executable, providing the necessary code and configurations. ```CMake target_link_libraries(${PROJECT_NAME} freertos_kernel freertos_config) ``` -------------------------------- ### Configuring Coverity Compiler (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Configures the Coverity analysis tool to recognize and use the GCC compiler. The `--force` flag ensures the configuration is applied even if one exists, and `--comptype gcc` specifies the compiler type. ```Shell cov-configure --force --compiler cc --comptype gcc ``` -------------------------------- ### Conditional Pico SDK Integration Logic (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/CMakeLists.txt Handles the integration with the Pico SDK based on whether the SDK has already been initialized. If initialized, it includes the `library.cmake` file directly; otherwise, it appends `library.cmake` and potentially a config header to lists processed by `pico_sdk_init`, which is called if this is the top-level project. ```CMake # if the SDK has already been initialized, then just add our libraries now - this allows # this FreeRTOS port to just be added as a sub-directory or include within another project, rather than # having to include it at the top level before pico_sdk_init() if (TARGET _pico_sdk_inclusion_marker) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.2") message(FATAL_ERROR "Require at least Raspberry Pi Pico SDK version 1.3.2 to include FreeRTOS after pico_sdk_init()") endif() include(${CMAKE_CURRENT_LIST_DIR}/library.cmake) else() # The real work gets done in library.cmake which is called at the end of pico_sdk_init list(APPEND PICO_SDK_POST_LIST_FILES ${CMAKE_CURRENT_LIST_DIR}/library.cmake) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.3.2") # We need to inject the following header file into ALL SDK files (which we do via the config header) list(APPEND PICO_CONFIG_HEADER_FILES ${CMAKE_CURRENT_LIST_DIR}/include/freertos_sdk_config.h) endif() if (FREERTOS_KERNEL_TOP_LEVEL_PROJECT) message("FreeRTOS: initialize SDK since we're the top-level") # Initialize the SDK pico_sdk_init() else() set(FREERTOS_KERNEL_PATH ${FREERTOS_KERNEL_PATH} PARENT_SCOPE) set(PICO_CONFIG_HEADER_FILES ${PICO_CONFIG_HEADER_FILES} PARENT_SCOPE) set(PICO_SDK_POST_LIST_FILES ${PICO_SDK_POST_LIST_FILES} PARENT_SCOPE) endif() endif() endif() ``` -------------------------------- ### Set Minimum CMake Version and Create Marker Target (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/CMakeLists.txt Specifies the minimum required CMake version (3.13) and creates an interface target (`_FreeRTOS_kernel_inclusion_marker`) used as a marker to prevent multiple inclusions of this configuration file within a single build. ```CMake cmake_minimum_required(VERSION 3.13) if (NOT TARGET _FreeRTOS_kernel_inclusion_marker) add_library(_FreeRTOS_kernel_inclusion_marker INTERFACE) ``` -------------------------------- ### Configure SMP Build Options (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Conditionally adds compile options for Symmetric Multi-Processing (SMP) if the FREERTOS_SMP_EXAMPLE variable is defined and set to "1". It sets the number of cores and disables the passive idle hook. ```CMake if (DEFINED FREERTOS_SMP_EXAMPLE AND FREERTOS_SMP_EXAMPLE STREQUAL "1") message(STATUS "Build FreeRTOS SMP example") # Adding the following configurations to build SMP template port add_compile_options( -DconfigNUMBER_OF_CORES=2 -DconfigUSE_PASSIVE_IDLE_HOOK=0 ) endif() ``` -------------------------------- ### Cloning FreeRTOS-Kernel Repository (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Clones the FreeRTOS-Kernel repository from GitHub into a local directory named `FreeRTOS-Kernel`. This is a prerequisite step to obtain the source code for analysis. ```Shell git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git ./FreeRTOS-Kernel ``` -------------------------------- ### Add FreeRTOS Kernel Subdirectory (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Includes the FreeRTOS-Kernel subdirectory into the build, allowing CMake to process its CMakeLists.txt file and build the kernel source. ```CMake add_subdirectory(${FREERTOS_KERNEL_PATH} FreeRTOS-Kernel) ``` -------------------------------- ### Add FreeRTOS-Kernel as Git Submodule (Bash) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/README.md These Bash commands add the FreeRTOS-Kernel repository as a Git submodule to your project and then initialize and update the submodule to fetch its content. ```bash git submodule add https://github.com/FreeRTOS/FreeRTOS-Kernel.git git submodule update --init ``` -------------------------------- ### Adding FreeRTOS Kernel via Subdirectory in CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/README.md This CMake command adds the FreeRTOS kernel directory as a subdirectory to your project, integrating it into the build system. Replace 'path/to/this/directory' with the actual path to the kernel source. ```CMake add_subdirectory(path/to/this/directory FreeRTOS-Kernel) ``` -------------------------------- ### Define Paths and Find Source Files (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Sets the path to the FreeRTOS kernel directory and uses FILE(GLOB) to find all .c files in the kernel and portable template directories, storing them in variables. ```CMake set(FREERTOS_KERNEL_PATH "../..") FILE(GLOB FREERTOS_KERNEL_SOURCE ${FREERTOS_KERNEL_PATH}/*.c) FILE(GLOB FREERTOS_PORT_CODE ${FREERTOS_KERNEL_PATH}/portable/template/*.c) ``` -------------------------------- ### Configure and Make FreeRTOS-Kernel Available (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/README.md This CMake snippet sets cache variables to configure the FreeRTOS heap size and port. It includes conditional logic for selecting a cross-compilation port and then makes the fetched FreeRTOS-Kernel content available for use in the project. ```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) ``` -------------------------------- ### Create FreeRTOS Configuration Interface Library (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/README.md This CMake code defines an INTERFACE library named `freertos_config`. It sets the system include directory for `FreeRTOSConfig.h` and adds a compile definition, typically used for configuration flags like test coverage. ```cmake add_library(freertos_config INTERFACE) target_include_directories(freertos_config SYSTEM INTERFACE include ) target_compile_definitions(freertos_config INTERFACE projCOVERAGE_TEST=0 ) ``` -------------------------------- ### Add FreeRTOS Config Interface Library (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Creates an interface library named 'freertos_config' and adds the current directory to its include paths, making configuration headers available to other targets. ```CMake add_library(freertos_config INTERFACE) target_include_directories(freertos_config INTERFACE ./) ``` -------------------------------- ### Generating Coverity HTML Report (Shell) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/README.md Formats the analysis results stored in the `cov-out` directory into a human-readable HTML report. The output is saved to a directory named `html-output`. This command makes the analysis findings accessible for review. ```Shell cov-format-errors --dir ./cov-out --html-output html-output ``` -------------------------------- ### Clone FreeRTOS-Kernel Repository (Bash) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/README.md These Bash commands show how to clone the FreeRTOS-Kernel repository directly using either HTTPS or SSH. ```bash git clone https://github.com/FreeRTOS/FreeRTOS-Kernel.git ``` ```bash git clone git@github.com:FreeRTOS/FreeRTOS-Kernel.git ``` -------------------------------- ### Include Pico SDK and Check Version (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/CMakeLists.txt Includes the necessary script (`pico_sdk_import.cmake`) to import the Raspberry Pi Pico SDK and checks if the SDK version meets the minimum requirement (1.2.0), halting the build with a fatal error if it does not. ```CMake # Pull in PICO SDK (must be before project) include(pico_sdk_import.cmake) if (PICO_SDK_VERSION_STRING VERSION_LESS "1.2.0") message(FATAL_ERROR "Require at least Raspberry Pi Pico SDK version 1.2.0") endif() ``` -------------------------------- ### Setting FreeRTOS Native Port Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Sets the `FREERTOS_PORT` variable to 'TEMPLATE', selecting the native compile port, and caches this value. ```CMake set(FREERTOS_PORT "TEMPLATE" CACHE STRING "" FORCE) ``` -------------------------------- ### Setting FreeRTOS Kernel Path Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Sets a variable `FREERTOS_KERNEL_PATH` to the relative path of the FreeRTOS kernel source directory. ```CMake set(FREERTOS_KERNEL_PATH "../../") ``` -------------------------------- ### Defining Kernel Interrupt Priorities (FreeRTOS, C) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX700v3_DPFPU/readme.txt These preprocessor definitions, required in PriorityDefinitions.h for non-RX700v3_DPFPU ports, set the base kernel interrupt priority and the maximum priority for interrupts that can call FreeRTOS API functions. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Add Custom Target for Coverity Workaround (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Defines a custom build target named 'fix_source' that executes a sed command to replace 'pdFALSE' with 'pdFAIL' and 'pdTRUE' with 'pdPASS' in the source files. This is a workaround for a specific Coverity analysis issue. ```CMake add_custom_target(fix_source ALL COMMAND sed -i -b -e 's/pdFALSE/pdFAIL/g' -e 's/pdTRUE/pdPASS/g' ${FREERTOS_KERNEL_SOURCE} ${FREERTOS_PORT_CODE} DEPENDS ${FREERTOS_KERNEL_SOURCE} ${FREERTOS_PORT_CODE}) ``` -------------------------------- ### Add Project Executable (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Defines the main executable target for the project, using the specified source file. ```CMake add_executable(${PROJECT_NAME} ../cmake_example/main.c) ``` -------------------------------- ### Setting FreeRTOS Heap Port Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/cmake_example/CMakeLists.txt Sets the `FREERTOS_HEAP` variable to '4', selecting a specific heap implementation, and caches this value. ```CMake set(FREERTOS_HEAP "4" CACHE STRING "" FORCE) ``` -------------------------------- ### Adding Core Source Files to FreeRTOS Kernel Library in CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/CMakeLists.txt This command adds the essential C source files for the FreeRTOS kernel components (coroutines, event groups, lists, queues, stream buffers, tasks, and timers) to the `freertos_kernel` static library target. The `PRIVATE` keyword indicates these sources are only used to build this specific target. ```CMake target_sources(freertos_kernel PRIVATE croutine.c event_groups.c list.c queue.c stream_buffer.c tasks.c timers.c ) ``` -------------------------------- ### Defining FreeRTOS Interrupt Priorities (C) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX600/readme.txt This snippet defines the kernel and maximum syscall interrupt priorities required by `port_asm.s` for Renesas RX ports other than RX700v3_DPFPU. These definitions are typically placed in `PriorityDefinitions.h`. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Define FreeRTOS Kernel Include Interface Library - CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/include/CMakeLists.txt Defines a CMake interface library named `freertos_kernel_include`. This library specifies include directories, including the current directory and a conditionally included deprecated path. It also links to the `freertos_config` target if it exists, providing necessary configuration dependencies. ```CMake add_library(freertos_kernel_include INTERFACE) target_include_directories(freertos_kernel_include INTERFACE . # Note: DEPRECATED but still supported, may be removed in a future release. $<$>:${FREERTOS_CONFIG_FILE_DIRECTORY}> ) target_link_libraries(freertos_kernel_include INTERFACE $<$:freertos_config> ) ``` -------------------------------- ### Adding Subdirectories for FreeRTOS Kernel in CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/CMakeLists.txt These commands include the `include` and `portable` subdirectories in the CMake build process. This allows CMake to process any `CMakeLists.txt` files within these directories, typically defining targets or setting properties needed for the main kernel build. ```CMake add_subdirectory(include) add_subdirectory(portable) ``` -------------------------------- ### Declare FreeRTOS-Kernel with FetchContent (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/README.md This CMake snippet declares the FreeRTOS-Kernel repository for use with FetchContent, specifying the Git repository URL and the desired tag or branch. It's recommended to use a specific git hash or tagged version for stability. ```cmake FetchContent_Declare( freertos_kernel GIT_REPOSITORY https://github.com/FreeRTOS/FreeRTOS-Kernel.git GIT_TAG main #Note: Best practice to use specific git-hash or tagged version ) ``` -------------------------------- ### Defining Interrupt Priorities in PriorityDefinitions.h (Renesas RX) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/GCC/RX600/readme.txt This header file is required for the port_asm.s assembly file when using FreeRTOS ports other than RX700v3_DPFPU. It defines the base kernel interrupt priority and the maximum interrupt priority level from which FreeRTOS API functions can be safely called. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Define Project Name (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Sets the name of the CMake project. ```CMake project(coverity) ``` -------------------------------- ### Select FreeRTOS Port (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Sets the FREERTOS_PORT variable to "TEMPLATE" as a cached string, forcing the selection of the template port for FreeRTOS. ```CMake set(FREERTOS_PORT "TEMPLATE" CACHE STRING "" FORCE) ``` -------------------------------- ### Define CMake Project (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/CMakeLists.txt Defines the CMake project for the FreeRTOS kernel port, naming it "FreeRTOS-Kernel" and specifying that it uses both C and C++ languages. ```CMake project(FreeRTOS-Kernel C CXX) ``` -------------------------------- ### Set C and C++ Standards (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/CMakeLists.txt Sets the required C standard to C11 and the required C++ standard to C++17 for the FreeRTOS kernel project, ensuring compatibility with the source code. ```CMake set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) ``` -------------------------------- ### FreeRTOS Supported Compiler and Target Configurations List Source: https://github.com/raspberrypi/freertos-kernel/blob/main/CMakeLists.txt This snippet provides a list of predefined identifiers used to specify the compiler and target architecture when building FreeRTOS. Each line indicates a specific combination, such as GCC for AVR32 UC3 or IAR for ARM Cortex-M4F. ```C " GCC_AVR32_UC3 - Compiler: GCC Target: AVR32 UC3\n" " GCC_COLDFIRE_V2 - Compiler: GCC Target: ColdFire V2\n" " GCC_CORTUS_APS3 - Compiler: GCC Target: CORTUS APS3\n" " GCC_H8S2329 - Compiler: GCC Target: H8S2329\n" " GCC_HCS12 - Compiler: GCC Target: HCS12\n" " GCC_IA32_FLAT - Compiler: GCC Target: IA32 flat\n" " GCC_MICROBLAZE - Compiler: GCC Target: MicroBlaze\n" " GCC_MICROBLAZE_V8 - Compiler: GCC Target: MicroBlaze V8\n" " GCC_MICROBLAZE_V9 - Compiler: GCC Target: MicroBlaze V9\n" " GCC_MSP430F449 - Compiler: GCC Target: MSP430F449\n" " GCC_NIOSII - Compiler: GCC Target: NiosII\n" " GCC_PPC405_XILINX - Compiler: GCC Target: Xilinx PPC405\n" " GCC_PPC440_XILINX - Compiler: GCC Target: Xilinx PPC440\n" " GCC_RISC_V - Compiler: GCC Target: RISC-V\n" " GCC_RISC_V_PULPINO_VEGA_RV32M1RM - Compiler: GCC Target: RISC-V Pulpino Vega RV32M1RM\n" " GCC_RISC_V_GENERIC - Compiler: GCC Target: RISC-V with FREERTOS_RISCV_EXTENSION\n" " GCC_RL78 - Compiler: GCC Target: Renesas RL78\n" " GCC_RX100 - Compiler: GCC Target: Renesas RX100\n" " GCC_RX200 - Compiler: GCC Target: Renesas RX200\n" " GCC_RX600 - Compiler: GCC Target: Renesas RX600\n" " GCC_RX600_V2 - Compiler: GCC Target: Renesas RX600 v2\n" " GCC_RX700_V3_DPFPU - Compiler: GCC Target: Renesas RX700 v3 with DPFPU\n" " GCC_STR75X - Compiler: GCC Target: STR75x\n" " GCC_TRICORE_1782 - Compiler: GCC Target: TriCore 1782\n" " GCC_ARC_EM_HS - Compiler: GCC Target: DesignWare ARC EM HS\n" " GCC_ARC_V1 - Compiler: GCC Target: DesignWare ARC v1\n" " GCC_ATMEGA - Compiler: GCC Target: ATmega\n" " GCC_POSIX - Compiler: GCC Target: Posix\n" " GCC_RP2040 - Compiler: GCC Target: RP2040 ARM Cortex-M0+\n" " GCC_XTENSA_ESP32 - Compiler: GCC Target: Xtensa ESP32\n" " GCC_AVRDX - Compiler: GCC Target: AVRDx\n" " GCC_AVR_MEGA0 - Compiler: GCC Target: AVR Mega0\n" " IAR_78K0K - Compiler: IAR Target: Renesas 78K0K\n" " IAR_ARM_CA5_NOGIC - Compiler: IAR Target: ARM Cortex-A5 no GIC\n" " IAR_ARM_CA9 - Compiler: IAR Target: ARM Cortex-A9\n" " IAR_ARM_CM0 - Compiler: IAR Target: ARM Cortex-M0\n" " IAR_ARM_CM3 - Compiler: IAR Target: ARM Cortex-M3\n" " IAR_ARM_CM4F - Compiler: IAR Target: ARM Cortex-M4 with FPU\n" " IAR_ARM_CM4F_MPU - Compiler: IAR Target: ARM Cortex-M4 with FPU and MPU\n" " IAR_ARM_CM7 - Compiler: IAR Target: ARM Cortex-M7\n" " IAR_ARM_CM23_NONSECURE - Compiler: IAR Target: ARM Cortex-M23 non-secure\n" " IAR_ARM_CM23_SECURE - Compiler: IAR Target: ARM Cortex-M23 secure\n" " IAR_ARM_CM23_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M23 non-trustzone non-secure\n" " IAR_ARM_CM33_NONSECURE - Compiler: IAR Target: ARM Cortex-M33 non-secure\n" " IAR_ARM_CM33_SECURE - Compiler: IAR Target: ARM Cortex-M33 secure\n" " IAR_ARM_CM33_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M33 non-trustzone non-secure\n" " IAR_ARM_CM35P_NONSECURE - Compiler: IAR Target: ARM Cortex-M35P non-secure\n" " IAR_ARM_CM35P_SECURE - Compiler: IAR Target: ARM Cortex-M35P secure\n" " IAR_ARM_CM35P_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M35P non-trustzone non-secure\n" " IAR_ARM_CM55_NONSECURE - Compiler: IAR Target: ARM Cortex-M55 non-secure\n" " IAR_ARM_CM55_SECURE - Compiler: IAR Target: ARM Cortex-M55 secure\n" ``` -------------------------------- ### Set Minimum CMake Version (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Specifies the minimum required version of CMake to build the project. ```CMake cmake_minimum_required(VERSION 3.15) ``` -------------------------------- ### Define Interrupt Priorities for RX Ports Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX600v2/readme.txt These macros, typically defined in PriorityDefinitions.h, set the kernel interrupt priority and the maximum priority for interrupts that can call FreeRTOS API functions (syscalls) for RX ports other than RX700v3_DPFPU. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Defining Kernel and Syscall Interrupt Priorities (PriorityDefinitions.h) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/IAR/RXv2/readme.txt This code snippet shows the required definitions for interrupt priority levels in PriorityDefinitions.h. This file must be provided for port_asm.s when using non-RX700v3_DPFPU ports. It defines the priority for the FreeRTOS kernel interrupt and the maximum priority allowed for interrupts that call FreeRTOS API functions. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Add FreeRTOS-Kernel Subdirectory (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/README.md If FreeRTOS-Kernel is included as a Git submodule, this CMake command adds its directory to the build process, allowing CMake to process its `CMakeLists.txt`. ```cmake add_subdirectory(${FREERTOS_PATH}) ``` -------------------------------- ### Define freertos_config INTERFACE Library Source: https://github.com/raspberrypi/freertos-kernel/blob/main/CMakeLists.txt Demonstrates the recommended way to define the `freertos_config` INTERFACE library target. This target is used to specify the include directory containing `FreeRTOSConfig.h` and set public compile definitions required by FreeRTOS. ```CMake add_library(freertos_config INTERFACE) target_include_directories(freertos_config SYSTEM INTERFACE include) # The config file directory target_compile_definitions(freertos_config PUBLIC projCOVERAGE_TEST=0) ``` -------------------------------- ### Linking Dependencies to FreeRTOS Kernel Library in CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/CMakeLists.txt This command links necessary dependencies to the `freertos_kernel` library target. It links `freertos_kernel_include` and `freertos_kernel_port_headers` publicly (affecting targets that link against `freertos_kernel`) and `freertos_kernel_port` privately (only needed for building `freertos_kernel`). ```CMake target_link_libraries(freertos_kernel PUBLIC freertos_kernel_include freertos_kernel_port_headers PRIVATE freertos_kernel_port ) ``` -------------------------------- ### Configuring Essential FreeRTOS Options for RP2350 (C) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2350_RISC-V/README.md These C preprocessor defines set essential FreeRTOS configuration options required for the RP2350 port. They disable MPU and TrustZone support and enforce running FreeRTOS only in the secure state, matching the current implementation's capabilities. ```C #define configENABLE_MPU 0 #define configENABLE_TRUSTZONE 0 #define configRUN_FREERTOS_SECURE_ONLY 1 ``` -------------------------------- ### Define FreeRTOS Interrupt Priorities (C) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/GCC/RX600v2/readme.txt This C code snippet defines the interrupt priority levels for the FreeRTOS kernel and maximum allowed priority for interrupt service routines that call FreeRTOS API functions. These definitions are required in `PriorityDefinitions.h` for `port_asm.s` when using ports other than RX700v3_DPFPU. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Including FreeRTOS Kernel in CMake Project Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2350_RISC-V/README.md This CMake command includes the FreeRTOS kernel import script, which helps locate and integrate the FreeRTOS kernel into the project build. Its placement relative to `pico_sdk_init()` depends on the Raspberry Pi Pico SDK version being used. ```CMake include(FreeRTOS_Kernel_import.cmake) ``` -------------------------------- ### Select FreeRTOS Heap Implementation (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Sets the FREERTOS_HEAP variable to "3" as a cached string, forcing the selection of a specific heap implementation for FreeRTOS. ```CMake set(FREERTOS_HEAP "3" CACHE STRING "" FORCE) ``` -------------------------------- ### Defining Interrupt Priorities in PriorityDefinitions.h (Non-RX700v3_DPFPU) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/IAR/RX700v3_DPFPU/readme.txt For FreeRTOS ports other than RX700v3_DPFPU, a PriorityDefinitions.h file must be provided for port_asm.s. This file contains definitions for the kernel interrupt priority and the maximum interrupt priority that can call FreeRTOS API functions. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Adding FreeRTOS Kernel Static Library in CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/CMakeLists.txt This command defines the main `freertos_kernel` static library target in CMake. Subsequent commands will add source files, include directories, and link dependencies to this target. ```CMake add_library(freertos_kernel STATIC) ``` -------------------------------- ### Configure RXv3 DPFPU Task Support in FreeRTOS Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX600v2/readme.txt This macro is used in FreeRTOSConfig.h to disable task support for the Double Precision FPU (DPFPU) on RXv3 cores, allowing the use of RX700v3_DPFPU ports even if DPFPU task support is not required. ```C #define configUSE_TASK_DPFPU_SUPPORT 0 ``` -------------------------------- ### Defining FreeRTOS Interrupt Priorities (C/C++) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/IAR/RX100/readme.txt This snippet shows the required definitions for interrupt priorities in `PriorityDefinitions.h`. These definitions are used by `port_asm.s` for FreeRTOS ports other than RX700v3_DPFPU to configure the kernel and maximum syscall interrupt priorities. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Defining Interrupt Priorities for Non-DPFPU Ports Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/GCC/RX100/readme.txt These macros are required in PriorityDefinitions.h for port_asm.s when using ports other than RX700v3_DPFPU. They define the priority level of the FreeRTOS kernel interrupt and the maximum priority level for interrupts that are permitted to call FreeRTOS API functions. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Disabling Task DPFPU Support in FreeRTOSConfig.h (Renesas RX) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/GCC/RX600/readme.txt This preprocessor definition in FreeRTOSConfig.h is used to make the RX700v3_DPFPU ports compatible with RX MCUs that only have a single-precision FPU (like RX66T and RX72T), effectively disabling double-precision FPU support for tasks. ```C #define configUSE_TASK_DPFPU_SUPPORT 0 ``` -------------------------------- ### Define Interrupt Priorities for port_asm.s Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/Renesas/RX100/readme.txt These definitions must be provided in PriorityDefinitions.h for port_asm.s when using FreeRTOS ports other than RX700v3_DPFPU. They set the kernel's interrupt priority and the maximum priority level from which FreeRTOS API functions can be safely called. ```C #define configKERNEL_INTERRUPT_PRIORITY 1 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 4 ``` -------------------------------- ### Including FreeRTOS Kernel via Import in CMake Source: https://github.com/raspberrypi/freertos-kernel/blob/main/portable/ThirdParty/GCC/RP2040/README.md This CMake command includes the FreeRTOS kernel into your project by processing the FreeRTOS_Kernel_import.cmake file. It automatically locates the kernel if it's a submodule or if the FREERTOS_KERNEL_PATH variable is set. ```CMake include(FreeRTOS_Kernel_import.cmake) ``` -------------------------------- ### Finding MISRA Violation References with grep Source: https://github.com/raspberrypi/freertos-kernel/blob/main/MISRA.md This command demonstrates how to use the grep utility to search the FreeRTOS kernel source code for specific MISRA violation references that have been suppressed with comments. Replace '8.4.1' with the desired rule and reference number. ```Shell grep 'MISRA Ref 8.4.1' . -rI ``` -------------------------------- ### Add Target Dependencies (CMake) Source: https://github.com/raspberrypi/freertos-kernel/blob/main/examples/coverity/CMakeLists.txt Adds a dependency for the project executable on the 'fix_source' custom target, ensuring the source modification step is completed before the executable is built. ```CMake add_dependencies(${PROJECT_NAME} fix_source) ```