2025-09-23 1:12 AM
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.
Solved! Go to Solution.
2025-10-03 2:19 AM
Hello @Ghofrane GSOURI
I have installed the latest 1.19.0 version of stm32 cubeide but I am facing the same error.
Is there a full version of mbedtls stored locally on the system or github because it seems some files are missing in the library?
2025-10-03 2:35 AM
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.
2025-10-03 3:30 AM
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?
2025-10-03 4:37 AM - edited 2025-10-03 4:41 AM
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).
Then Go to Feature support tab and change the value of MBEDTLS_PKCS1_V15 and MBEDTLS_PKCS1_V21 to defined
Generate and build the code : the rsa.c will be added successfully to your project
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.
2025-10-03 10:18 PM
No worries @Ghofrane GSOURI I think its working now
Thanks a lot!!!