From 28929d896187e212dacb4b63b72f703bb7c6664e Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Wed, 22 Apr 2026 22:24:26 +0200 Subject: [PATCH 01/14] Remove NOLINT --- lib/osal/include/osal/Semaphore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/osal/include/osal/Semaphore.h b/lib/osal/include/osal/Semaphore.h index 5b2ea94..27aeee1 100644 --- a/lib/osal/include/osal/Semaphore.h +++ b/lib/osal/include/osal/Semaphore.h @@ -35,7 +35,7 @@ extern "C" { #include "internal/SemaphoreImpl.h" #include "osal/Error.h" -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) +#include /// Represents OSAL semaphore handle. /// @note Size of this structure depends on the concrete implementation. In particular, SemaphoreImpl From 6d0f25071d54f0be2db8e1dea921ed77cf96c951 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Wed, 22 Apr 2026 22:34:47 +0200 Subject: [PATCH 02/14] Remove NOLINTs 2 --- lib/osal/include/osal/Thread.h | 4 ++-- lib/osal/include/osal/sleep.h | 2 +- lib/osal/include/osal/time.h | 6 +++--- lib/osal/include/osal/timestamp.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/osal/include/osal/Thread.h b/lib/osal/include/osal/Thread.h index bee22fc..1f65383 100644 --- a/lib/osal/include/osal/Thread.h +++ b/lib/osal/include/osal/Thread.h @@ -35,8 +35,8 @@ extern "C" { #include "internal/ThreadImpl.h" #include "osal/Error.h" -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) +#include +#include /// Represents OSAL thread handle. /// @note Size of this structure depends on the concrete implementation. In particular, ThreadImpl diff --git a/lib/osal/include/osal/sleep.h b/lib/osal/include/osal/sleep.h index 493e560..d9bc28e 100644 --- a/lib/osal/include/osal/sleep.h +++ b/lib/osal/include/osal/sleep.h @@ -32,7 +32,7 @@ extern "C" { #endif -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) +#include /// Suspends the current thread for the specified amount of time in ms. /// @param cDurationMs Amount of time in ms for which current thread should be suspended. diff --git a/lib/osal/include/osal/time.h b/lib/osal/include/osal/time.h index 917b8e7..dcaaad9 100644 --- a/lib/osal/include/osal/time.h +++ b/lib/osal/include/osal/time.h @@ -34,9 +34,9 @@ extern "C" { #include "osal/Error.h" -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) +#include +#include +#include /// Converts time_t value to struct tm. /// @param value Value to be converted. diff --git a/lib/osal/include/osal/timestamp.h b/lib/osal/include/osal/timestamp.h index 3267984..ad14cca 100644 --- a/lib/osal/include/osal/timestamp.h +++ b/lib/osal/include/osal/timestamp.h @@ -32,7 +32,7 @@ extern "C" { #endif -#include // NOLINT(modernize-deprecated-headers,hicpp-deprecated-headers) +#include /// Returns the timestamp relative to library initialization in ms. /// @return Timestamp relative to library initialization in ms. From e75fa700129ea34404b0c65e0abae77b9798b8cb Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Wed, 22 Apr 2026 22:42:43 +0200 Subject: [PATCH 03/14] Add static analysis for baremetal --- .github/workflows/static-analysis.yml | 4 ++++ CMakePresets.json | 12 ++++++++++-- cmake/presets/baremetal.json | 20 ++++++++++++++++++-- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9c4e29e..9820f96 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -32,6 +32,10 @@ jobs: include: - PRESET: linux-native-conan-clang-debug DOCKER_IMAGE: kubasejdak/clang:18-24.04 + - PRESET: baremetal-armv7-m4-conan-clang-debug + DOCKER_IMAGE: kubasejdak/arm-none-eabi-clang:18-24.04 + - PRESET: freertos-armv7-m4-conan-clang-debug + DOCKER_IMAGE: kubasejdak/arm-none-eabi-clang:18-24.04 steps: - uses: actions/checkout@v6 diff --git a/CMakePresets.json b/CMakePresets.json index d0a7a56..1a1b813 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -111,11 +111,19 @@ }, { "name": "freertos-armv7-m4-conan-gcc-debug", - "inherits": ["freertos-armv7-m4", "debug", "conan"] + "inherits": ["freertos-armv7-m4-gcc", "debug", "conan"] }, { "name": "freertos-armv7-m4-conan-gcc-release", - "inherits": ["freertos-armv7-m4", "release", "conan"] + "inherits": ["freertos-armv7-m4-gcc", "release", "conan"] + }, + { + "name": "freertos-armv7-m4-conan-clang-debug", + "inherits": ["freertos-armv7-m4-clang", "debug", "conan"] + }, + { + "name": "freertos-armv7-m4-conan-clang-release", + "inherits": ["freertos-armv7-m4-clang", "release", "conan"] } ] } diff --git a/cmake/presets/baremetal.json b/cmake/presets/baremetal.json index 3bdb7db..11c6a49 100644 --- a/cmake/presets/baremetal.json +++ b/cmake/presets/baremetal.json @@ -12,11 +12,27 @@ "cacheVariables": { "PLATFORM": "freertos-arm", "BAREMETAL_ARM_TOOLCHAIN_PATH": "/opt/toolchains/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi", - "APP_C_FLAGS": "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb --specs=nano.specs", - "APP_CXX_FLAGS": "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb --specs=nano.specs", + "APP_C_FLAGS": "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb", + "APP_CXX_FLAGS": "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb", "FREERTOS_VERSION": "freertos-10.2.1", "FREERTOS_PORTABLE": "ARM_CM4F" } + }, + { + "name": "freertos-armv7-m4-gcc", + "hidden": true, + "inherits": "freertos-armv7-m4", + "cacheVariables": { + "TOOLCHAIN": "arm-none-eabi-gcc" + } + }, + { + "name": "freertos-armv7-m4-clang", + "hidden": true, + "inherits": "freertos-armv7-m4", + "cacheVariables": { + "TOOLCHAIN": "arm-none-eabi-clang" + } } ] } From 0b03f701d8e71f294000f7816aa05bf42e2150ea Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Wed, 22 Apr 2026 22:56:44 +0200 Subject: [PATCH 04/14] fix: update GIT_TAG for platform dependency in Findplatform.cmake --- cmake/modules/Findplatform.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/Findplatform.cmake b/cmake/modules/Findplatform.cmake index 928106d..779f132 100644 --- a/cmake/modules/Findplatform.cmake +++ b/cmake/modules/Findplatform.cmake @@ -1,7 +1,7 @@ include(FetchContent) FetchContent_Declare(platform GIT_REPOSITORY https://github.com/kubasejdak-org/platform.git - GIT_TAG be249886775d8c889c2cf324b736bf6da028defd + GIT_TAG 1fa3f099b16b35185507fce55946073a0d75d4e7 SOURCE_SUBDIR lib ) From a02c8fb78064c1a7d021bee7dca51de9f012d0c5 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Wed, 22 Apr 2026 23:07:54 +0200 Subject: [PATCH 05/14] fix: remove baremetal preset from static analysis workflow --- .github/workflows/static-analysis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9820f96..891f262 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -32,8 +32,6 @@ jobs: include: - PRESET: linux-native-conan-clang-debug DOCKER_IMAGE: kubasejdak/clang:18-24.04 - - PRESET: baremetal-armv7-m4-conan-clang-debug - DOCKER_IMAGE: kubasejdak/arm-none-eabi-clang:18-24.04 - PRESET: freertos-armv7-m4-conan-clang-debug DOCKER_IMAGE: kubasejdak/arm-none-eabi-clang:18-24.04 steps: From ff5762c099797220645e2ef4fac3bd015aa9253a Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Thu, 23 Apr 2026 22:04:03 +0200 Subject: [PATCH 06/14] fix: correct email formatting in copyright notice --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 23095bb..8a71b69 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Kuba Sejdak () +Copyright (c) 2019 Kuba Sejdak (kuba.sejdak@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 35d71190e0b4f2bb6f27c08daef729c8980adcd7 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sat, 2 May 2026 16:31:51 +0200 Subject: [PATCH 07/14] Add missing preset --- cmake/presets/baremetal.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/presets/baremetal.json b/cmake/presets/baremetal.json index 09bbf4e..11c6a49 100644 --- a/cmake/presets/baremetal.json +++ b/cmake/presets/baremetal.json @@ -25,6 +25,14 @@ "cacheVariables": { "TOOLCHAIN": "arm-none-eabi-gcc" } + }, + { + "name": "freertos-armv7-m4-clang", + "hidden": true, + "inherits": "freertos-armv7-m4", + "cacheVariables": { + "TOOLCHAIN": "arm-none-eabi-clang" + } } ] } From ca94be77c35640bd440dad51ecad024f0ad395ea Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sat, 2 May 2026 16:41:45 +0200 Subject: [PATCH 08/14] fix: add 'tests/init' to patterns for removal in compilation database --- tools/adjust-compilation-db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/adjust-compilation-db.py b/tools/adjust-compilation-db.py index 2bb3156..d07cb20 100755 --- a/tools/adjust-compilation-db.py +++ b/tools/adjust-compilation-db.py @@ -3,7 +3,7 @@ import json COMPILATION_DB_FILE = "compile_commands.json" -PATTERNS_TO_REMOVE = ["_deps"] +PATTERNS_TO_REMOVE = ["_deps", "tests/init"] with open(COMPILATION_DB_FILE) as file: compilation_db = json.load(file) From 0003d7f5a206b9a3babf33cfaeadfcedad9cfb89 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sat, 2 May 2026 17:34:26 +0200 Subject: [PATCH 09/14] fix: use robust grep logic in check-all-* jobs to prevent false positives The previous `grep -qvE` command exits 0 when any line does NOT match the failure pattern. If toJSON() emits multi-line JSON, bracket lines like `[` and `]` pass the filter and cause the check to incorrectly report success even when a dependency job failed. Switch to `! grep -qE` which exits non-zero when any line contains a failure indicator, regardless of JSON formatting. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/build-test-baremetal.yml | 2 +- .github/workflows/build-test-linux.yml | 2 +- .github/workflows/code-coverage.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-baremetal.yml b/.github/workflows/build-test-baremetal.yml index f1fd17c..4ef97da 100644 --- a/.github/workflows/build-test-baremetal.yml +++ b/.github/workflows/build-test-baremetal.yml @@ -55,4 +55,4 @@ jobs: # - examples-stm32f4 steps: - name: Check all jobs - run: echo '${{ toJSON(needs.*.result) }}' | grep -qvE '"(failure|cancelled|skipped)"' + run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" diff --git a/.github/workflows/build-test-linux.yml b/.github/workflows/build-test-linux.yml index 2aa8fd0..e86b7c9 100644 --- a/.github/workflows/build-test-linux.yml +++ b/.github/workflows/build-test-linux.yml @@ -181,4 +181,4 @@ jobs: - sanitizers-x64 steps: - name: Check all jobs - run: echo '${{ toJSON(needs.*.result) }}' | grep -qvE '"(failure|cancelled|skipped)"' + run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index d5c3f09..be5213a 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -66,4 +66,4 @@ jobs: - generate-coverage-report steps: - name: Check all jobs - run: echo '${{ toJSON(needs.*.result) }}' | grep -qvE '"(failure|cancelled|skipped)"' + run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 885ee1a..f994fee 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -49,4 +49,4 @@ jobs: - linting steps: - name: Check all jobs - run: echo '${{ toJSON(needs.*.result) }}' | grep -qvE '"(failure|cancelled|skipped)"' + run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" From 40438fa35e8626b29f0373378e48752cefc0e442 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sat, 2 May 2026 18:11:36 +0200 Subject: [PATCH 10/14] Change styling --- .github/workflows/build-test-baremetal.yml | 2 +- .github/workflows/build-test-linux.yml | 2 +- .github/workflows/code-coverage.yml | 2 +- .github/workflows/static-analysis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-baremetal.yml b/.github/workflows/build-test-baremetal.yml index 4ef97da..b006337 100644 --- a/.github/workflows/build-test-baremetal.yml +++ b/.github/workflows/build-test-baremetal.yml @@ -55,4 +55,4 @@ jobs: # - examples-stm32f4 steps: - name: Check all jobs - run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" + run: '! echo ''${{ toJSON(needs.*.result) }}'' | grep -qE ''"(failure|cancelled|skipped)"''' diff --git a/.github/workflows/build-test-linux.yml b/.github/workflows/build-test-linux.yml index e86b7c9..fa7cd3b 100644 --- a/.github/workflows/build-test-linux.yml +++ b/.github/workflows/build-test-linux.yml @@ -181,4 +181,4 @@ jobs: - sanitizers-x64 steps: - name: Check all jobs - run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" + run: '! echo ''${{ toJSON(needs.*.result) }}'' | grep -qE ''"(failure|cancelled|skipped)"''' diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml index be5213a..71770f7 100644 --- a/.github/workflows/code-coverage.yml +++ b/.github/workflows/code-coverage.yml @@ -66,4 +66,4 @@ jobs: - generate-coverage-report steps: - name: Check all jobs - run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" + run: '! echo ''${{ toJSON(needs.*.result) }}'' | grep -qE ''"(failure|cancelled|skipped)"''' diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index f994fee..0fdcc59 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -49,4 +49,4 @@ jobs: - linting steps: - name: Check all jobs - run: "! echo '${{ toJSON(needs.*.result) }}' | grep -qE '\"(failure|cancelled|skipped)\"'" + run: '! echo ''${{ toJSON(needs.*.result) }}'' | grep -qE ''"(failure|cancelled|skipped)"''' From 95eae01ed6e1baf51d4f7a745a9416a1d7ac9fb7 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sat, 2 May 2026 23:08:33 +0200 Subject: [PATCH 11/14] fix: update platform GIT_TAG and enhance linker script for memory section definitions --- cmake/modules/Findplatform.cmake | 2 +- tests/init/freertos-arm/stm32f407vgtx.ld | 66 +++++++++++++----------- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/cmake/modules/Findplatform.cmake b/cmake/modules/Findplatform.cmake index 972cdab..f600acc 100644 --- a/cmake/modules/Findplatform.cmake +++ b/cmake/modules/Findplatform.cmake @@ -1,7 +1,7 @@ include(FetchContent) FetchContent_Declare(platform GIT_REPOSITORY https://github.com/kubasejdak-org/platform.git - GIT_TAG db273b749620432ea33300cce10d2431fb1db1d4 + GIT_TAG b3a55804506e07e320f0cd47a28bc3f6902d50ca SOURCE_SUBDIR lib ) diff --git a/tests/init/freertos-arm/stm32f407vgtx.ld b/tests/init/freertos-arm/stm32f407vgtx.ld index 9c0830d..2b8225e 100644 --- a/tests/init/freertos-arm/stm32f407vgtx.ld +++ b/tests/init/freertos-arm/stm32f407vgtx.ld @@ -61,11 +61,19 @@ _Min_Stack_Size = 0x950; /* required amount of stack */ /* Specify the memory areas */ MEMORY { -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K +RAM (rw) : ORIGIN = 0x20000000, LENGTH = 128K +CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K } +/* Define program headers */ +PHDRS +{ + flash PT_LOAD FLAGS(5); /* Read + Execute */ + ccmram PT_LOAD FLAGS(6); /* Read + Write */ + ram PT_LOAD FLAGS(6); /* Read + Write */ +} + /* Define output sections */ SECTIONS { @@ -75,7 +83,7 @@ SECTIONS . = ALIGN(4); KEEP(*(.isr_vector)) /* Startup code */ . = ALIGN(4); - } >FLASH + } >FLASH :flash /* The program code and other data goes into FLASH */ .text : @@ -92,7 +100,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbols at end of code */ - } >FLASH + } >FLASH :flash /* Constant data goes into FLASH */ .rodata : @@ -101,54 +109,39 @@ SECTIONS *(.rodata) /* .rodata sections (constants, strings, etc.) */ *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ . = ALIGN(4); - } >FLASH + } >FLASH :flash - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH + .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH :flash .ARM : { __exidx_start = .; *(.ARM.exidx*) __exidx_end = .; - } >FLASH + } >FLASH :flash .preinit_array : { PROVIDE_HIDDEN (__preinit_array_start = .); KEEP (*(.preinit_array*)) PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH + } >FLASH :flash .init_array : { PROVIDE_HIDDEN (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array*)) PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH + } >FLASH :flash .fini_array : { PROVIDE_HIDDEN (__fini_array_start = .); KEEP (*(SORT(.fini_array.*))) KEEP (*(.fini_array*)) PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH + } >FLASH :flash _siccmram = LOADADDR(.ccmram); - /* CCM-RAM section + /* CCM-RAM section (VMA 0x10000000 — placed before .data for ascending VMA order) * * IMPORTANT NOTE! * If initialized variables will be placed in this section, @@ -163,7 +156,22 @@ SECTIONS . = ALIGN(4); _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH + } >CCMRAM AT> FLASH :ccmram + + /* used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections goes into RAM, load LMA copy after code */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + } >RAM AT> FLASH :ram /* Uninitialized data section */ @@ -180,7 +188,7 @@ SECTIONS . = ALIGN(4); _ebss = .; /* define a global symbol at bss end */ __bss_end__ = _ebss; - } >RAM + } >RAM :ram /* User_heap_stack section, used to check that there is enough RAM left */ ._user_heap_stack : @@ -193,7 +201,7 @@ SECTIONS PROVIDE (heapMax = .); . = . + _Min_Stack_Size; . = ALIGN(8); - } >RAM + } >RAM :ram From fd56e27da392b7d25513250877a0ec07a6110dd4 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sun, 3 May 2026 00:25:23 +0200 Subject: [PATCH 12/14] fix: update GIT_TAG for platform and adjust include directory visibility in CMakeLists --- cmake/modules/Findplatform.cmake | 2 +- tests/init/freertos-arm/CMakeLists.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/modules/Findplatform.cmake b/cmake/modules/Findplatform.cmake index f600acc..7372f62 100644 --- a/cmake/modules/Findplatform.cmake +++ b/cmake/modules/Findplatform.cmake @@ -1,7 +1,7 @@ include(FetchContent) FetchContent_Declare(platform GIT_REPOSITORY https://github.com/kubasejdak-org/platform.git - GIT_TAG b3a55804506e07e320f0cd47a28bc3f6902d50ca + GIT_TAG f7e9d72017452973400fa02a442b6fc3335aebc3 SOURCE_SUBDIR lib ) diff --git a/tests/init/freertos-arm/CMakeLists.txt b/tests/init/freertos-arm/CMakeLists.txt index 9e4decd..4675239 100644 --- a/tests/init/freertos-arm/CMakeLists.txt +++ b/tests/init/freertos-arm/CMakeLists.txt @@ -5,7 +5,7 @@ target_sources(platform-init PRIVATE find_package(stm32f4xx) target_include_directories(stm32f4xx - PUBLIC + SYSTEM PUBLIC . ) @@ -23,7 +23,7 @@ target_link_options(platform-init add_library(freertos-config INTERFACE) target_include_directories(freertos-config - INTERFACE + SYSTEM INTERFACE . ) From 83a057c4a5ed22f2964cb3500bf91b5c7fded4f0 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sun, 3 May 2026 00:32:38 +0200 Subject: [PATCH 13/14] Fix clang-tidy errors --- lib/osal/freertos/.clang-tidy | 6 ++++++ lib/osal/freertos/Mutex.cpp | 1 + lib/osal/freertos/Semaphore.cpp | 1 + lib/osal/freertos/Thread.cpp | 6 +++++- lib/osal/freertos/sleep.cpp | 1 + lib/osal/include/osal/Semaphore.h | 4 ++-- lib/osal/linux/Semaphore.cpp | 4 ++-- 7 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 lib/osal/freertos/.clang-tidy diff --git a/lib/osal/freertos/.clang-tidy b/lib/osal/freertos/.clang-tidy new file mode 100644 index 0000000..55e933e --- /dev/null +++ b/lib/osal/freertos/.clang-tidy @@ -0,0 +1,6 @@ +--- +InheritParentConfig: true +Checks: ' + -misc-include-cleaner +' +... diff --git a/lib/osal/freertos/Mutex.cpp b/lib/osal/freertos/Mutex.cpp index 51d37e0..8b23371 100644 --- a/lib/osal/freertos/Mutex.cpp +++ b/lib/osal/freertos/Mutex.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include diff --git a/lib/osal/freertos/Semaphore.cpp b/lib/osal/freertos/Semaphore.cpp index ba19526..66d07ef 100644 --- a/lib/osal/freertos/Semaphore.cpp +++ b/lib/osal/freertos/Semaphore.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include diff --git a/lib/osal/freertos/Thread.cpp b/lib/osal/freertos/Thread.cpp index 4fc06a1..b27849b 100644 --- a/lib/osal/freertos/Thread.cpp +++ b/lib/osal/freertos/Thread.cpp @@ -42,16 +42,20 @@ #include #include +namespace { + /// Helper thread function which is used as a wrapper for OSAL thread function. /// @param arg Helper thread arguments. /// @note This function is used to implement thread joining. -static void threadWrapper(void* arg) +void threadWrapper(void* arg) { auto* params = static_cast(arg); params->func(params->arg); osalSemaphoreSignal(¶ms->semaphore); } +} // namespace + OsalError osalThreadCreate(OsalThread* thread, OsalThreadConfig config, OsalThreadFunction func, void* arg) { return osalThreadCreateEx(thread, config, func, arg, nullptr); diff --git a/lib/osal/freertos/sleep.cpp b/lib/osal/freertos/sleep.cpp index c3fcf3f..6f6f1a2 100644 --- a/lib/osal/freertos/sleep.cpp +++ b/lib/osal/freertos/sleep.cpp @@ -34,6 +34,7 @@ #include #include +#include void osalSleepMs(uint64_t cDurationMs) { diff --git a/lib/osal/include/osal/Semaphore.h b/lib/osal/include/osal/Semaphore.h index 27aeee1..d411870 100644 --- a/lib/osal/include/osal/Semaphore.h +++ b/lib/osal/include/osal/Semaphore.h @@ -47,9 +47,9 @@ struct OsalSemaphore { /// Creates new semaphore with the given initial value. /// @param semaphore Semaphore handle to be initialized. -/// @param initialValue Initial value of the semaphore to be created. +/// @param initValue Initial value of the semaphore to be created. /// @return Error code of the operation. -OsalError osalSemaphoreCreate(OsalSemaphore* semaphore, unsigned int initialValue); +OsalError osalSemaphoreCreate(OsalSemaphore* semaphore, unsigned int initValue); /// Destroys semaphore represented by the given handle. /// @param semaphore Semaphore handle to be destroyed. diff --git a/lib/osal/linux/Semaphore.cpp b/lib/osal/linux/Semaphore.cpp index f888df6..00de20a 100644 --- a/lib/osal/linux/Semaphore.cpp +++ b/lib/osal/linux/Semaphore.cpp @@ -39,13 +39,13 @@ #include #include -OsalError osalSemaphoreCreate(OsalSemaphore* semaphore, unsigned int initialValue) +OsalError osalSemaphoreCreate(OsalSemaphore* semaphore, unsigned int initValue) { if (semaphore == nullptr) return OsalError::InvalidArgument; sem_t handle{}; - [[maybe_unused]] auto result = sem_init(&handle, 0, initialValue); + [[maybe_unused]] auto result = sem_init(&handle, 0, initValue); assert(result == 0); semaphore->impl.handle = handle; From 1dccc0a55689b97ee50c8b0cd6de9f51b0c19a02 Mon Sep 17 00:00:00 2001 From: Kuba Sejdak Date: Sun, 3 May 2026 00:40:27 +0200 Subject: [PATCH 14/14] Fix clang-tidy errors 2 --- .github/workflows/build-test-baremetal.yml | 4 ++++ lib/osal/freertos/Mutex.cpp | 2 +- lib/osal/freertos/Semaphore.cpp | 2 +- lib/osal/freertos/Thread.cpp | 5 +++-- lib/osal/freertos/sleep.cpp | 3 ++- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-baremetal.yml b/.github/workflows/build-test-baremetal.yml index b006337..bf8765e 100644 --- a/.github/workflows/build-test-baremetal.yml +++ b/.github/workflows/build-test-baremetal.yml @@ -21,6 +21,10 @@ jobs: DOCKER_IMAGE: kubasejdak/arm-none-eabi-gcc:13-24.04 - PRESET: freertos-armv7-m4-conan-gcc-release DOCKER_IMAGE: kubasejdak/arm-none-eabi-gcc:13-24.04 + - PRESET: freertos-armv7-m4-conan-clang-debug + DOCKER_IMAGE: kubasejdak/arm-none-eabi-clang:18-24.04 + - PRESET: freertos-armv7-m4-conan-clang-release + DOCKER_IMAGE: kubasejdak/arm-none-eabi-clang:18-24.04 steps: - uses: actions/checkout@v6 diff --git a/lib/osal/freertos/Mutex.cpp b/lib/osal/freertos/Mutex.cpp index 8b23371..2d012a7 100644 --- a/lib/osal/freertos/Mutex.cpp +++ b/lib/osal/freertos/Mutex.cpp @@ -37,8 +37,8 @@ #include #include #include -#include +#include #include OsalError osalMutexCreate(OsalMutex* mutex, OsalMutexType type) diff --git a/lib/osal/freertos/Semaphore.cpp b/lib/osal/freertos/Semaphore.cpp index 66d07ef..350a57e 100644 --- a/lib/osal/freertos/Semaphore.cpp +++ b/lib/osal/freertos/Semaphore.cpp @@ -37,8 +37,8 @@ #include #include #include -#include +#include #include #include diff --git a/lib/osal/freertos/Thread.cpp b/lib/osal/freertos/Thread.cpp index b27849b..7daccc7 100644 --- a/lib/osal/freertos/Thread.cpp +++ b/lib/osal/freertos/Thread.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include @@ -136,7 +137,7 @@ OsalError osalThreadJoin(OsalThread* thread) return OsalError::InvalidArgument; auto error = osalSemaphoreWait(&thread->impl.params.semaphore); - if (error) + if (error != OsalError{}) return error; thread->joined = true; @@ -150,7 +151,7 @@ void osalThreadYield() uint32_t osalThreadId() { - return static_cast(reinterpret_cast(xTaskGetCurrentTaskHandle())); + return static_cast(std::bit_cast(xTaskGetCurrentTaskHandle())); } OsalError osalThreadName(char* name, size_t size) diff --git a/lib/osal/freertos/sleep.cpp b/lib/osal/freertos/sleep.cpp index 6f6f1a2..6f906c4 100644 --- a/lib/osal/freertos/sleep.cpp +++ b/lib/osal/freertos/sleep.cpp @@ -34,7 +34,8 @@ #include #include -#include + +#include void osalSleepMs(uint64_t cDurationMs) {