7 years, 6 months ago.

mbed Client: How to enable HW Entropy for Nucleo-L152RE / SIM808 GSM

I successfully established a "unsecure" connection to mbed device connector Using Nucleo-L152RE with my SIM808 GSM Shield.

Next step would be to implement proper hardware entropy to connect to mbed Device Connector in Secure Mode.

As what I understand there are two function calls that I have to implement:

  • _interface->set_random_number_callback(&get_random_number)
  • _interface->set_entropy_callback(ent_cb);

Unfortunately I do not know how to implement "get_random_number" and "ent_cb" in order to avoid the following connection Error: [ERROR:] M2MInterface::SecureConnectionFailed.

I already used the examples given under https://docs.mbed.com/docs/mbed-client-guide/en/latest/Introduction/ but they do not solve the above mentioned connection error.

Any advise is highly appreciated!

1 Answer

7 years, 6 months ago.

For the TRNG function, take a look at the trng_api.c files in mbed-os master (e.g. K64F). We'll be adding trng as HAL feature in mbed OS 5.2 so that should make porting easier too.