Type error in modnetwork compiling firmware

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
seluron
Posts: 2
Joined: Wed Aug 28, 2019 9:53 pm

Type error in modnetwork compiling firmware

Post by seluron » Wed Aug 28, 2019 10:47 pm

I am getting type error when compiling current firmware (git submodule update --init done on clone today). Am compiling for a generic board using defaults


Last lines from compiling are:

CC modnetwork.c
In file included from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/debug.h:40:0,
from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/opt.h:52,
from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/ip_addr.h:40,
from /home/ian/esp/esp-idf/components/tcpip_adapter/include/tcpip_adapter.h:24,
from /home/ian/esp/esp-idf/components/esp32/include/esp_event_legacy.h:23,
from /home/ian/esp/esp-idf/components/esp_event/include/esp_event.h:26,
from /home/ian/esp/esp-idf/components/esp32/include/esp_wifi.h:69,
from modnetwork.c:45:
/home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/arch.h:135:19: error: conflicting types for 'mem_ptr_t'
typedef uintptr_t mem_ptr_t;
^
In file included from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/arch.h:48:0,
from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/debug.h:40,
from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/opt.h:52,
from /home/ian/esp/esp-idf/components/lwip/lwip/src/include/lwip/ip_addr.h:40,
from /home/ian/esp/esp-idf/components/tcpip_adapter/include/tcpip_adapter.h:24,
from /home/ian/esp/esp-idf/components/esp32/include/esp_event_legacy.h:23,
from /home/ian/esp/esp-idf/components/esp_event/include/esp_event.h:26,
from /home/ian/esp/esp-idf/components/esp32/include/esp_wifi.h:69,
from modnetwork.c:45:
/home/ian/esp/esp-idf/components/lwip/port/esp32/include/arch/cc.h:53:25: note: previous declaration of 'mem_ptr_t' was here
typedef unsigned long mem_ptr_t;
^
make: *** [../../py/mkrules.mk:47: build-GENERIC/modnetwork.o] Error 1

Would appreciate any help that can be provided.

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

Re: Type error in modnetwork compiling firmware

Post by kevinkk525 » Thu Aug 29, 2019 6:41 am

I always had some troubles compiling the esp32 firmware so I wrote a script. And 2 days ago it still worked (you have to remove your esp-idf and micropython directories first and it stores everything in your home directory):

Code: Select all

#!/usr/bin/env bash
sudo apt-get install git wget libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache
pip3 install pyserial pyparsing esptool rshell
cd ~/
git clone https://github.com/micropython/micropython.git
cd micropython
git submodule update --init
cd ports/esp32
hash=$(make | grep "Supported git hash:")
hash=${hash:20}
cd ~/
git clone https://github.com/espressif/esp-idf.git
cd esp-idf
git checkout $hash
git submodule update --init
cd ..
mkdir esp
cd esp
wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
tar -zxvf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
export PATH="$HOME/esp/xtensa-esp32-elf/bin:$PATH"
cd ..
cd micropython/ports/esp32
echo '''ESPIDF = $(HOME)'/esp-idf'
#PORT = /dev/ttyUSB0
#FLASH_MODE = qio
#FLASH_SIZE = 4MB
#CROSS_COMPILE = xtensa-esp32-elf-

include Makefile''' > makefile
cd ..
cd ..
git submodule update --init
make -C mpy-cross
cd ports/esp32
make PYTHON=python2 -j12
Sadly that is all the help I can give you.

seluron
Posts: 2
Joined: Wed Aug 28, 2019 9:53 pm

Re: Type error in modnetwork compiling firmware

Post by seluron » Thu Aug 29, 2019 5:49 pm

Thank you - all is working well now.

Great script - really handy.

I think a botched the local esp-idf was the source of my earlier problem.

Again, thank you

Post Reply