Skip to content
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

pkg/cryptoauthlib: Pass ATCA_NO_HEAP Flag to library #18705

Merged
merged 1 commit into from
Oct 7, 2022

Conversation

Einhornhool
Copy link
Contributor

Contribution description

ATCA_NO_HEAP must be passed to cryptoauthlib build system in order to not use dynamic memory allocation.
Build fails when using KCONFIG for dependency resolution, because ATCA_NO_HEAP is not defined.
This fixes the problem.

Testing procedure

Build tests/pkg_cryptoauthlib_compare_sha256/ using KCONFIG dependency resolution.

@github-actions github-actions bot added the Area: pkg Area: External package ports label Oct 7, 2022
@benpicco benpicco requested a review from jue89 October 7, 2022 09:27
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 7, 2022
@riot-ci
Copy link

riot-ci commented Oct 7, 2022

Murdock results

✔️ PASSED

2be8b22 pkg/cryptoauthlib: Pass ATCA_NO_HEAP Flag to library

Success Failures Total Runtime
1980 0 1980 06m:51s

Artifacts

This only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now.

Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

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

ACK

Running:

BOARD=acd52832 TEST_KCONFIG=1 make -C tests/pkg_cryptoauthlib_compare_sha256/

now passes, but fails in master. Also it makes sense, the only thing I didn't understand is why it works with regular make. Oh well...

@Einhornhool
Copy link
Contributor Author

ACK

Running:

BOARD=acd52832 TEST_KCONFIG=1 make -C tests/pkg_cryptoauthlib_compare_sha256/

now passes, but fails in master. Also it makes sense, the only thing I didn't understand is why it works with regular make. Oh well...

I took a look at it and what I've found is, that cmake (which is being used to build the cryptoauthlib), generates an atca_config.h file in the test application pkg-build folder, in which some symbols for the build are defined.
If we pass ATCA_NO_HEAP=TRUE, it is also defined in this config file.

If we don't pass it and build with make, it does not define ATCA_NO_HEAP, but it contains the lines
#define ATCA_PLATFORM_MALLOC malloc and #define ATCA_PLATFORM_FREE free.
If we build with Kconfig, it does not contain the malloc and free defines.

I don't know why that is, but since we don't want to use malloc and free, I think this is the best fix, because it actually leads to the correct library configuration.

@miri64 miri64 merged commit 447adf7 into RIOT-OS:master Oct 7, 2022
miri64 added a commit to miri64/RIOT that referenced this pull request Oct 8, 2022
miri64 added a commit to miri64/RIOT that referenced this pull request Oct 8, 2022
@maribu maribu added this to the Release 2022.10 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants