Adding SMP coverity example

This commit is contained in:
Ubuntu 2024-04-18 11:56:24 +00:00
parent c6487d9472
commit 141548b03f
7 changed files with 69 additions and 4 deletions

View file

@ -23,6 +23,12 @@ target_include_directories(freertos_config
INTERFACE
./)
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()
# Select the heap. Values between 1-5 will pick a heap.
set(FREERTOS_HEAP "3" CACHE STRING "" FORCE)

View file

@ -34,9 +34,14 @@ commands in a terminal:
cov-configure --force --compiler cc --comptype gcc
~~~
2. Create the build files using CMake in a `build` directory:
Singe core FreeRTOS:
~~~
cmake -B build -S examples/coverity
~~~
SMP FreeRTOS:
~~~
cmake -B build -S examples/coverity -DFREERTOS_SMP_EXAMPLE=1
~~~
3. Build the (pseudo) application:
~~~
cd build/
@ -47,7 +52,7 @@ commands in a terminal:
~~~
cov-analyze --dir ./cov-out \
--coding-standard-config ../examples/coverity/coverity_misra.config \
--tu-pattern "file('[A-Za-z_]+\.c')"
--tu-pattern "file('[A-Za-z_]+\.c') && ( ! file('main.c') ) && ( ! file('port.c') )"
~~~
5. Generate the HTML report:
~~~