Build/Make problem with ESP32 compile

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
superace
Posts: 10
Joined: Thu Jan 17, 2019 1:57 am

Build/Make problem with ESP32 compile

Post by superace » Sat Feb 29, 2020 10:01 am

Having fighting with this problem for days now I am stuck but I need this to work.

Ubuntu LTS 64bit, plenty of RAM plenty of CPU. I am trying to follow this guide https://www.microdev.it/wp/en/2018/08/0 ... for-esp32/ but obviously I get it wrong somewhere.

I have created the example Makefile

Code: Select all

ESPIDF = /home/myuser/Micropython/esp32/esp-idf
#PORT = /dev/ttyUSB0
#FLASH_MODE = qio
#FLASH_SIZE = 4MB
#CROSS_COMPILE = xtensa-esp32-elf-
 
include Makefile
Followed the steps after and then

Code: Select all

cd ports/esp32
make
make crashes and "Too many open files" is the reason reference to Line 7 (if I understand correctly)
Line 7 being include Makefile.

Anyone seen this before? Hints?

I am using ESP32 with micropython already from pre-compiled files from the Micropython Download area. Great stuff! But I am now in need of Double precision and all the ESP32 files are single precision so I am forced to set up a local development environment.

Obviously it can be done, obviously I need help :)

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

Re: Build/Make problem with ESP32 compile

Post by jimmo » Sat Feb 29, 2020 10:57 am

hi,

The makefile that you create needs to be lower case "makefile", distinct from the upper case "Makefile" already in the repo.

When you run "make" it uses either a makefile or Makefile (in that order) from the current directory, so the idea here is that the makefile is used instead (which sets some things, then includes the real Makefile).

superace
Posts: 10
Joined: Thu Jan 17, 2019 1:57 am

Re: Build/Make problem with ESP32 compile

Post by superace » Sat Feb 29, 2020 11:25 am

But of course, that makes sense :D I was wondering how the include file could be including itself. Will test this tomorrow. Thank you.

superace
Posts: 10
Joined: Thu Jan 17, 2019 1:57 am

Re: Build/Make problem with ESP32 compile

Post by superace » Sun Mar 01, 2020 4:27 am

Great advice! I have gotten my PC to create a usable software with double precision.

I still don't understand why the build size is 1.5Mb for the firware.bin file, aprox 3 times the file size found on the download page and I don't really get how to make sure I get the last stable version of 1.12 but that's something I can live with for the moment.

Thank you!

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

Re: Build/Make problem with ESP32 compile

Post by jimmo » Sun Mar 01, 2020 5:04 am

superace wrote:
Sun Mar 01, 2020 4:27 am
I still don't understand why the build size is 1.5Mb for the firware.bin file, aprox 3 times the file size found on the download page...
If you compile with single precision does it go back to the original size?

Because the ESP32 doesn't have hardware double-precision floating point, it needs to generate a lot of code to emulate double-precision. I'm surprised it's 3x though.
superace wrote:
Sun Mar 01, 2020 4:27 am
get the last stable version of 1.12 but that's something I can live with for the moment.
git checkout v1.12

User avatar
tve
Posts: 216
Joined: Wed Jan 01, 2020 10:12 pm
Location: Santa Barbara, CA
Contact:

Re: Build/Make problem with ESP32 compile

Post by tve » Sun Mar 01, 2020 6:09 am

superace wrote:
Sun Mar 01, 2020 4:27 am
I still don't understand why the build size is 1.5Mb for the firware.bin file, aprox 3 times the file size found on the download page and I don't really get how to make sure I get the last stable version of 1.12 but that's something I can live with for the moment.
Where do you get your sizes from? This is how the build of v1.12 ends for me:

Code: Select all

LINK build-GENERIC/application.elf
   text    data     bss     dec     hex filename
1073163  266012   46364 1385539  152443 build-GENERIC/application.elf
Create build-GENERIC/application.bin
esptool.py v2.8-dev
Create build-GENERIC/firmware.bin
bootloader     21200
partitions      3072
application  1339312
total        1404848
Fortunately we can also look-up travis to see how the official release download was generated (https://travis-ci.org/micropython/micro ... /627577916), here is how it ended:

Code: Select all

LINK build-GENERIC/application.elf
   text	   data	    bss	    dec	    hex	filename
1073755	 267684	  46356	1387795	 152d13	build-GENERIC/application.elf
Create build-GENERIC/application.bin
esptool.py v2.8-dev
Create build-GENERIC/firmware.bin
bootloader     21280
partitions      3072
application  1341568
total        1407104
Not that different... (I used `DEBUG=1` which probably accounts for the difference...)

Here's a build of master:

Code: Select all

LINK build-GENERIC/application.elf
   text    data     bss     dec     hex filename
1082073  268168   46444 1396685  154fcd build-GENERIC/application.elf
Create build-GENERIC/application.bin
esptool.py v2.8
Create build-GENERIC/firmware.bin
bootloader     21648
partitions      3072
application  1350368
total        1415904
Not that much bigger at all...

Post Reply