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 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-09-24 1:45 AM
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.
2025-10-01 1:43 AM
Sorry for the late reply. Here is my ioc file.
2025-10-01 1:47 AM
I accidently logged in with my other account. you can use the ISO file provided above.
2025-10-01 4:19 AM
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"
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.
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-02 10:17 PM - edited 2025-10-02 10:25 PM
2025-10-02 10:18 PM
I am not able to enable features using the GUI
2025-10-03 12:29 AM
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.
2025-10-03 12:32 AM
No, I am currently on 1.17.0
2025-10-03 1:13 AM
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.