Skip to content

Update ChibiOS HAL to v9.0 #3202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025
Merged

Update ChibiOS HAL to v9.0 #3202

merged 1 commit into from
Aug 12, 2025

Conversation

josesimoes
Copy link
Member

@josesimoes josesimoes commented Aug 11, 2025

Description

  • Update declaration of ChibiOS HAL to v9.0.

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

Summary by CodeRabbit

  • Chores
    • Bumped HAL configuration version across multiple ST and ORGPAL targets (updated HAL config to v9.0 for improved compatibility and consistency).

@josesimoes josesimoes added the Platform: STM32 Everything related specifically with ChibiOS platform label Aug 11, 2025
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Walkthrough

Bumped the HAL configuration version macro from CHIBIOS_HAL_CONF_VER_8_4 to CHIBIOS_HAL_CONF_VER_9_0 in multiple target halconf.h files; one file also had a minor end-of-file formatting adjustment.

Changes

Cohort / File(s) Summary
AzureRTOS halconf.h updates
targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/halconf.h, targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/halconf.h, targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/halconf.h, targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoCLR/halconf.h
Updated macro _CHIBIOS_HAL_CONF_VER_8_4__CHIBIOS_HAL_CONF_VER_9_0_; one file corrected EOF newline/formatting.
ChibiOS halconf.h updates
targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/halconf.h, targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/halconf.h, targets/ChibiOS/ORGPAL_PALX/nanoBooter/halconf.h, targets/ChibiOS/ORGPAL_PALX/nanoCLR/halconf.h, targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/halconf.h, targets/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/halconf.h, targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/halconf.h, targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoCLR/halconf.h, targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h, targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/halconf.h
Updated macro _CHIBIOS_HAL_CONF_VER_8_4__CHIBIOS_HAL_CONF_VER_9_0_ in each listed halconf.h.

Sequence Diagram(s)

(omitted — changes are simple macro updates, no control-flow modifications)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chibios-hal-v9

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@nfbot nfbot added the Type: dependencies Pull requests that update a dependency file(s) or version label Aug 11, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/halconf.h (1)

312-318: New I2C slave-mode toggle added — OK. Consider tightening the docstring.

Doc says “Enables the I2C slave subsystem,” but this macro indicates platform support rather than enabling a subsystem by itself.

Optionally adjust wording:

 /**
- * @brief   Enables the I2C slave subsystem.
+ * @brief   Target supports I2C slave mode.
+ * @note    This is a capability flag; enabling and usage are controlled elsewhere.
  */

If this will be defined in many halconf.h files, consider moving a default to halconf_nf.h to reduce duplication.

targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoCLR/halconf.h (1)

311-317: I2C slave-mode define — OK. Optional doc clarity.

If you want to avoid confusion between “support” and “enable”, consider rewording:

- * @brief   Enables the I2C slave subsystem.
+ * @brief   Target supports I2C slave mode (capability flag).
targets/ChibiOS/ORGPAL_PALX/nanoCLR/halconf.h (1)

311-317: I2C slave-mode capability — LGTM. Optional: centralize default.

Given this macro repeats across many targets (nanoBooter and nanoCLR), consider a single default in halconf_nf.h with per-target overrides only when needed.

targets/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/halconf.h (1)

312-318: I2C_SUPPORTS_SLAVE_MODE added — LGTM.

Safe default. If any F0-based boards plan slave-mode, document enabling in target config.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7d581b and c41935a.

📒 Files selected for processing (14)
  • targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/halconf.h (2 hunks)
  • targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/halconf.h (2 hunks)
  • targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/halconf.h (3 hunks)
  • targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoCLR/halconf.h (2 hunks)
  • targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/halconf.h (2 hunks)
  • targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/halconf.h (2 hunks)
  • targets/ChibiOS/ORGPAL_PALX/nanoBooter/halconf.h (2 hunks)
  • targets/ChibiOS/ORGPAL_PALX/nanoCLR/halconf.h (2 hunks)
  • targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/halconf.h (2 hunks)
  • targets/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/halconf.h (2 hunks)
  • targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/halconf.h (2 hunks)
  • targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoCLR/halconf.h (2 hunks)
  • targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h (2 hunks)
  • targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/halconf.h (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ST_NUCLEO64_F091RC)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
🔇 Additional comments (24)
targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/halconf.h (1)

24-24: HAL config version bump to 9.0 confirmed repo-wide

  • No occurrences of _CHIBIOS_HAL_CONF_VER_8_ remain.
  • Every halconf.h defines only _CHIBIOS_HAL_CONF_VER_9_0_.
  • The I2C_SUPPORTS_SLAVE_MODE macro is present (defaulting to FALSE) in all ChibiOS and AzureRTOS HAL configs; no 9.0-required symbols are missing.
targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/halconf.h (2)

24-24: HAL config version 9.0 bump — LGTM.


311-317: I2C_SUPPORTS_SLAVE_MODE addition — LGTM.

targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoCLR/halconf.h (1)

24-24: HAL config version 9.0 bump — LGTM.

targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/halconf.h (2)

24-24: HAL config version 9.0 bump — LGTM.


300-306: I2C_SUPPORTS_SLAVE_MODE — LGTM.

targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoCLR/halconf.h (2)

24-24: HAL config version 9.0 bump — LGTM.


312-318: I2C slave-mode flag — LGTM. Ensure usage sites gate on this macro.

Please confirm any I2C slave-mode code paths are wrapped with #if I2C_SUPPORTS_SLAVE_MODE to prevent accidental inclusion where unsupported.

targets/ChibiOS/ORGPAL_PALX/nanoBooter/halconf.h (2)

24-24: HAL config version 9.0 bump — LGTM.


300-306: I2C_SUPPORTS_SLAVE_MODE — LGTM.

targets/ChibiOS/ORGPAL_PALX/nanoCLR/halconf.h (1)

24-24: HAL config version 9.0 bump — LGTM.

targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/halconf.h (2)

24-24: HAL config version 9.0 bump — LGTM.


300-306: I2C_SUPPORTS_SLAVE_MODE — LGTM.

targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h (1)

24-24: All HAL config macros updated to 9.0 — no stale 8.4 macros found

  • Verified that _CHIBIOS_HAL_CONF_VER_8_4_ does not appear anywhere in the tree.
  • Confirmed _CHIBIOS_HAL_CONF_VER_9_0_ is defined in every targets/**/halconf.h (including ST_STM32F769I_DISCOVERY/nanoBooter).

LGTM.

targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/halconf.h (2)

24-24: HAL conf version bumped to 9.0 — LGTM.

Matches nanoBooter; good consistency.


313-319: I2C_SUPPORTS_SLAVE_MODE added — LGTM.

Definition and placement look good and consistent with nanoBooter for this board.

targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/halconf.h (2)

24-24: HAL conf version bumped to 9.0 — LGTM.


300-306: I2C_SUPPORTS_SLAVE_MODE introduced — LGTM.

Default FALSE with DOXYGEN guard matches the project pattern.

targets/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/halconf.h (1)

24-24: HAL conf version bumped to 9.0 — LGTM.

targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/halconf.h (3)

24-24: HAL conf version bumped to 9.0 — LGTM.


300-306: I2C_SUPPORTS_SLAVE_MODE added — LGTM.

Consistent with other targets.


556-556: EOF formatting tweak — OK.

Non-functional newline/formatting update.

targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/halconf.h (2)

24-24: HAL conf version bumped to 9.0 — LGTM.


300-306: I2C_SUPPORTS_SLAVE_MODE added — LGTM.

Pattern and default align with other boards.

Comment on lines 300 to 306
/**
* @brief Enables the I2C slave subsystem.
*/
#if !defined(I2C_SUPPORTS_SLAVE_MODE) || defined(__DOXYGEN__)
#define I2C_SUPPORTS_SLAVE_MODE FALSE
#endif

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

New I2C_SUPPORTS_SLAVE_MODE macro — LGTM. Minor wording nit.

The macro name signals capability, but the brief says “Enables…”. Consider clarifying the brief to avoid confusion.

-/**
- * @brief   Enables the I2C slave subsystem.
- */
+/**
+ * @brief   Indicates whether the I2C driver supports slave mode.
+ */

Also suggest a quick scan to ensure this macro isn’t redefined elsewhere (e.g., overlays) unless intentionally overridden.


🏁 Script executed:

#!/bin/bash
# Check for multiple/conflicting definitions or alternative spellings.
rg -n --no-heading $'^\\s*#\\s*define\\s+I2C_SUPPORTS_SLAVE_MODE\\b'
rg -n "I2C_.*SLAVE" -S

Length of output: 9144


Clarify I2C_SUPPORTS_SLAVE_MODE doxygen brief

We searched all halconf.h files across targets and found only the default definitions—no conflicting overrides—so updating the comment is safe.

Please update in targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h (and similarly in other target folders if you wish to keep consistency):

-/**
- * @brief   Enables the I2C slave subsystem.
- */
+/**
+ * @brief   Indicates whether the I2C driver supports slave mode.
+ */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* @brief Enables the I2C slave subsystem.
*/
#if !defined(I2C_SUPPORTS_SLAVE_MODE) || defined(__DOXYGEN__)
#define I2C_SUPPORTS_SLAVE_MODE FALSE
#endif
/**
* @brief Indicates whether the I2C driver supports slave mode.
*/
#if !defined(I2C_SUPPORTS_SLAVE_MODE) || defined(__DOXYGEN__)
#define I2C_SUPPORTS_SLAVE_MODE FALSE
#endif
🤖 Prompt for AI Agents
In targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h around lines 300
to 306, the Doxygen brief for I2C_SUPPORTS_SLAVE_MODE is too terse; update the
comment to clearly state that this macro enables or disables HAL support for I2C
slave mode (default FALSE here), when it should be set to TRUE (if the
board/driver needs slave functionality), and that it controls compilation of
slave-related code paths; make the same wording change in other target halconf.h
files for consistency.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/halconf.h (1)

24-24: Double-check cross-target uniformity and I2C slave-mode toggle presence.

  • Verify no target still defines CHIBIOS_HAL_CONF_VER_8_x.
  • Confirm the new I2C slave-mode define is declared where needed (likely in halconf_nf.h) and gated to HAL 9.0 to avoid breaking older boards if any remain.

Use the same verification script provided in the other file’s comment. I can follow up with a small patch to add the define across overlays once the correct macro name is verified.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c41935a and fc88300.

📒 Files selected for processing (14)
  • targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/halconf.h (1 hunks)
  • targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/halconf.h (1 hunks)
  • targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/halconf.h (2 hunks)
  • targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoCLR/halconf.h (1 hunks)
  • targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/halconf.h (1 hunks)
  • targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/halconf.h (1 hunks)
  • targets/ChibiOS/ORGPAL_PALX/nanoBooter/halconf.h (1 hunks)
  • targets/ChibiOS/ORGPAL_PALX/nanoCLR/halconf.h (1 hunks)
  • targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/halconf.h (1 hunks)
  • targets/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/halconf.h (1 hunks)
  • targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/halconf.h (1 hunks)
  • targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoCLR/halconf.h (1 hunks)
  • targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h (1 hunks)
  • targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/halconf.h (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (12)
  • targets/ChibiOS/ST_NUCLEO64_F091RC/nanoBooter/halconf.h
  • targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoCLR/halconf.h
  • targets/ChibiOS/ORGPAL_PALTHREE/nanoBooter/halconf.h
  • targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoCLR/halconf.h
  • targets/ChibiOS/ST_NUCLEO64_F091RC/nanoCLR/halconf.h
  • targets/ChibiOS/ST_STM32F769I_DISCOVERY/nanoBooter/halconf.h
  • targets/ChibiOS/ORGPAL_PALTHREE/nanoCLR/halconf.h
  • targets/ChibiOS/ORGPAL_PALX/nanoCLR/halconf.h
  • targets/ChibiOS/ORGPAL_PALX/nanoBooter/halconf.h
  • targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoCLR/halconf.h
  • targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoCLR/halconf.h
  • targets/AzureRTOS/ST/ST_B_L475E_IOT01A/nanoBooter/halconf.h
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: nf-interpreter (Check_Code_Style)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ST_NUCLEO64_F091RC)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALX)
  • GitHub Check: nf-interpreter (Nightly build) (Build_STM32_targets ORGPAL_PALTHREE)
  • GitHub Check: nf-interpreter (Nightly build) (Check_Build_Options)
  • GitHub Check: nf-interpreter (Check_Build_Options)
🔇 Additional comments (3)
targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/halconf.h (2)

24-24: HAL conf version bump to 9.0 is appropriate.

This aligns with the PR objective to update to ChibiOS HAL v9.0.


24-24: Add STM32_I2C_SLAVE_ENABLE to ST-port HAL 9.0 config overlays

All targets have been bumped to _CHIBIOS_HAL_CONF_VER_9_0_ and there are no leftover 8.x definitions. However, the STM32-specific I2C slave-enable macro isn’t defined in any of the halconf_nf.h overlays, so slave support won’t be compiled in.

Please update each ST-port halconf_nf.h (e.g.
targets/AzureRTOS/ST/ORGPAL_PALTHREE/nanoBooter/halconf_nf.h,
…/nanoCLR/halconf_nf.h, as well as the other ST targets) to include:

+#if !defined(STM32_I2C_SLAVE_ENABLE)
+#define STM32_I2C_SLAVE_ENABLE   TRUE
+#endif

This ensures the ChibiOS LLD conditional around I2C_SUPPORTS_SLAVE_MODE is actually enabled. Once the macro is in place, rebuild to verify that I2C slave paths are pulled in.

Likely an incorrect or invalid review comment.

targets/ChibiOS/ST_STM32F429I_DISCOVERY/nanoBooter/halconf.h (1)

24-24: HAL conf version macro updated correctly to 9.0.

Change is scoped and matches the stated dependency bump.

@josesimoes josesimoes merged commit 5be3425 into main Aug 12, 2025
15 checks passed
@josesimoes josesimoes deleted the chibios-hal-v9 branch August 12, 2025 15:10
josesimoes added a commit to OrgPal/nf-interpreter that referenced this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: STM32 Everything related specifically with ChibiOS platform Type: dependencies Pull requests that update a dependency file(s) or version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants