cancel
Showing results for 
Search instead for 
Did you mean: 

STSAFE: Bring Up Tutorials

KMew
Senior III

Hello,

I am using a Nucleo-F401RE board with the X-Nucleo-SafeA1 expansion board (which claims it is compatible with any Nucleo development board).

I am trying to use the software package that is shown in the link below:

https://www.st.com/en/embedded-software/x-cube-safea1.html

When I use UM2646 to try to bring it up and create a simple example, but there are so many #include issues and file reference issues that it doesn't feel like I'm using a proper tutorial to learn how the firmware/hardware works. I followed the steps in Section 3.8 of the UM2646 and all the issues are still present. (Note: I have included the paths and symbols and source locations that are needed).

I have two questions:

1) Are there any tutorials that are similar to TouchGFX/BLE on bringing the STSAFE up?

2) Has anyone who has gotten the Nucleo-SAFEA1 working on a Nucleo board that's NOT the NUCLEO-L476RG board that they use in the one example? If so, what steps did you have to take?

2 REPLIES 2
Osman SOYKURT
ST Employee

Hello KMew,

I don't know about the software package you're referring to. My best advice would be to read the user manuals in the documentation part.

/Osman

Osman SOYKURT
ST Software Developer | TouchGFX
Benjamin BARATTE
ST Employee

Hello @KMew​,

Thanks for you interest in STSAFE-A110 integration.

Regarding the integration of STSAFE-A, the example are based on STM32 Nucleo BSP which is not compatible with a STM32CubeMX generated project.

I can propose a quick walkthrough in order to start your integration.

First you can do the integration in 2 steps:

  1. STSAFE-A110 Core & Service interface integration
    1. STSAFE-A core configuration
    2. I2C integration
    3. CRC
    4. RESET I/O (Not necessary with X-NUCLEO-SAFEA1 board)
    5. Time base
  2. Crypto interface integration
    1. Configuration of MbedTLS

STSAFE-A110 Core integration

  • You need to add the inc from STM32CubeExpansion_STSAFE-A_V1.2.0\Middlewares\ST\STSAFE_Axx0\CoreModules\Inc
  • You need to add the #define STSAFE_A110

STSAFE-A110 Service integration

  • I take the assumption that you have created your project with STM32CubeMX and you have selected the option "Generate peripheral initialization as pair of '.c/.h' files per peripheral"
  • You need to add the stsafea_service_interface.c code example (this example is using the I2C bus 1 from STM32CubeMX)
  • You need to add the stsafea_service_interface_conf.h code example (and to configure the include directory in your project)
  • On STM32F401, there is not HW CRC so you can stay with the software implementation
  • For the time base, the example assume you don't use RTOS and the HAL_Delay() function is correctly configured to have a 1ms granularity
  • For the HW_IO_Init, this is an example of how to configure the STSAFE-A Reset pin which is not routed on the X-NUCLEO-SAFEA1

After this step, you should be able to have the StSafeA_Echo() working.

For the cryptographic services, this is mandatory if you want to use the command authentication mechanism and/or specific use case like the StSafeA_Wrap()/StSafeA_Unwrap()

Crypto interface integration

  • You need to add the MbedTLS library to your project with the include directory in your project
  • You need to activate the following algorithm at least :
    • MBEDTLS_AES_C
    • MBEDTLS_CMAC_C
    • MBEDTLS_CIPHER_MODE_CBC
  • the default stsafea_crypto_interface.c for mbedtls should be enough.

Regarding the secure channel usage, you need first to do the pairing of your STSAFE-A.

In the stsafea_crypto_interface.c, I do not use the storing of the STSAFE-A default keys in STM32 flash to avoid to port the flash programming depending on the flash memory size.

Let me know if you manage to make your porting.

Best Regards,

Benjamin