2024-04-15 07:20 AM
Why is MX_MBEDTLS_Init called twice at startup when using stm32CubeMx code generation?
Solved! Go to Solution.
2024-07-05 07:14 AM
Hello @themarcman ,
The issue was fixed in release 6.12 of CubeMX available on the ST website .
Regards
2024-04-15 09:00 AM
Hello @themarcman ,
can you specify the version of cubeMX and the version of the cube firmware package (STM32Cube_FW_xx_Vx.xx.x) you are using to try and reproduce this .
BR
2024-04-15 10:08 AM
Thanks for the reply @STea.
I will get back to you tomorrow morning!
2024-04-16 12:44 AM
I'm using STM32CubeIDE version 1.14.1 build 20064_20240111_1413
STM32CubeMX version 6.10.0-RC9 build 20231120-2037
Firmware package version : STM32Cube_FW_F4 V1.28.0
I am using an stm32f439ZITx for my application.
Thank you!
2024-04-16 09:06 AM
Hello @themarcman ,
I have tried to reproduce the same issue you are describing but I don't see the function called twice it is called once after code generation.
BR
2024-04-16 10:15 AM
Thank you for the reply @STea!
Sorry I did not specify I am using freeRTOS, in combination with lwip.
2024-04-18 04:55 AM
@STeaI've reinstalled STM32CubeIDE and started a new branch so that I could reconfigure mbedtls from scratch.
MX_MBEDTLS_Init is still called twice. You can find my project in the 7z attachment.
I'm also a bit confused as to why the function is called before FreeRTOS is running.
mbedtls_net_init calls MX_LWIP_Init and this should be called at the start of mbedtls configuration from what I see in examples : https://github.com/Mbed-TLS/mbedtls/blob/development/programs/ssl/ssl_client1.c
However MX_LWIP_Init also creates two threads so it cannot be called before FreeRTOS runs.
osThreadDef(EthLink, ethernet_link_thread, osPriorityBelowNormal, 0, configMINIMAL_STACK_SIZE *2);
and
osThreadCreate (osThread(EthLink), &gnetif);
Thank you for your time,
Marc Robison
2024-04-18 08:18 AM
Hello @themarcman ,
I reported the issue internally.
Internal ticket number: 179282 . (This is an internal tracking number and is not accessible or usable by customers).
Thank you.
2024-07-05 07:14 AM
Hello @themarcman ,
The issue was fixed in release 6.12 of CubeMX available on the ST website .
Regards