Skip to content

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Mar 22, 2025

Contribution description

There is no lwip module that gets selected, use lwip_arp as that seems to be the part that doesn't like esp_now that gets otherwise selected.

Testing procedure

Compile e.g. examples/networking/coap/gcoap with LWIP_IPV4=1 for any esp* board.
On master you will get

In file included from /home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:71:0:
/home/benpicco/dev/RIOT/build/pkg/lwip/src/include/lwip/acd.h:97:48: error: 'struct etharp_hdr' declared inside parameter list [-Werror]
 void acd_arp_reply(struct netif *netif, struct etharp_hdr *hdr);
                                                ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/include/lwip/acd.h:97:48: error: its scope is only this definition or declaration, which is probably not what you want [-Werror]
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c: In function 'acd_tmr':
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:264:13: error: implicit declaration of function 'etharp_acd_probe' [-Werror=implicit-function-declaration]
             etharp_acd_probe(netif, &acd->ipaddr);
             ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:298:13: error: implicit declaration of function 'etharp_acd_announce' [-Werror=implicit-function-declaration]
             etharp_acd_announce(netif, &acd->ipaddr);
             ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c: At top level:
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:376:43: error: 'struct etharp_hdr' declared inside parameter list [-Werror]
 acd_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
                                           ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:376:1: error: conflicting types for 'acd_arp_reply'
 acd_arp_reply(struct netif *netif, struct etharp_hdr *hdr)
 ^
In file included from /home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:71:0:
/home/benpicco/dev/RIOT/build/pkg/lwip/src/include/lwip/acd.h:97:6: note: previous declaration of 'acd_arp_reply' was here
 void acd_arp_reply(struct netif *netif, struct etharp_hdr *hdr);
      ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c: In function 'acd_arp_reply':
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:380:19: error: storage size of 'netifaddr' isn't known
   struct eth_addr netifaddr;
                   ^
In file included from /home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:64:0:
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:381:42: error: 'ETH_HWADDR_LEN' undeclared (first use in this function)
   SMEMCPY(netifaddr.addr, netif->hwaddr, ETH_HWADDR_LEN);
                                          ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/include/lwip/opt.h:145:56: note: in definition of macro 'SMEMCPY'
 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
                                                        ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:381:42: note: each undeclared identifier is reported only once for each function it appears in
   SMEMCPY(netifaddr.addr, netif->hwaddr, ETH_HWADDR_LEN);
                                          ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/include/lwip/opt.h:145:56: note: in definition of macro 'SMEMCPY'
 #define SMEMCPY(dst,src,len)            memcpy(dst,src,len)
                                                        ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:387:3: error: implicit declaration of function 'IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T' [-Werror=implicit-function-declaration]
   IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&sipaddr, &hdr->sipaddr);
   ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:387:55: error: dereferencing pointer to incomplete type 'struct etharp_hdr'
   IPADDR_WORDALIGNED_COPY_TO_IP4_ADDR_T(&sipaddr, &hdr->sipaddr);
                                                       ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:413:15: error: implicit declaration of function 'eth_addr_eq' [-Werror=implicit-function-declaration]
              !eth_addr_eq(&netifaddr, &hdr->shwaddr))) {
               ^
/home/benpicco/dev/RIOT/build/pkg/lwip/src/core/ipv4/acd.c:380:19: error: unused variable 'netifaddr' [-Werror=unused-variable]
   struct eth_addr netifaddr;
                   ^
cc1: all warnings being treated as errors

Issues/PRs references

@benpicco benpicco requested a review from gschorcht as a code owner March 22, 2025 11:45
@github-actions github-actions bot added Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: cpu Area: CPU/MCU ports labels Mar 22, 2025
@benpicco benpicco added Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 22, 2025
@riot-ci
Copy link

riot-ci commented Mar 22, 2025

Murdock results

✔️ PASSED

d058ce7 cpu/esp_common: fix dependency resolution for lwIP

Success Failures Total Runtime
10266 0 10268 10m:19s

Artifacts

@gschorcht
Copy link
Contributor

Strange, why isn't it catched by CI?

@gschorcht
Copy link
Contributor

Strange, why isn't it catched by CI?

Ah, the example is compiled with LWIP_IPV4=1 in CI.

@@ -44,7 +44,7 @@ ifneq (,$(filter esp_wifi_enterprise,$(USEMODULE)))
endif

ifneq (,$(filter netdev_default,$(USEMODULE)))
ifneq (,$(filter lwip,$(USEMODULE)))
ifneq (,$(filter lwip_arp,$(USEMODULE)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ifneq (,$(filter lwip_arp,$(USEMODULE)))
ifneq (,$(filter lwip_netif,$(USEMODULE)))

lwip_arp isn't used with LWIP_IPV6=1 LWIP_IPV4=0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem only occurs with LWIP_IPV4=1 (likely because of the lwip_arp module), LWIP_IPV6=1 compiles fine with esp_now.

@gschorcht
Copy link
Contributor

BTW, I can't reproduce the problem in current master with:

LWIP_IPV4=0 BOARD=esp32-wroom-32 make -j4 -C examples/networking/coap/gcoap

It compiles without any problem. info-module target shows that there is now lwip module selected.

@benpicco
Copy link
Contributor Author

Ops, sorry for the confusion, I meant to write LWIP_IPV4=1, not LWIP_IPV4=0 (which is the default)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Platform: ESP Platform: This PR/issue effects ESP-based platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants