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.

 

 

14 REPLIES 14

Hello @Ghofrane GSOURI 

I have installed the latest 1.19.0 version of stm32 cubeide but I am facing the same error.

Advait_0-1759483045693.png

Advait_1-1759483142473.png

Is there a full version of mbedtls stored locally on the system or github because it seems some files are missing in the library?

Hello @Advait 

Let's try to generate the project again , please follow those steps :

1- In your project directory, delete all files except for your .ioc file.
2- In STM32CubeIDE, delete your old project from the Project Explorer.
Important: Do not select the option to "Delete project contents on disk."
This ensures your .ioc file remains in the directory.
3- Go to File → Import → General → Import an existing STM32CubeMX Configuration File (.ioc).
4- Click Next and select your .ioc file to import the configuration.
5- After importing, generate the project code as usual

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.

Hi @Ghofrane GSOURI 
The rsa.c file was missing from the middleware package so I checked the mbedtls version in version.h file and downloaded the file from this link.
After that the build was successful.
Can you verify if the rsa.c file is not included in the mbedtls middleware package provided by ST or am I missing any configuration step?

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.

No worries @Ghofrane GSOURI  I think its working now 

Thanks a lot!!!