AnsweredAssumed Answered

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

Question asked by Matti Sillanpää on Aug 30, 2017
Latest reply on Sep 14, 2017 by Amel N

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 #include MBEDTLS_CONFIG_FILE.

 

#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

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:

#if !defined(MBEDTLS_NO_PLATFORM_ENTROPY)

 

#if !defined(unix) && !defined(__unix__) && !defined(__unix) && \
    !defined(__APPLE__) && !defined(_WIN32)
#error "Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in config.h" <----- fail here
#endif

 

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.

Outcomes