Q: flashing custom firmware on the WiPy 2.0


  • Pybytes Beta

    Hello,

    in addition to using the MicroPython features it would be great to also be able to flash custom firmware (built in C with the esp-idf) on the WiPy and to go back to MicroPython later if wanted.

    I made some tests and could in any case restore the WiPy MicroPython firmware with the firmware updater => great!

    I failed though to flash custom firmware with esptool.py. See https://twitter.com/_rac01/status/793736508469604353

    What I did was:

    • compiled binary with template at https://github.com/espressif/esp-idf-template and tried to flash it
    • assumed QIO, 40m, 4MB as WiPy characteristics (is this correct?) and used a command line: python esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 write_flash --flash_mode qio --flash_freq 40m --flash_size 4MB 0x1000 bootloader.bin 0x10000 app-template.bin 0x4000 partitions_singleapp.bin

    Nevertheless: this resulted in:
    Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
    esptool.py v2.0-dev
    Connecting...
    Uploading stub...
    Running stub...
    Stub running...
    Attaching SPI flash...
    Configuring flash size...
    Erasing flash...
    Took 0.02s to erase flash block
    Wrote 16384 bytes at 0x00001000 in 1.4 seconds (91.3 kbit/s)...
    Hash of data verified.
    Erasing flash...
    Took 0.02s to erase flash block
    Writing at 0x00044000... (38 %)
    A fatal error occurred: Failed to write to target Flash after seq 13 (result was 0xc1, 0x0)

    My question: Are there any hints on building / flashing custo firmware? What do I do wrong here?

    best regards
    Ralf


  • Pybytes Beta

    Problem solved. It works well both on Linux and OSX - just the flashing failed when doing from Linux running in VirtualBox on OSX.

    https://twitter.com/_rac01/status/794250206489575424

    best regards and many thanks for the support
    Ralf


  • administrators

    I don't use the "--flash_mode qio --flash_freq 40m" parameters when using esptool.py manually.

    I did notice that sometimes flashing fails... it normally works on the 2nd attempt.

    Also I usually just use make flash instead of running esptool.py manually.


Log in to reply
 

Pycom on Twitter