-
Notifications
You must be signed in to change notification settings - Fork 479
Enable IPv4 or IPv4/IPv6 stacks, Ethernet class #695
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
Conversation
IPv4-only mode saves 20KB+ of flash memory. Add some backwards compatibility with the global Arduino Ethernet class when running in IPv4 only mode. Fixes #687
tools/platformio-build.py
Outdated
LIBS=[File(os.path.join(FRAMEWORK_DIR, "lib", "libpico-ipv6.a"))]) | ||
else: | ||
env.Append(CPPDEFINES=[("LWIP_IPV6",0)], | ||
LIBS=[File(os.path.join(FRAMEWORK_DIR, "lib", "libpico.a"))]) |
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 is probably not finished yet, just notes for later: If LWIP_IPv6
is in cpp_defines
, then it's already in env["CPPDEFINES"]
. We could rename the "checking macro" to PIO_FRAMEWORK_ARDUINO_ENABLE_IPV6
with this style. Also, if the libpico
library changes, we need to remove the unconiditional adding of libpico.a
. And very likely linking order matters, so I think we need to compute the right libpico library to use pretty much at the start and before the main env.Append()
and adapt the static string there.
But you can also leave the PlatformIO builder script to me if you want :)
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.
I think it's cleaned up with the current push. FWIW, I have the logic for IPV6 in 2 places: before the libs and in the config-net-defines. The reason is that the order of libs on the command line can sometimes cause issues, so I wanted to keep the libpico(-ipv6).a in its current position before others.
("LWIP_IPV6", 1), | ||
("LWIP_IPV4", 1), | ||
("LWIP_IGMP", 1), | ||
("LWIP_LWIP_CHECKSUM_CTRL_PER_NETIF", 1), |
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, now I know why the original builder script didn't work, there was a double LWIP_LWIP
here. Good catch, I accidentally duplicated them in my PR then, but you removed them here so that it can happen in configure_network_flags()
.
PIO builder script changes look good now. We'd also need to document this option in docs/platformio.rst. I'd propose to add undernearth the USB stack section:
|
Issue: irq wait 0 irq 0 are translated as: irq(wait, 0) # 0 irq(nowait, 0) # 1 wait/nowait are incorrect, should be block or ommited (alt: noblock). After change: irq(block, 0) # 0 irq(0) # 1
IPv4-only mode saves 20KB+ of flash memory.
Add some backwards compatibility with the global Arduino Ethernet
class when running in IPv4 only mode.
Fixes #687