-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added LwIP support for stm32-cmake #263
base: master
Are you sure you want to change the base?
Conversation
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: 1. Networking code often requires special code which is board and architecture specific. Examples: PHY or linker scripts for special lwip sections 2. STM licenses a lot of their 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.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @robamu
Sorry for late/slow reply. I had a look at your code when you pushed it (I even have a pending review comment for then) and discussed about it with @Hish15 but we did not come to a definitive conclusion then.
Our concern is that the only families supporting LWIP are F1 F2 F4 F7 and H7 and adding to that, the file Filelists.cmake
is not always present this way. I think for the code to be merged, it should at least work for all versions of HAL that support LWIP.
endif() | ||
|
||
# Use Filelists.cmake to get list of sources to compile | ||
include("${LwIP_SOURCE_PATH}/Filelists.cmake") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file exists from F4 F7 H7 cube only. Although LWIP is in cube F1 F2 F4 F7 H7 because they are more or less up to date. ST updates Middleware only on minor (1.X.0) releases of cube
Edit: this is the pending comment from when I first read your code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh that's interesting. The Cube repositories have LwIP, but I am not even sure whether the processor or the boards support networking applications. I'm browsing the example applications here right now: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F429I-Discovery/Applications and I can't see any example applications. Have not checked F7 yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it appears only F7 and H7 have networking applications
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction: F4 seems to have one as well: https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F429ZI-Nucleo/Applications/LwIP/LwIP_HTTP_Server_Netconn_RTOS
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 I have checked those example application and they appear to be very old, being last modified in 2009 and 2011. What do you think about letting the |
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) |
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