cancel
Showing results for 
Search instead for 
Did you mean: 

Can i use Crypto library for stm32f1x and stm32f0x? i cant see any driver for those in cubeMX ver 4.01.

sabaRamin
Associate II

i want implement software AES-GMC algotithen by STM32F030cct6. i download the CubeMX crypto library Ver 4.01. but it does not include driver for STM32F030 mcu. also in UM1924 manual is only about CubeMX crypto Ver 3.0?

please help me

thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @sabaRamin​ ,

You can add the Cryptographic library by following these steps:

1. Right click on « Project Â» and choose « Add Group… Â».

2. Create a new group called, for example,  Middlewares/STM32Cryptographic.

3. Right click on « Middlewares/STM32Cryptographic Â» and Choose ‘Add Existing Files to Group Middlewares/STM32Cryptographic’…

4. Add libSTM32Cryptographic_CM3.a from "STM32CubeExpansion_Crypto_V4.0.1\Middlewares\ST\STM32_Cryptographic\lib" 

5. Right click on “libSTM32Cryptographic_CM3.a�? in Keil project and choose “Options for file ‘libSTM32Cryptographic_CM3.a’…�?.

6. Add the path of “libSTM32Cryptographic_CM3.a�? and modify the file Type to Library file as shown in the below figure:0693W00000QNZK6QAP.png7. Click Ok.

8. Select “Options for Target�?, choose C/C++ (AC6) and add path by following these steps in the below figures:

0693W00000QNZKQQA5.png0693W00000QNZKpQAP.png8. Copy the cmox_low_level_template.c file from the interface folder to your project specific source folder and rename it into cmox_low_level.c.

9. Right click on « Application/User Â» and Choose ‘Add Existing Files to Group Application/User’…

10. Add cmox_low_level.c file and tune this file by including the right STM32 HAL driver “#include "stm32f1xx_hal.h�? instead of the comment: /* #include “stm32<series>xx_hal.h

11. Update main.c by inserting # include “cmox_crypto.h�?

12. Check that no problem happened by rebuilding all files. There must be no error and no warning.

Also, I advise you to check this wiki page on getting started with the Cryptographic Library and precisely Section 2. Creating a project that embeds the Cryptographic Library.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
KDJEM.1
ST Employee

Hi @sabaRamin​  and welcome to the Community 🙂,

You can use:

  • "libSTM32Cryptographic_CM0_CM0PLUS.a" library for STM32F0x.
  • "libSTM32Cryptographic_CM3.a" library for STM32F1x.

You can find these libraries in "STM32CubeExpansion_Crypto_V4.0.1\Middlewares\ST\STM32_Cryptographic\lib" path.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

CMYL
ST Employee

Hello Saba,

The cryptolib is Cortex-Mx dependent as described above, choose the appropriate library that is already compiled for you embedded Cortex-M version in the STM32.

BR,

Younes

Thank you Kaouthar, I found libSTM32Cryptographic_CM3.a. But how can add it to keil? Are they added like other library header and source files? in Tab C/C++? Or they need other instruction? Thank you Sent from Mail<> for Windows

Hi @sabaRamin​ ,

You can add the Cryptographic library by following these steps:

1. Right click on « Project Â» and choose « Add Group… Â».

2. Create a new group called, for example,  Middlewares/STM32Cryptographic.

3. Right click on « Middlewares/STM32Cryptographic Â» and Choose ‘Add Existing Files to Group Middlewares/STM32Cryptographic’…

4. Add libSTM32Cryptographic_CM3.a from "STM32CubeExpansion_Crypto_V4.0.1\Middlewares\ST\STM32_Cryptographic\lib" 

5. Right click on “libSTM32Cryptographic_CM3.a�? in Keil project and choose “Options for file ‘libSTM32Cryptographic_CM3.a’…�?.

6. Add the path of “libSTM32Cryptographic_CM3.a�? and modify the file Type to Library file as shown in the below figure:0693W00000QNZK6QAP.png7. Click Ok.

8. Select “Options for Target�?, choose C/C++ (AC6) and add path by following these steps in the below figures:

0693W00000QNZKQQA5.png0693W00000QNZKpQAP.png8. Copy the cmox_low_level_template.c file from the interface folder to your project specific source folder and rename it into cmox_low_level.c.

9. Right click on « Application/User Â» and Choose ‘Add Existing Files to Group Application/User’…

10. Add cmox_low_level.c file and tune this file by including the right STM32 HAL driver “#include "stm32f1xx_hal.h�? instead of the comment: /* #include “stm32<series>xx_hal.h

11. Update main.c by inserting # include “cmox_crypto.h�?

12. Check that no problem happened by rebuilding all files. There must be no error and no warning.

Also, I advise you to check this wiki page on getting started with the Cryptographic Library and precisely Section 2. Creating a project that embeds the Cryptographic Library.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

thank you Kaouthar. so complete answer. 🙂