cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to configure mbedtls in STM32CubeIDE

Advait
Associate II

I want to use the rsa feature of mbedtls but when I uncomment #define MBEDTLS_RSA_C in the mbedtls_config file it is showing undefined reference to mbedtls_rsa_get_len, mbedtls_rsa_check_pub_priv, mbedtls_rsa_init, mbedtls_rsa_free and mbedtls_rsa_import_raw.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Advait 

I sincerely apologize ,I forgot to mention the steps I have already taken.

In STM32CubeMX, follow these steps to enable RSA support in MbedTLS:

1- Under Middleware, select MbedTLS.
2- Go to the Module tab.
3- Enable the option Show Advanced Parameters.
4- In the search bar, type MBEDTLS_RSA_C.
5- When you find the MBEDTLS_RSA_C option, set it to "Defined" ( select "Defined" from the dropdown).

 

GhofraneGSOURI_0-1759490916679.png

Then Go to Feature support tab and change the value of MBEDTLS_PKCS1_V15 and MBEDTLS_PKCS1_V21 to defined 

GhofraneGSOURI_1-1759491013111.png

Generate and build the code : the rsa.c will be added successfully to your project 

GhofraneGSOURI_2-1759491160699.png

 

I am sorry again 

THX

Ghofrane

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

14 REPLIES 14
Ghofrane GSOURI
ST Employee

Hello @Advait 

Could you please provide your IOC in order to push further the investigation.

THX

Ghofrane

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.

AdvaitD
Associate

Hi @Ghofrane GSOURI 

Sorry for the late reply. Here is my ioc file.

Advait
Associate II

Hi @Ghofrane GSOURI 

I accidently logged in with my other account. you can use the ISO file provided above.

Hello @Advait 

After uncommenting the line #define MBEDTLS_RSA_C, I encountered the following build error:

In file included from ../MBEDTLS/App/mbedtls_config.h:3294,
                 from ../Middlewares/Third_Party/mbedTLS/library/camellia.c:31:
../Middlewares/Third_Party/mbedTLS/include/mbedtls/check_config.h:511:2: error: #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"
  511 | #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled"

GhofraneGSOURI_0-1759317100992.png

To resolve this issue, I also uncommented #define MBEDTLS_PKCS1_V21 in the configuration file.
After making this change, the build completed successfully  I did not encounter any undefined reference errors.

GhofraneGSOURI_1-1759317238357.png

THX

Ghofrane

 

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.

Advait
Associate II

Hello @Ghofrane GSOURI 
I uncommented #define MBEDTLS_PKCS1_V21 but its giving this build error.

Advait_0-1759468649389.png

Advait_2-1759469139894.png

 

 

Advait
Associate II

I am not able to enable features using the GUI

 

Hello @Advait 

Are you using the latest version of STM32CubeIDE 1.19.0?

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.

No, I am currently on 1.17.0

Hello @Advait 

Please use the latest version of STM32CubeIDE (1.19.0). I have already tested it, and the build completed successfully. There may be issues present in version 1.17.0 that have been resolved in 1.19.0.

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.