include errors in compiling micropython esp8266 port

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
alirezaimi
Posts: 4
Joined: Wed Oct 23, 2019 8:34 am

include errors in compiling micropython esp8266 port

Post by alirezaimi » Fri Oct 25, 2019 7:36 am

Hi
I'm want freezing esp8266 port of micropython, but everytime i get these includes errors :

Code: Select all

$ make
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-GENERIC/genhdr
GEN build-GENERIC/genhdr/mpversion.h
GEN build-GENERIC/genhdr/moduledefs.h
GEN build-GENERIC/genhdr/qstr.i.last
In file included from user_interface.h:31,
                 from main.c:45:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from esp_mphal.c:32:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from esp_init_data.c:31:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from uart.c:19:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
esppwm.c:25: error: "ICACHE_RAM_ATTR" redefined [-Werror]
 #define ICACHE_RAM_ATTR // __attribute__((section(".text")))
 
In file included from ./ets_sys.h:28,
                 from ./os_type.h:28,
                 from etshal.h:4,
                 from esppwm.c:15:
./c_types.h:90: note: this is the location of the previous definition
 #define ICACHE_RAM_ATTR     __attribute__((section("\".iram.text." __FILE__ "." __ICACHE_STRINGIZE(__LINE__) "." __ICACHE_STRINGIZE(__COUNTER__) "\"")))
 
esppwm.c:194:13: error: 'RTC_REG_WRITE' macro is deprecated [-Werror]
         RTC_REG_WRITE(FRC1_LOAD_ADDRESS, local_single[0].h_time);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
esppwm.c:306:13: error: 'RTC_CLR_REG_MASK' macro is deprecated [-Werror]
     RTC_CLR_REG_MASK(FRC1_INT_ADDRESS, FRC1_INT_CLR_MASK);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
esppwm.c:319:13: error: 'RTC_REG_WRITE' macro is deprecated [-Werror]
         RTC_REG_WRITE(FRC1_LOAD_ADDRESS, pwm_single[pwm_current_channel].h_time);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
esppwm.c:326:13: error: 'RTC_REG_WRITE' macro is deprecated [-Werror]
         RTC_REG_WRITE(FRC1_LOAD_ADDRESS, pwm_single[pwm_current_channel].h_time);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
esppwm.c:345:13: error: 'RTC_REG_WRITE' macro is deprecated [-Werror]
                   | TM_EDGE_INT);
             ^     ~~~~~~~~~~~~~~~                
esppwm.c:346:13: error: 'RTC_REG_WRITE' macro is deprecated [-Werror]
     RTC_REG_WRITE(FRC1_LOAD_ADDRESS, 0);
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~         
cc1: all warnings being treated as errors
In file included from user_interface.h:31,
                 from espneopixel.c:13:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from espapa102.c:33:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from modmachine.c:48:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from machine_pin.c:33:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from machine_rtc.c:32:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from machine_adc.c:32:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from machine_uart.c:32:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from machine_wdt.c:31:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from modesp.c:35:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from modnetwork.c:36:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from modutime.c:37:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
In file included from user_interface.h:31,
                 from moduos.c:37:
ipv4_addr.h:29:10: fatal error: lwip/init.h: No such file or directory
 #include <lwip/init.h>
          ^~~~~~~~~~~~~
compilation terminated.
ets_alt_task.c:5:10: fatal error: esp_sdk_ver.h: No such file or directory
 #include <esp_sdk_ver.h>
          ^~~~~~~~~~~~~~~
compilation terminated.
../../extmod/modlwip.c:40:10: fatal error: lwip/init.h: No such file or directory
 #include "lwip/init.h"
          ^~~~~~~~~~~~~
compilation terminated.
make: *** [../../py/mkrules.mk:76: build-GENERIC/genhdr/qstr.i.last] Error 1
make: *** Deleting file 'build-GENERIC/genhdr/qstr.i.last'
I copied some of those from arduino library for esp8266 but still these includes exist !
how can i get all of dependencies all together ?

I use debian gnu/linux testing.

User avatar
jimmo
Posts: 1769
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: include errors in compiling micropython esp8266 port

Post by jimmo » Fri Oct 25, 2019 7:48 am

Sounds like possibly you need to run

Code: Select all

git submodule update --init
(Or I think "make submodules" is a shortcut for this now, but it doesn't look like ot includes lwip?)

Edit: I'm not 100% sure about this, can't remember if esp8266 gets lwip from the submodule or from esp-open-sdk. Anyway, can you try running git submodule update directly and if it doesn't work then let us know.

kevinkk525
Posts: 755
Joined: Sat Feb 03, 2018 7:02 pm

Re: include errors in compiling micropython esp8266 port

Post by kevinkk525 » Fri Oct 25, 2019 9:41 am

Delete the repository and try this script I use:

Code: Select all

#!/usr/bin/env bash
sudo apt-get install make unrar-free autoconf automake libtool gcc g++ gperf \
    flex bison texinfo gawk ncurses-dev libexpat-dev python-dev python python-serial \
    sed git unzip bash help2man wget bzip2
sudo apt install python3-dev python3-pip libtool-bin
pip3 install rshell esptool
cd ~/
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
make STANDALONE=y
export PATH=/home/kevin/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
cd ~/
git clone https://github.com/micropython/micropython.git
cd micropython
git submodule update --init
make -C mpy-cross
cd ports/esp8266
make axtls
make -j12
replace all "kevin" with your username.
Looks like you are missing the esp_open_sdk
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode

User avatar
jimmo
Posts: 1769
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: include errors in compiling micropython esp8266 port

Post by jimmo » Fri Oct 25, 2019 10:27 am

Alternatively, if Docker is an option for you, I can't recommend it enough.

This is how I build ESP8266 firmware these days:

Code: Select all

$ cd src/github.com/micropython/micropython
$ git submodule update --init
$ cd ports/esp8266
$ docker run --rm -v $HOME:$HOME -u $UID -w $PWD larsks/esp-open-sdk make -j 16

alirezaimi
Posts: 4
Joined: Wed Oct 23, 2019 8:34 am

Re: include errors in compiling micropython esp8266 port

Post by alirezaimi » Fri Oct 25, 2019 6:36 pm

Thank you all!
all comment together solved my problem .

Post Reply