Lopy4 Self flash appimg.bin

  • Hello,

    I'm trying to compile my own firmware image based on dev 1.20.0.rc11, first I have tried to compile without adding frozen modules (this will be my next goal).

    I've successfully compiled firmware from git, and it generates a lopy4.bin file sized 1.54MB (1.615.712B), I've just uploaded to /flash/sys/appimg.bin and reset module.

    On boot Lopy4 throws an error:

    E (475) esp_image: Image length 1615712 doesn't fit in partition length 1572864

    I'm doing firmware update from 1.18.2.r7 to 1.20.0.rc11, maybe the partition changed?
    It's possible to make a migration from one firmware version to another?

    Aside from this update method via WiFi/FTP, I want to know what steps are involved regarding pycom firmware update tool, just to be sure if migration can't be done thru WiFi, the alternative will be with serial port. I explain:

    • I have custom board done with UART port 1 broken out (TX and RX only)
    • I can connect sucessfully to lopy4 REPL with this port.
    • The custom board has P12 broken out to an internal microswitch and I can safe boot if I press the button + reset (orange led)
    • The problem arises when I open Pycom Firmware Update and try to flash firmware, it says Could not connect to board.

    At this moment, in order to upgrade current firmware I'm extracting Lopy4 and use an expansion board to flash successfully.

    The reason to ask these questions is for search for alternatives as I plan to make the board based on L04 instead of Lopy4.

  • @robert-hh Regarding P2 will do more tests with my board in order to check whats going on.

    Ps. Thanks for your great support helping me and helping others, you are the forum angel ;)

  • @River The partition size for v1.18.xx is 1536k, so your software does not fit, and it is impossible to do a ftp update. You have to make an update by UART.

  • @River Unless P2 is connected to Vdd, it should be possible to pull P2 low. It has only to be low at the moment of Reset. So you can to that with a test tip.

  • Hello @robert-hh thanks for your answer, at the moment I have no way to flash by pulling P2 to GND (on my own custom board) I need to check incompatibilities with pins because as soon as I press reset board returns flash read err, 1000 by uart port.

    So probably will go and make more tests doing the update by uploading appimg.bin file thru WiFi connection, do you know why I'm getting this error? (the one that complies about partition lenght)
    Maybe it's not possible to update straight from 1.18.2 to 1.20...


  • @River If you have compiled the firmware yourself, you can flash it to the device by:

    • pulling P2 to GND
    • pushing the reset button and
    • calling "make ESPPORT=<comport name> ESPBAUD=460800 flash"

    ESPPORT and ESPBAUD have the default /dev/ttyUSB0 and 921600. If that fits, you can omit these parameters. My build for LOPY4 has a size of 1.480.176 bytes. That one fits. The partition size is 1720k, at least now. So your file should fit too.

  • Discard last question (firmware update through pycom firmware updater tool), the pin to call low level bootloader isn't P12.

    I've done more tests and realized that the correct pin is P2, although bringing it down to GND the board throws:

    rst:0x10 (RTCWDT_RTC_RESET),boot:0x2b (HSPI_FLASH_BOOT)
    flash read err, 1000
    ets_main.c 371
    ets Jun  8 2016 00:22:57

    I need to debug this further, but probably some kind of incompatibility with existing pins on my custom board.

Log in to reply

Pycom on Twitter