stm32-cmake
stm32-cmake copied to clipboard
Added LwIP support for stm32-cmake
This feature allows using the LwIP source code and OS abstraction layer provided by STM to build networking applications for STM MCUs with stm32-cmake.
It uses the CMakeLists.txt already contained in the LwIP sources. It is difficult to provide examples for LwIP code for various reasons:
-
Networking code often requires special code which is board and architecture specific. Examples: PHY driver code or linker scripts for special lwip sections
-
STM licenses a lot of their networking example code differently than the rest of the HAL repositories. This license might be incompatible to the MIT license.
A separate project is linked in the README example section for a basic UDP echoserver on the H743ZI board. The README was updated with intructions on how to use the LwIP support.
closes #209
Maybe this can be added to a milestone for v2.2.0?
Just bumping this a bit. Do you want to look over it or test it?
I double checked the F0 and F1 repositories again.
It seems there are two example applications with a TCP/IP demonstration available, but they are not available inside the Cube repositories:
I have checked those example application and they appear to be very old, being last modified in 2009 and 2011. They might even pre-date the cube repositories.
What do you think about letting the find_package
process fail if the Filelists.cmake
file does not exist?
Maybe also emit a custom warning with the minimum required lwIP version.
I added the following checks
if(NOT EXISTS "${LwIP_SOURCE_PATH}/Filelists.cmake")
message(WARNING "${MSG_PREFIX} ${LwIP_SOURCE_PATH}/Filelists.cmake file not found.")
message(FATAL_ERROR "${MSG_PREFIX} Please ensure that the LwIP version is at least 2.1.0")
endif()
I also checked the LwIP releases: https://git.savannah.nongnu.org/cgit/lwip.git/refs/tags
2.1.0 is 4 years old now. It might make more sense to ask STM whether they have plans to update the lwIP dependency of F0 and F1 while also adding the two networking examples than to bother with downwards compatibility to a > 5 year old dependency
@atsju Where are we on this topic?
@Hish15 It's quite clear : LWIP is only in repos F1 F2 F4 F7 and H7 but F1 and F2 are not up to date enough to use this PR. This PR would be used for F4 F7 and H7. I haven't had a deep loop apart from that. In theory it's OK for me.
As a side note, the example in readme points to an external repo (I have nothing against it, just keep in mind maintainability)