Hi,
I need to use the cryptocell in a project with a preemptive OS. Are there any relevant code examples available, or at least some general guidelines and precautions (e.g., for the initialization of the cryptocell)?
Thanks,
Damian
Hi,
I need to use the cryptocell in a project with a preemptive OS. Are there any relevant code examples available, or at least some general guidelines and precautions (e.g., for the initialization of the cryptocell)?
Thanks,
Damian
Hi,
Cryptocell is interfaced using the cryptography library in our sdk. This is also where you can find most of the documentation. I do not see an issue in using this with a preemptive OS, as the cryptocell will interface ram using DMA. But it would make sense to make sure only one buss master access the AHB slave at the same time (see memory and AHB multilayer for details).
The problem we did face (I'm a colleague of DamianV, by the way) is that the library did block on our pre-emptive OS.
Trying for example to use the RNG functions of the cryptocell library leads to the process calling to remain waiting forever within the SaSi_HalWaitInterrupt function. My suspicion is that this function may have not been foreseen so that other interrupts than the one coming from the cryptocell may resume from the WFE, like a timer or a peripheral.
I tried to modify our test application so that the interrupt priority mask prior to calling the problematic functions is set in order to only have the cryptocell interrupt enabled, and our application didn't block anymore!
But, without confirmation that it has to be done this way, I'm a bit reluctant to do this systematically!
I did not find any example within the SDK using the cryptocell and FreeRTOS, in order to check if special handling is required in the case of a pre-emptive OS.
Hi,
You are right that this is not handled in a very good way, and your workaround is probably the best solution at this point. We hope to improve this in a future release of the CC310 runtime library, but that will not happen in the near future.
Hi Damian and Jean-Marc,
We are facing the same problem with FreeRtos and the BLE stack. The CC310 is hanging in the SaSi_HalWaitInterrupt.
How did you manege to mask the interrupts? Could you post a snippet of the code or point us in the right direction
Thanks in advance,
Rudy
Some time after the initial post, I noticed that, in the SDK 15.3, another CC310 library made its appearance: a new folder named "no-interrupts" with a .a file in it. After switching to this library, we didn't experience any problems related to the CC310 and external interrupts. The backside might be that the current consumption might be a bit higher as the processor will actively wait for the crypto-cell to finish, but the CC310 operations are mostly quite short.