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

Fix iar compilation issues #39

Merged
merged 4 commits into from
Feb 25, 2020

Conversation

dgreen-arm
Copy link
Contributor

This PR updates the atecc608a driver to include a version of cryptoauthlib that supports IAR.

This uncovered a few issues with IAR that this PR also fixes.

Update to a version of mbed-os-atecc608a that ignores
cryptoauthlib's app/api_206a, as we don't need it and it currently
doesn't build with IAR.
@dgreen-arm
Copy link
Contributor Author

Test run with ARM and IAR compilers: https://jenkins-internal.mbed.com/job/mbed-crypto-release-ci-testing/664/

@@ -103,7 +103,7 @@ enum {
key_bits = 256,
hash_alg = PSA_ALG_SHA_256,
alg = PSA_ALG_ECDSA(hash_alg),
sig_size = PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE(key_type, key_bits, alg),
Copy link
Contributor

Choose a reason for hiding this comment

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

In "Set signature size directly", could you copy and paste the error or warning message into the commit message? It'll help to make it more clear why this failed in IAR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

atecc608a/atecc608a_utils.c Show resolved Hide resolved
As we know this example is using ECC, set the signature size
directly rather than using PSA_ASYMMETRIC_SIGN_OUTPUT_SIZE, as it
gives the following error with IAR:

Error[Pe184]: type of cast must be arithmetic or pointer
The atCRC function wants crc to be a uint8_t array of length 2,
while atcab_lock_config_zone_crc wants crc to be a uint16_t.
IAR treats this as an error rather than a warning like ARM and GCC,
so handle it explicitly.
@Patater Patater merged commit ca0dbda into ARMmbed:master Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants