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

Cryptocell 310 doesn't work on NRF52840_DK #7069

Closed
pan- opened this issue May 31, 2018 · 9 comments
Closed

Cryptocell 310 doesn't work on NRF52840_DK #7069

pan- opened this issue May 31, 2018 · 9 comments

Comments

@pan-
Copy link
Member

pan- commented May 31, 2018

Description

When I do compile with GCC for the NRF52840, the function trng_get_bytes present in the crypto cell features never returns when it calls LLF_RND_GetTrngSource.

With the help of the debugger I'm able to see that the application is actually stuck in a loop in the function LLF_RND_StartTrngHW().

Also it looks like there's a leftover a merge operation in GCC's binary folder

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

@pan-
Copy link
Member Author

pan- commented May 31, 2018

@RonEld

@RonEld
Copy link
Contributor

RonEld commented May 31, 2018

@pan- thank you for pointing to the leftover. It's probably a bug in the rebasing I have done.

@RonEld
Copy link
Contributor

RonEld commented May 31, 2018

@pan- could you mention how you reproduce this issue?
Have you called mbedtls_platform_setup() before the calls to Mbed TLS and mbedtls_platform_teardown() at the end?

@pan-
Copy link
Member Author

pan- commented Jun 1, 2018

@RonEld Thanks for pointing out the functions to use unfortunately the implementation will not scale well with libraries.

In my case, BLE, some crypto operations may be done by the controller attached to the board or by mbedtls so we can't ask users to perform blindly a tls platform setup and teardown as we don't want to pay for code that we don't use.

As a consequence the setup and teardown operations must be made in the implementation of the BLE abstraction when necessary. In the meantime application code or another library may also setup and teardown others mbedtls_platform_context when necessary.

Unfortunately platform setup and teardown do not operate on context passed in parameter: they do operate on global context (1, 2).

This can cause troubles if one module of the application has its platform context running while another application module terminate its own context.

@ciarmcom
Copy link
Member

ciarmcom commented Jun 1, 2018

ARM Internal Ref: IOTSSL-2334

@RonEld
Copy link
Contributor

RonEld commented Jun 4, 2018

@pan- I have added a reference counter for these functions, in #7099 that should now fit your needs.
Now BLE whould be ale to setup \ teardown the platform without interrupting application module.

Will this fit your needs?

@marcuschangarm
Copy link
Contributor

Perhaps we should disable Cryptocell support on the NRF52840 until we have a more permanent solution? At the moment it will only lead to problems under certain circumstances.

@RonEld
Copy link
Contributor

RonEld commented Sep 3, 2018

The first part of this issue has been fixed and merged in #7099

The second part of this issue has been fixed and merged in #7074

I think we can close this issue

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 3, 2018

I'll close this, and should be removed from known issues for upcoming 5.10 (if its still there)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants