The ethernet component no longer has a top level enable/disable in menuconfig but there are options below it such as the number of RX and TX DMA buffers that say they are statically allocated. I haven't checked to see if codespace is increased.
I see the commit in the history that removed the option:
commit bb7d5fc10f90da1e77e0ab44451a8d744d0bd748
Merge: b354b75e 4c1c62a4
Author: Ivan Grokhotkov <ivan@espressif.com>
Date: Fri Aug 18 18:45:49 2017 +0800
Merge branch 'feature/remove_ethernet_config_option' into 'master'
ethernet: remove CONFIG_ETHERNET
See merge request !1116
But can't find the reasoning behind doing so.
Chris
Ethernet no longer can be enabled/disabled?
Re: Ethernet no longer can be enabled/disabled?
That's correct. In the forthcoming IDF V3.0, both Wifi & Ethernet are only enabled if you call a function in the applicable component (usually this means if your code calls esp_wifi_init() or esp_eth_init().)
During linking, only used functions and static variables are linked into the final binary. So no code size or static memory for a component will be used if that component isn't referenced somewhere by your firmware.
During linking, only used functions and static variables are linked into the final binary. So no code size or static memory for a component will be used if that component isn't referenced somewhere by your firmware.
Re: Ethernet no longer can be enabled/disabled?
Ahh very cool, thanks for the explanation. Enabling link time optimization (lto) for that?ESP_Angus wrote:That's correct. In the forthcoming IDF V3.0, both Wifi & Ethernet are only enabled if you call a function in the applicable component (usually this means if your code calls esp_wifi_init() or esp_eth_init().)
During linking, only used functions and static variables are linked into the final binary. So no code size or static memory for a component will be used if that component isn't referenced somewhere by your firmware.
Re: Ethernet no longer can be enabled/disabled?
We're hoping to support LTO for IDF in the future, but for now this is a combination of two bits of linker behaviour:cmorgan wrote: Ahh very cool, thanks for the explanation. Enabling link time optimization (lto) for that?
- We link all components as libraries (-lcomponentname), which means the linker only searches them when it has an undefined symbol it needs to resolve. This means only the object files (.o files) in each library which have at least one required symbol are linked in.
- We compile all IDF code with "-ffunction-sections -fdata-sections" and use --gc-sections in the link. This means that even if one symbol in an object file is referenced, any totally unreferenced code/functions/variables in that same object file will not be linked into the final binary.
Re: Ethernet no longer can be enabled/disabled?
Very good, thank you for the details!
Who is online
Users browsing this forum: Google [Bot] and 122 guests