cancel
Showing results for 
Search instead for 
Did you mean: 

STM32Cube_FW_F7_V1.7.0 mbed tls client examples fail out-of-box

Posted on August 30, 2017 at 09:33

Hi.

So both mbed tls examples in F7 v.1.7.0 seem to fail to compile. Few others I've tried from same SDK seem to compile & work ok.

First issue seems to be the preprocessor parameter for mbedtls_config.h. I couldn't spot any problems in the config but this is the result:

0:18:29 **** Incremental Build of configuration Debug for project STM32F769I_Discovery ****

make all

Building file: /home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Utilities/Log/lcd_log.c

Invoking: MCU GCC Compiler

/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Projects/STM32F769I-Discovery/Applications/mbedTLS/SSL_Client/SW4STM32/STM32F769I_Discovery/Debug

arm-none-eabi-gcc -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-d16 -DUSE_HAL_DRIVER -D_SYS_TIME_H_ -D_TIMEVAL_DEFINED -DSTM32F769xx -DUSE_STM32F769I_DISCO -DMBEDTLS_CONFIG_FILE=<mbedtls_config.h> -DUSE_LCD -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Projects/STM32F769I-Discovery/Applications/mbedTLS/SSL_Client/Inc' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Drivers/CMSIS/Device/ST/STM32F7xx/Include' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Drivers/CMSIS/Include' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Drivers/STM32F7xx_HAL_Driver/Inc' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Drivers/BSP/STM32F769I-Discovery' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Drivers/BSP/Components' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/LwIP/src/include' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/LwIP/system' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/FreeRTOS/Source' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/FreeRTOS/Source/include' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Middlewares/Third_Party/mbedTLS/include' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Utilities' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Utilities/Fonts' -I'/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Utilities/Log'  -Os -g3 -Wall -fmessage-length=0 -Wno-format -Wno-return-type -Wno-pointer-sign -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF'Utilities/Log/lcd_log.d' -MT'Utilities/Log/lcd_log.o' -o 'Utilities/Log/lcd_log.o' '/home/matti/STMworkspace/STM32Cube_FW_F7_V1.7.0/Utilities/Log/lcd_log.c'

/bin/sh: 1: cannot open mbedtls_config.h: No such file

Utilities/Log/subdir.mk:18: recipe for target 'Utilities/Log/lcd_log.o' failed

make: *** [Utilities/Log/lcd_log.o] Error 2

As you can see there the crusial -DMBEDTLS_CONFIG_FILE=<mbedtls_config.h>. Also interestingly the eclipse sees the file OK when I browse the source file, like below and is accessible via the &sharpinclude MBEDTLS_CONFIG_FILE.

&sharpif !defined(MBEDTLS_CONFIG_FILE)

&sharpinclude 'mbedtls/config.h'

&sharpelse

&sharpinclude MBEDTLS_CONFIG_FILE

&sharpendif

I tinkered with this a bit, and removed the config file inclusion(-DMBEDTLS_CONFIG_FILE=<mbedtls_config.h>) from preprocessor settings. I copied the mbed_config.h to config.h so that the same config can be found according to above condition. However this fails too. So far the platform specific checks in entropy_poll.c and timings.c fail here:

&sharpif !defined(MBEDTLS_NO_PLATFORM_ENTROPY)

&sharpif !defined(unix) && !defined(__unix__) && !defined(__unix) && \

    !defined(__APPLE__) && !defined(_WIN32)

&sharperror 'Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in config.h' <----- fail here

&sharpendif

So. Is these examples verified to be working? I've tested so far:

STM32Cube_FW_F7_V1.7.0/./Projects/STM32756G_EVAL/Applications/mbedTLS/SSL_Client

and

STM32Cube_FW_F7_V1.7.0/./Projects/STM32F769I-Discovery/Applications/mbedTLS/SSL_Client

Both have similar symptoms. I'm especially concerned about the platform specific checks.

I'm using Eclipse mars with openstm libraries in Ubuntu 16.04. And as said, all other examples for F4 and F7 work just fine except the mbed_tls related in F7.

#stm32f7 #mbedtls #stm32cube_fw_f7_v1.7.0
2 REPLIES 2
Posted on August 30, 2017 at 09:49

Ah. Noticed the problem. It should be -DMBEDTLS_CONFIG_FILE='<mbedtls_config.h>'. So you guys should fix the project preprocessor setting.

Amel NASRI
ST Employee
Posted on September 14, 2017 at 17:11

Hi

Sillanp__.Matti

‌,

The problem should be already fixed with latest STM32CubeF7 package (1.8.0) and latest updates for SW4STM

Could you please use same environment?

-Amel

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.