Errors when trying to build

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
kcoelho
Posts: 8
Joined: Fri Aug 02, 2019 5:40 pm

Errors when trying to build

Post by kcoelho » Thu Aug 15, 2019 5:51 pm

Hello all,

I have been facing errors trying to build for a custom board(VCB_OR). Keep getting this error (attaching a snippet towards the end):

compilation terminated.
network_lan.c:34:24: fatal error: lwip/netif.h: No such file or directory
#include "lwip/netif.h"
^
compilation terminated.
modnetwork.c:43:24: fatal error: lwip/netif.h: No such file or directory
#include "lwip/netif.h"
^
compilation terminated.
In file included from ../../lib/netutils/dhcpserver.c:38:0:
../../lib/netutils/dhcpserver.h:29:26: fatal error: lwip/ip_addr.h: No such file or directory
#include "lwip/ip_addr.h"
^
compilation terminated.
../../py/mkrules.mk:74: recipe for target 'build-VCB_OR/genhdr/qstr.i.last' failed
make: *** [build-VCB_OR/genhdr/qstr.i.last] Error 1
make: *** Deleting file 'build-VCB_OR/genhdr/qstr.i.last'

It seems to be some sort of cross compiling issue or dependency issue but I am unsure how to fix it.
Any help would be appreciated.

User avatar
Roberthh
Posts: 1514
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Errors when trying to build

Post by Roberthh » Thu Aug 15, 2019 7:53 pm

Did you run:

git submodule update --init

after cloning?

kcoelho
Posts: 8
Joined: Fri Aug 02, 2019 5:40 pm

Re: Errors when trying to build

Post by kcoelho » Thu Aug 15, 2019 8:24 pm

Yes, I did

When I tried building for a different board just to test it built fine.

So not too sure what could be causing the error

Online
User avatar
dhylands
Posts: 3202
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Errors when trying to build

Post by dhylands » Thu Aug 15, 2019 9:42 pm

You need to make sure you have this line:
https://github.com/micropython/micropyt ... ard.mk#L10 (i.e. MICROPY_PY_LWIP = 1) in your mpconfigboard.mk file

kcoelho
Posts: 8
Joined: Fri Aug 02, 2019 5:40 pm

Re: Errors when trying to build

Post by kcoelho » Fri Aug 16, 2019 1:36 pm

Thanks for that. It seems to have solved that issue.

I also had to remove this line from mpconfigboard.h :

#define MICROPY_PY_LWIP (1)

But now the build is failing at eth.c file with the following error:

...
CC eth.c
eth.c: In function 'eth_mac_init':
eth.c:163:5: error: implicit declaration of function 'STATIC_AF_ETH_RMII_REF_CLK' [-Werror=implicit-function-declaration]
mp_hal_pin_config_alt_static(MICROPY_HW_ETH_RMII_REF_CLK, MP_HAL_PIN_MODE_ALT, MP_HAL_PIN_PULL_NONE, STATIC_AF_ETH_RMII_REF_CLK);
^
cc1: all warnings being treated as errors
../../py/mkrules.mk:47: recipe for target 'build-VCB_OR/eth.o' failed
make: *** [build-VCB_OR/eth.o] Error 1

I'm not entirely sure the cause this time. I understand it's only a warning but the gcc compiler won't allow it to continue

Post Reply