From c19ac1b39cb6d5a2a8b4361db63a1ea0b531997f Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 5 Aug 2025 14:48:41 +0200 Subject: [PATCH 1/4] loader: Export BT firmware symbols. Export CYW BT firmware symbols needed to load the firmware. Signed-off-by: iabdalkader --- loader/llext_exports.c | 4 ++++ .../arduino_giga_r1_stm32h747xx_m7.conf | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/loader/llext_exports.c b/loader/llext_exports.c index f1370a925..b1e733471 100644 --- a/loader/llext_exports.c +++ b/loader/llext_exports.c @@ -121,6 +121,10 @@ FORCE_EXPORT_SYM(net_buf_unref); #if defined(CONFIG_BT_HCI_SETUP) FORCE_EXPORT_SYM(bt_h4_vnd_setup); #endif +#if defined(CONFIG_CYW4343W_MURATA_1DX) +FORCE_EXPORT_SYM(brcm_patchram_buf); +FORCE_EXPORT_SYM(brcm_patch_ram_length); +#endif #endif #if defined(CONFIG_STACK_CANARIES) diff --git a/variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf b/variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf index 14f73783e..8ad58579d 100644 --- a/variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf +++ b/variants/arduino_giga_r1_stm32h747xx_m7/arduino_giga_r1_stm32h747xx_m7.conf @@ -61,7 +61,6 @@ CONFIG_BT_CTLR_ADV_EXT=y CONFIG_BT_CTLR_ADV_PERIODIC=y CONFIG_BT_CTLR_DTM_HCI=y CONFIG_CYW4343W_MURATA_1DX=y -CONFIG_BT_HCI_DRIVER_LOG_LEVEL_DBG=y CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 CONFIG_BT_RX_STACK_SIZE=4096 CONFIG_BT_HCI_TX_STACK_SIZE=4096 From 1821cb978a1e4f9d42827f472a76f907e33438ab Mon Sep 17 00:00:00 2001 From: Luca Burelli Date: Tue, 5 Aug 2025 16:17:01 +0200 Subject: [PATCH 2/4] checkpatch: temporarily ignore results The checkpatch tool fails to properly parse the kind of C++ code used in the Arduino libraries. Do not treat this as an error for now; will be replaced soon with a better solution. Signed-off-by: Luca Burelli --- .github/workflows/checkpatch.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml index 41e2f69b6..5b4bad137 100644 --- a/.github/workflows/checkpatch.yml +++ b/.github/workflows/checkpatch.yml @@ -18,6 +18,7 @@ jobs: my_review: name: checkpatch review runs-on: ubuntu-latest + continue-on-error: true steps: - name: 'Calculate PR commits + 1' run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV From 5ff2e25a5c2cbdd99c3f8e89169fa634540b519c Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Wed, 6 Aug 2025 15:24:16 +0200 Subject: [PATCH 3/4] github: Remove checkpatch workflow. Signed-off-by: iabdalkader --- .github/workflows/checkpatch.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/checkpatch.yml diff --git a/.github/workflows/checkpatch.yml b/.github/workflows/checkpatch.yml deleted file mode 100644 index 5b4bad137..000000000 --- a/.github/workflows/checkpatch.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: checkpatch review - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "main" branch - push: - branches: [ "main", "next" ] - pull_request: - branches: [ "main", "next" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - my_review: - name: checkpatch review - runs-on: ubuntu-latest - continue-on-error: true - steps: - - name: 'Calculate PR commits + 1' - run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> $GITHUB_ENV - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ env.PR_FETCH_DEPTH }} - - name: Run checkpatch review - uses: webispy/checkpatch-action@v9 - From 9422b353a70ec53bf6161935cf5a1fe39196a9ce Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Wed, 6 Aug 2025 15:29:55 +0200 Subject: [PATCH 4/4] github: Add clang format check workflow. Signed-off-by: iabdalkader --- .clang-format | 117 ++++++++++++++++++++++++++++++ .github/workflows/code_format.yml | 66 +++++++++++++++++ 2 files changed, 183 insertions(+) create mode 100644 .clang-format create mode 100644 .github/workflows/code_format.yml diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..eff78a366 --- /dev/null +++ b/.clang-format @@ -0,0 +1,117 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# Note: The list of ForEachMacros can be obtained using: +# +# git grep -h '^#define [^[:space:]]*FOR_EACH[^[:space:]]*(' include/ \ +# | sed "s,^#define \([^[:space:]]*FOR_EACH[^[:space:]]*\)(.*$, - '\1'," \ +# | sort | uniq +# +# References: +# - https://clang.llvm.org/docs/ClangFormatStyleOptions.html + +--- +BasedOnStyle: LLVM +AlignConsecutiveMacros: AcrossComments +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: None +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AttributeMacros: + - __aligned + - __deprecated + - __packed + - __printf_like + - __syscall + - __syscall_always_inline + - __subsystem +BitFieldColonSpacing: After +BreakBeforeBraces: Attach +ColumnLimit: 100 +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +ForEachMacros: + - 'ARRAY_FOR_EACH' + - 'ARRAY_FOR_EACH_PTR' + - 'FOR_EACH' + - 'FOR_EACH_FIXED_ARG' + - 'FOR_EACH_IDX' + - 'FOR_EACH_IDX_FIXED_ARG' + - 'FOR_EACH_NONEMPTY_TERM' + - 'FOR_EACH_FIXED_ARG_NONEMPTY_TERM' + - 'RB_FOR_EACH' + - 'RB_FOR_EACH_CONTAINER' + - 'SYS_DLIST_FOR_EACH_CONTAINER' + - 'SYS_DLIST_FOR_EACH_CONTAINER_SAFE' + - 'SYS_DLIST_FOR_EACH_NODE' + - 'SYS_DLIST_FOR_EACH_NODE_SAFE' + - 'SYS_SEM_LOCK' + - 'SYS_SFLIST_FOR_EACH_CONTAINER' + - 'SYS_SFLIST_FOR_EACH_CONTAINER_SAFE' + - 'SYS_SFLIST_FOR_EACH_NODE' + - 'SYS_SFLIST_FOR_EACH_NODE_SAFE' + - 'SYS_SLIST_FOR_EACH_CONTAINER' + - 'SYS_SLIST_FOR_EACH_CONTAINER_SAFE' + - 'SYS_SLIST_FOR_EACH_NODE' + - 'SYS_SLIST_FOR_EACH_NODE_SAFE' + - '_WAIT_Q_FOR_EACH' + - 'Z_FOR_EACH' + - 'Z_FOR_EACH_ENGINE' + - 'Z_FOR_EACH_EXEC' + - 'Z_FOR_EACH_FIXED_ARG' + - 'Z_FOR_EACH_FIXED_ARG_EXEC' + - 'Z_FOR_EACH_IDX' + - 'Z_FOR_EACH_IDX_EXEC' + - 'Z_FOR_EACH_IDX_FIXED_ARG' + - 'Z_FOR_EACH_IDX_FIXED_ARG_EXEC' + - 'Z_GENLIST_FOR_EACH_CONTAINER' + - 'Z_GENLIST_FOR_EACH_CONTAINER_SAFE' + - 'Z_GENLIST_FOR_EACH_NODE' + - 'Z_GENLIST_FOR_EACH_NODE_SAFE' + - 'STRUCT_SECTION_FOREACH' + - 'STRUCT_SECTION_FOREACH_ALTERNATE' + - 'TYPE_SECTION_FOREACH' + - 'K_SPINLOCK' + - 'COAP_RESOURCE_FOREACH' + - 'COAP_SERVICE_FOREACH' + - 'COAP_SERVICE_FOREACH_RESOURCE' + - 'HTTP_RESOURCE_FOREACH' + - 'HTTP_SERVER_CONTENT_TYPE_FOREACH' + - 'HTTP_SERVICE_FOREACH' + - 'HTTP_SERVICE_FOREACH_RESOURCE' + - 'I3C_BUS_FOR_EACH_I3CDEV' + - 'I3C_BUS_FOR_EACH_I2CDEV' + - 'MIN_HEAP_FOREACH' +IfMacros: + - 'CHECKIF' +# Disabled for now, see bug https://github.com/zephyrproject-rtos/zephyr/issues/48520 +#IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^".*\.h"$' + Priority: 0 + - Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|limits|locale|math|setjmp|signal|stdarg|stdbool|stddef|stdint|stdio|stdlib|string|tgmath|time|wchar|wctype)\.h>$' + Priority: 1 + - Regex: '^\$' + Priority: 2 + - Regex: '.*' + Priority: 3 +IndentCaseLabels: false +IndentGotoLabels: false +IndentWidth: 4 +InsertBraces: true +InsertNewlineAtEOF: true +SpaceBeforeInheritanceColon: False +SpaceBeforeParens: ControlStatementsExceptControlMacros +SortIncludes: Never +UseTab: ForContinuationAndIndentation +TabWidth: 4 +WhitespaceSensitiveMacros: + - COND_CODE_0 + - COND_CODE_1 + - IF_DISABLED + - IF_ENABLED + - LISTIFY + - STRINGIFY + - Z_STRINGIFY + - DT_FOREACH_PROP_ELEM_SEP diff --git a/.github/workflows/code_format.yml b/.github/workflows/code_format.yml new file mode 100644 index 000000000..1e29a2a99 --- /dev/null +++ b/.github/workflows/code_format.yml @@ -0,0 +1,66 @@ +name: Format Check + +on: + push: + paths: + - 'libraries/**/*.{c,cc,h}' + + pull_request: + types: [opened, edited, reopened, synchronize] + paths: + - 'libraries/**/*.{c,cc,h}' + +jobs: + clang-format-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: false + + - name: Install clang-format + run: sudo apt-get install -y clang-format + + - name: Determine base ref + id: base + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "base_ref=origin/${{ github.event.pull_request.base.ref }}" >> $GITHUB_OUTPUT + else + echo "base_ref=HEAD~1" >> $GITHUB_OUTPUT + fi + + - name: Find changed files + id: files + run: | + base_ref="${{ steps.base.outputs.base_ref }}" + git fetch origin $base_ref + git diff --name-only --diff-filter=ACMR "$base_ref" HEAD \ + | grep -E '\.(c|cpp|h)$' \ + | grep -E '^src/|^include/|^lib/' || true > changed-files.txt + echo "Files to check:" + cat changed-files.txt || echo "No matching files" + + - name: Run clang-format checks + run: | + failed=0 + while IFS= read -r file; do + if [ -f "$file" ]; then + echo "Checking $file" + diff_output=$(clang-format "$file" | diff -u "$file" -) + if [ -n "$diff_output" ]; then + echo "✖ Formatting issue in: $file" + echo "$diff_output" + failed=1 + fi + fi + done < changed-files.txt + + if [ "$failed" -ne 0 ]; then + echo "::error::clang-format check failed" + exit 1 + fi + + echo "✔ All files are properly formatted."