Problem on building ESP8266 port's firmware
Problem on building ESP8266 port's firmware
Hi all!
I'm trying to build a fresh MicroPython firmware for ESP8266 using Ubuntu 18.04. I follow these tutorials:
1. https://github.com/pfalcon/esp-open-sdk
2. https://github.com/micropython/micropyt ... ng-Started
3. https://github.com/micropython/micropyt ... ts/esp8266
and
4. https://youtu.be/jG7WBY_vmpE
The build of MicroPython firmware for unix systems works well.. instead the one for ESP8266 doesn't work correctly. Once i flashed the firmware just compiled (firmware-combined.bin) into ESP8266 through esptool.py, i cannot upload any files to its file system:
While the correct behavior with your official firmware (esp8266-20191220-v1.12.bin) is:
-> The question is: Where i'm wrong?
-> Has anyone else ever experienced this problem?
NB: For transfer the firmware into ESP8266 i used the tecnique of drag and drop the "firmware-combined.bin" from VM to host. After i flashed it using esptool.py (i'dont use the command "make deploy"). See https://youtu.be/jG7WBY_vmpE?t=1775
PS: I noticed that the "make axtls" command does not work on ports/unix (says: make: Nothing to be done for 'axtls'.) or ports/esp8266 (says make: *** No rule to make target 'axtls'. Stop.).
PSS: These commands "make -C ports/esp8266 submodules" and "make -C mpy-cross" after the build of unix port doesn't do anything (doesn't take effect) on esp8266 port.
Thanks to all!
Greetings
I'm trying to build a fresh MicroPython firmware for ESP8266 using Ubuntu 18.04. I follow these tutorials:
1. https://github.com/pfalcon/esp-open-sdk
2. https://github.com/micropython/micropyt ... ng-Started
3. https://github.com/micropython/micropyt ... ts/esp8266
and
4. https://youtu.be/jG7WBY_vmpE
The build of MicroPython firmware for unix systems works well.. instead the one for ESP8266 doesn't work correctly. Once i flashed the firmware just compiled (firmware-combined.bin) into ESP8266 through esptool.py, i cannot upload any files to its file system:
While the correct behavior with your official firmware (esp8266-20191220-v1.12.bin) is:
-> The question is: Where i'm wrong?
-> Has anyone else ever experienced this problem?
NB: For transfer the firmware into ESP8266 i used the tecnique of drag and drop the "firmware-combined.bin" from VM to host. After i flashed it using esptool.py (i'dont use the command "make deploy"). See https://youtu.be/jG7WBY_vmpE?t=1775
PS: I noticed that the "make axtls" command does not work on ports/unix (says: make: Nothing to be done for 'axtls'.) or ports/esp8266 (says make: *** No rule to make target 'axtls'. Stop.).
PSS: These commands "make -C ports/esp8266 submodules" and "make -C mpy-cross" after the build of unix port doesn't do anything (doesn't take effect) on esp8266 port.
Thanks to all!
Greetings
Re: Problem on building ESP8266 port's firmware
Which build process are you using. I strongly recommend the docker approach in the third link your provided.
How are you accessible the device filesystem? Is that Thonny?
What if you try and access the filesystem from the repl instead? (i.e. "import os", os.listdir() etc, and reading writing files with open() ).
I wonder if this is somehow related to LittleFS which is now the default on ESP8266 (it wasn't on the 1.12 release).
Did you do an erase_flash first before flashing your build firmware-combined image?
How are you accessible the device filesystem? Is that Thonny?
What if you try and access the filesystem from the repl instead? (i.e. "import os", os.listdir() etc, and reading writing files with open() ).
I wonder if this is somehow related to LittleFS which is now the default on ESP8266 (it wasn't on the 1.12 release).
Did you do an erase_flash first before flashing your build firmware-combined image?
Re: Problem on building ESP8266 port's firmware
Hi,
You should be seeing the exact same thing when you load your own .bin, so there must be something going awry there.
They have updated the build process somewhat since the first video was made... (I should know... I'm the one who made it! )
Yes, you no longer have to build AXTLS separately.
I would check against these steps... in case you missed anything...
One thing to note that you are pulling the latest this way which may or may not be what you want.
GL
You should be seeing the exact same thing when you load your own .bin, so there must be something going awry there.
They have updated the build process somewhat since the first video was made... (I should know... I'm the one who made it! )
Yes, you no longer have to build AXTLS separately.
I would check against these steps... in case you missed anything...
- (build the esp toolchain and have added it to your path)
- >git clone https://github.com/micropython/micropython.git
- >cd micropython/
- >git submodule update --init
- >make -C mpy-cross
- >cd ports/esp8266/
- >make
One thing to note that you are pulling the latest this way which may or may not be what you want.
GL
Re: Problem on building ESP8266 port's firmware
First i used virtualenv on VMware with Ubuntu 19.04 but doesn't work.. After i used only Ubuntu 18.04.. the same bankruptcy results.
Yes, it is Thonny IDE for Windows
This is what happens:
What do you mean with this sentence?
Obviously yes
Re: Problem on building ESP8266 port's firmware
https://github.com/micropython/micropython/pull/5803
So perhaps one thing you could try is to checkout the v1.12 tag and see if that works.
Re: Problem on building ESP8266 port's firmware
Hello, nice to hear you. Thanks for your well-done video tutorial.
I do exactly these steps in this order (they are slightly different from yours):bitninja wrote: ↑Sun Apr 19, 2020 12:01 am
- (build the esp toolchain and have added it to your path)
- >git clone https://github.com/micropython/micropython.git
- >cd micropython/
- >git submodule update --init
- >make -C mpy-cross
- >cd ports/esp8266/
- >make
- 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 libtool-bin - git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
- cd esp-open-sdk
- make
- export PATH=/home/vm-user/esp-open-sdk/xtensa-lx106-elf/bin:$PATH
- cd ..
- sudo apt-get install build-essential libreadline-dev libffi-dev git pkg-config gcc-arm-none-eabi libnewlib-arm-none-eabi
- git clone --recurse-submodules https://github.com/micropython/micropython.git
- cd micropython/mpy-cross
- make
- cd ..
- cd ports/unix
- make
- export PATH="$HOME/micropython/ports/unix:$PATH"
- cd ..
- cd esp8266/
- make
- Is there something wrong?
Last edited by Kowa92 on Sun Apr 19, 2020 3:20 pm, edited 1 time in total.
Re: Problem on building ESP8266 port's firmware
What do you mean with "v1.12 tag"? How can i do to do that?jimmo wrote: ↑Sun Apr 19, 2020 12:53 pmhttps://github.com/micropython/micropython/pull/5803
So perhaps one thing you could try is to checkout the v1.12 tag and see if that works.
---------
Maybe, if i well understood, i must update the ESP8266' filesystem from FAT to littleFSv2, right?
As dpgeorge said to https://github.com/micropython/micropython/pull/5803:
- "PR" stands for?This PR changes the esp8266 boards to use littlefs v2 as the filesystem, rather than FAT. Since the esp8266 doesn't expose the filesystem to the PC over USB there's no strong reason to keep it as FAT. Littlefs is smaller in code size, is more efficient in use of flash to store data, is resilient over power failure, and using it saves about 4k of heap RAM, which can now be used for other things.
This is a backwards incompatible change because all existing esp8266 boards will need to update their filesystem after installing new firmware (ie backup old files, install firmware, restore files to new filesystem).
Anyway, if the response is yes, i have two choices to do that (in my case):
- Use these code:
http://docs.micropython.org/en/latest/r ... ml#esp8266After i flashed my firmware into ESP8266Code: Select all
# ESP8266 and ESP32 import os os.umount('/') os.VfsLfs2.mkfs(bdev) os.mount(bdev, '/')
- Or use this command option "make BOARD=GENERIC_1M" before compiling it?
- Actually, what is the default option when i build a MicroPyhton v.12 firmware with "make" command without option? Maybe the "GENERIC_2M" one?
Thanks
* UPDATE *
This doesn't seems to work..Kowa92 wrote: ↑Sun Apr 19, 2020 2:33 pmAnyway, if the response is yes, i have two choices to do that (in my case):
- Use these code:
http://docs.micropython.org/en/latest/r ... ml#esp8266Code: Select all
# ESP8266 and ESP32 import os os.umount('/') os.VfsLfs2.mkfs(bdev) os.mount(bdev, '/')
Re: Problem on building ESP8266 port's firmware
Code: Select all
git checkout v1.12
This is why I asked about erase_flash. If you've erased the flash then on first boot MicroPython will create the LittleFS filesystem.
Pull Request (i.e. a set of changes for review -- https://help.github.com/en/github/colla ... l-requests )
Yes the default is "GENERIC" which is the 2MiB version. If you only have 1MiB of flash on your board, then you need to use BOARD=GENERIC_1M.
Sounds like we need to update esp8266/README.md to explain this.
Re: Problem on building ESP8266 port's firmware
If i want to change (clone from git too) previous version of MicroPython, how can i do?
Yes, this is my problem! Once i re-build the ESP8266 firmware i used the "make BOARD=GENERIC_1M", re-flashed it into my ESP8266 and now all works fine! So the problem was that.
PS: Yes, for me you should update esp8266/README.md and write that from the newer version of MicroPhthon (> 1.12), the default memory size building is 2 MiB (if you omit to put option on "make" command).