esptool error when building esp8266

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
dcj
Posts: 2
Joined: Fri Jan 03, 2020 5:44 am

esptool error when building esp8266

Post by dcj » Tue Jan 07, 2020 2:43 pm

Dear Team,

I am trying to build the esp8266 module using WSL on windows 10 Home. I was successfully able to build the esp-open-sdk using python 3.7 following the readme in it. I updated the "print" statements in esptool.py to run with Python 3.
I was also able to compile mpy-corss , but when I try to do a make in the ports/esp8266 directory, it fails at the very last step with the below error.


Traceback (most recent call last):
File "/home/dcj/esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 1270, in <module>
main()
File "/home/dcj/esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 1183, in main
operation_func(args)
File "/home/dcj/esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 925, in elf2image
image.add_segment(e.get_symbol_addr(start), data)
File "/home/dcj/esp-open-sdk/xtensa-lx106-elf/bin/esptool.py", line 521, in get_symbol_addr
return self.symbols[sym]
KeyError: '_text_start'
Makefile:208: recipe for target

I was not able to find any information with regard to the above error on the esp-tool-sdk github.
https://github.com/pfalcon/esp-open-sdk

I did go through this post as well,
viewtopic.php?f=15&t=7136&p=40598&hilit=_text_#p40598

Thanks
dcj


dcj
Posts: 2
Joined: Fri Jan 03, 2020 5:44 am

Re: esptool error when building esp8266

Post by dcj » Wed Jan 08, 2020 10:08 am

Hi,

I was able to get it build using the latest esptool.py from

https://raw.githubusercontent.com/espre ... esptool.py

I believe the esptool.py is very old in the esp-open-sdk package.

Thanks

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

Re: esptool error when building esp8266

Post by jimmo » Wed Jan 08, 2020 11:28 am

You can also install esptool using pip, and some distros have it too.

That said, I highly recommend using Docker -- instructions here viewtopic.php?f=15&t=7136#p40603

User avatar
MostlyHarmless
Posts: 147
Joined: Thu Nov 21, 2019 6:25 pm
Location: Pennsylvania, USA

Re: esptool error when building esp8266

Post by MostlyHarmless » Thu Jan 09, 2020 2:41 am

Docker woks to some degree and I love putting all sorts of things into containers (FreeCAD, KiCAD, Prusa-Slic3r, you name it), but in the end I went a completely different route for MicroPython development.

A dedicated Raspberry Pi 3. It runs CentOS 7 and has all the tool chains for ESP8266 and ESP32 installed. Granted, rebuilding the firmware from scratch isn't as fast as it is on a Core-i7, but how often do you really need to do that? The upside is that the Pi can be where the ESP boards are and I use it via ssh. On the Pi I have ampy and picocom. A little trickery in /etc/udev/rules.d makes sure that /dev/ttyESP1 is exactly the board that I plugged into the Pi on the top-left USB port. The other boards are /dev/ttyESP[234], no matter in which order they enumerate on boot.


Regards, Jan


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

Re: esptool error when building esp8266

Post by jimmo » Thu Jan 09, 2020 1:25 pm

jedie wrote:
Thu Jan 09, 2020 6:20 am
https://github.com/jedie/docker-micropython to compile micropython and freeze modules
This is definitely useful as a standalone "i just want to build a micropython" and for the original poster in this thread that might be what they're looking for? And certainly if you goal is only to freeze some Python scripts into a firmware image without worrying about git repos and stuff, then it's perfect.

But in general the way I much prefer to use docker is to only have the tools inside the container, but keep the workspace outside. i.e. the docker container is in place of installing the toolchain, but I still have my git repo as normal in my regular home dir. Importantly the container is ephemeral, only for the lifetime of the individual invocation of the tool.

But so that's mostly why I keep recommending my way (although I realise it's not for everyone) -- if you've already got a dev environment set up (cloned repo, maybe some local code modifications, etc), and just need a way to run the build, you just run the same "make ...." command you would have run otherwise, just with the "docker run --rm ..." bits prefixed to the start.

I think the instructions for the docker image I recommend covers this well (including a wrapper script): https://github.com/larsks/docker-image-esp-open-sdk
MostlyHarmless wrote:
Thu Jan 09, 2020 2:41 am
Docker woks to some degree and I love putting all sorts of things into containers (FreeCAD, KiCAD, Prusa-Slic3r, you name it), but in the end I went a completely different route for MicroPython development.

A dedicated Raspberry Pi 3. It runs CentOS 7 and has all the tool chains for ESP8266 and ESP32 installed. Granted, rebuilding the firmware from scratch isn't as fast as it is on a Core-i7, but how often do you really need to do that? The upside is that the Pi can be where the ESP boards are and I use it via ssh. On the Pi I have ampy and picocom. A little trickery in /etc/udev/rules.d makes sure that /dev/ttyESP1 is exactly the board that I plugged into the Pi on the top-left USB port. The other boards are /dev/ttyESP[234], no matter in which order they enumerate on boot.
Yep, very useful. I occasionally use a Pi in this way for other things (e.g. a Zero makes quite a convenient generic JTAG adaptor running OpenOCD). In particular if you set up the Pi as a USB libcomposite device so it just shows up as a ttyACM device and/or ethernet interface, rather than having to connect it to your network or whatever.

But you could do all of the udev trickery on a "real" (i.e. fast) PC too :)

And it depends what sort of MicroPython development you're doing. And you've got to set up the RPi first too.

Post Reply