Inkplate 2 upload fails with StopIteration error

Customer:

I’m trying to load the first simple example onto my Inkplate 2 but get a StopIteration error during upload.

Serial port: /dev/ttyUSB0
Chip: ESP32-D0WD-V3 (revision 3)
Crystal: 40MHz

The upload process progresses through several stages:

  • Connecting
  • Chip detected with WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
  • MAC: c4:de:e2:26:3e:5c
  • Stub uploaded and running
  • Baud rate changed to 921600
  • Then fails at “Configuring flash size”

Full error trace:

Traceback (most recent call last):
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool.py", line 34, in <module>
    esptool._main()
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool/__init__.py", line 1004, in _main
    main()
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool/__init__.py", line 790, in main
    esp.flash_set_parameters(flash_size_bytes(args.flash_size))
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool/loader.py", line 1108, in flash_set_parameters
    self.check_command(
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool/loader.py", line 406, in check_command
    val, data = self.command(op, data, chk, timeout=timeout)
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool/loader.py", line 375, in command
    p = self.read()
  File "/home/[user]/.arduino15/packages/Inkplate_Boards/tools/esptool_py/4.2.1/esptool/loader.py", line 307, in read
    return next(self._slip_reader)
StopIteration

I attempted to modify MEM_END_ROM_TIMEOUT in loader.py but that didn’t resolve it.

Originally submitted via email support on 14 May 2023. Migrated to the forum for community visibility.

Soldered Support:

Do not modify esptool.py - revert any changes you made to MEM_END_ROM_TIMEOUT back to its default value.

Make sure you have installed the board definitions from GitHub - SolderedElectronics/Dasduino-Board-Definitions-for-Arduino-IDE · GitHub and that you have selected Inkplate 2 as the board with the correct COM port selected.

Try these troubleshooting steps:

Let me know if any of these help.

Customer:

Will try your suggestions in the next few days.

Customer:

I’ve tried your suggestions:

  • Using the Inkplate USB-C cable
  • Changed USB ports
  • Reset MEM_END_ROM_TIMEOUT to the original value of 0.5
  • Using Arduino IDE version 1.8.19
  • Followed your installation instructions

But upload still fails. I’m running Linux Mint 20.3.

Attachment omitted in migration: ide.png

Soldered Support:

Try changing the upload speed from 921600 to a lower value.

Enable verbose output during compilation and upload in Arduino IDE preferences, then check what the red output text tells you. Try uploading several more times with different upload speed settings.

Also try changing MEM_END_ROM_TIMEOUT to a different value. The combination of different upload speeds and timeout values might find a configuration that works with your OS.

Attachment omitted in migration: image.png