[SOLVED] Firmware 1.7.8 build failed when flashing firmware on linux.

  • Hello,

    I have an issue with building the latest firwmare 1.7.8. I follow all the instructions on the github readme and I installed this version of the toolchain: https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz

    Everything runs great except the last step when running flash command

    make BOARD=LOPY -j5 LORA_BAND=USE_BAND_868 flash 

    I get permission denied which is expected because I want to access serial communication

    esptool.py v2.0.1
    Traceback (most recent call last):
      File "/home/yahia/micropython/pycom-esp-idf/components/esptool_py/esptool/esptool.py", line 2412, in <module>
      File "/home/yahia/micropython/pycom-esp-idf/components/esptool_py/esptool/esptool.py", line 2405, in _main
      File "/home/yahia/micropython/pycom-esp-idf/components/esptool_py/esptool/esptool.py", line 2134, in main
        esp = chip_class(args.port, initial_baud)
      File "/home/yahia/micropython/pycom-esp-idf/components/esptool_py/esptool/esptool.py", line 175, in __init__
        self._port = serial.serial_for_url(port)
      File "/home/yahia/.local/lib/python2.7/site-packages/serial/__init__.py", line 88, in serial_for_url
      File "/home/yahia/.local/lib/python2.7/site-packages/serial/serialposix.py", line 268, in open
        raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
    serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/tt
    application.mk:382: recipe for target 'flash' failed
    make: *** [flash] Error 1

    However when I run the same command with sudo i get this error:

    python ../py/makeversionhdr.py build/LOPY_868/release/genhdr/mpversion.h
    make: *** No rule to make target '/components/esp32/ld/esp32.ld', needed by 'build/LOPY_868/release/esp32_out.ld'.  Stop.
    make: *** Waiting for unfinished jobs....

    Does anyone know why this happens? Maybe I am missing a step.

    Thank you.


  • @yahia another option (if you have WiFi enabled) is just to copy the generated appimg.bin into /flash/sys using FTP.

  • @jmarcelino Works great! Thank you very much sir.

  • @yahia
    I think when you sudo-ed you lost your IDF_PATH environment variable (which points to pycom-esp-idf )

    I'd recommend simply having permissions on your tty device to include your regular user. For example on Ubuntu this means adding yourself to group dialout:

    sudo adduser $USER dialout

Log in to reply

Pycom on Twitter