Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Q: flashing custom firmware on the WiPy 2.0

    Scheduled Pinned Locked Moved Discussion
    3 Posts 2 Posters 2.1k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U Offline
      ubiq_01 Pybytes Beta
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • X Offline
        Xykon administrators
        last edited by

        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.

        Christian Ehlers

        1 Reply Last reply Reply Quote 0
        • U Offline
          ubiq_01 Pybytes Beta
          last edited by

          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

          1 Reply Last reply Reply Quote 2

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post

          Pycom on Twitter

          Pycom