Add proper Zephyr module support with updated HAL for v3/v4 compatibility #407
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces first-class support for integrating CryptoAuthLib as a Zephyr module, compatible with Zephyr v3 and v4. It enables seamless integration into modern Zephyr-based applications using CMake and Kconfig, and updates the I2C and SPI HALs to align with Zephyr's evolving include path conventions.
Key Changes
module.yml
to enable Zephyr module recognition via west.ATCA_ZEPHYR_SUPPORT
CMake option to toggle Zephyr build mode.zephyr_options.cmake
to mapCONFIG_ATCA_*
Kconfig options to internal CMake flags.zephyr/drivers/...
) required in Zephyr ≥ v3.zephyr_library()
when enabledIntegration Instructions
To include CryptoAuthLib as a Zephyr module:
Option 1: In-tree
Place CryptoAuthLib under
modules/lib/cryptoauthlib
and it will be automatically detected.Option 2: Out-of-tree
If using a separate path:
Kconfig Support
Once integrated, you can configure CryptoAuthLib via
prj.conf
using new symbols:These options automatically propagate to the CMake build system, enabling or disabling relevant sources and flags.
Compatibility Notes
Request
If possible, please test against MPLAB Harmony and existing Linux builds to ensure continued compatibility. Feedback and improvements welcome!
Feature branch: https://github.com/BitConcepts/cryptoauthlib/tree/feature/zephyr-module-support-v3-v4