CMake with STM32H7 FreeRTOS+TCP

Hi everyone,

Im trying to config FreeRTOS+TCP with cmake.

I used FetchContnet and i did:
set(FREERTOS_PLUS_TCP_NETWORK_IF “STM32HXX” CACHE STRING “ FORCE)\

And
set(FREERTOS_PLUS_TCP_NETWORK_IF “STM32” CACHE STRING “ FORCE)

and i linked the libraries.

By some reason it says “Unknown STM32 Family for network interface”

But I have define in my code of STM32H7.

Do i need to add something elso to the cmake or it automaticlly find the networkinterface source file and use it? and the drivers?

Any ideas?
ty

Can you share the complete output? You probably need to declare FREERTOS_PLUS_TCP_STM32_IF_DRIVER too.

Thx for your response.Im getting:
#error "Unknown STM32 Family for NetworkInterfce"
#error "HAL_ETH_MODULE_ENABLE must be enabled for NetworkInterface"
#error "Unsupported ipConfigNETWORK_MTU size fir NetworkInterface"

Its looks like the include of the drivers is not working because im also getting:

in stm32h7xx_hal_conf.h:
stm32h7xx_hal_eth.h: No such file or directory.

Do i need to do include_directories in my cmake for also the FreeRTOS+TCP or doing FetchContent & MakeContentAvailable is enough?

An example of a cmake or ideas would be great.

Thanks alot.

Hi @aob,
From your error messages, the include path is not correctly configured.

#error "HAL_ETH_MODULE_ENABLE must be enabled for NetworkInterface"

HAL_ETH_MODULE_ENABLE is supposed to be defined in your *_hal_conf.h

#if ( ipconfigNETWORK_MTU < ETH_MIN_PAYLOAD ) || ( ipconfigNETWORK_MTU > ETH_MAX_PAYLOAD )
    #error "Unsupported ipconfigNETWORK_MTU size for NetworkInterface"
#endif

Either ipconfigNETWORK_MTU is too small or too big. Could you help check if they include source/include/FreeRTOSIPConfigDefaults.h correctly?

in stm32h7xx_hal_conf.h:
stm32h7xx_hal_eth.h: No such file or directory.

This file is at source/portable/NetworkInterface/STM32/Drivers/H7/stm32h7xx_hal_eth.h or source/portable/NetworkInterface/STM32/Legacy/STM32Hxx/stm32h7xx_hal_eth.h. Depends on what driver files you’re using.

Thanks.

#error "HAL_ETH_MODULE_ENABLE must be enabled for NetworkInterface"

HAL_ETH_MODULE_ENABLE is supposed to be defined in your *_hal_conf.h

- I defined it but it seems that the NetworkInterface/STM32/Drivers/H7 is not in the include path when using the .h from there.

any idea what can make this happen?

This should happen if you set FREERTOS_PLUS_TCP_STM32_IF_DRIVER to H7 in your CMake file: FreeRTOS-Plus-TCP/source/portable/NetworkInterface/STM32/CMakeLists.txt at main · FreeRTOS/FreeRTOS-Plus-TCP · GitHub. Would you please try that?