Reflashing os package

  • Hi all,

    Looking for some help to get out of a hole I dug myself into...

    In short - I ran over the lib/os, and now I can't communicate with my GPy anymore.

    More details:

    I am new the pycom/micropython/microcontrollers world and have recently started playing with it. I've been trying to debug some code, and looking for a good logging implementation - and found this pycopy library. I could not figure out how to get it on my board, until I found this article explaining how to get upip installed. The article uses it to install uasyncio - but I figured it's the same to install any pip package. That worked quite well, and I indeed got upip install, and then ran: upip.install("pycopy-logging", "lib"), resulting in the following output:

    Installing to: lib/
    Warning: SSL certificate is not validated
    Installing pycopy-logging 0.7.5 from
    Installing pycopy-os 1.1.3 from
    Installing pycopy-errno 0.1.4 from
    Installing pycopy-os.path 0.2.8 from
    Installing pycopy-stat 0.5.1 from
    Installing pycopy-uos2 0.5.6 from
    Installing pycopy-ffilib 0.2.1 from
    >>> Running
    >>> Traceback (most recent call last):
      File "<stdin>", line 8, in <module>
      File "/flash/lib/os/", line 44
    SyntaxError: constant must be an integer
    Pycom MicroPython 1.20.2.r6 [v1.11-c5a0a97] on 2021-10-28; GPy with ESP32
    Pybytes Version: 1.7.1
    Type "help()" for more information.

    As you can see, it installed pycopy-os as a prerequisite, which is my best guess as to the reason of my issues.
    At that point I didn't understand that yet, and I still had access to the REPL. However, since I could not figure out why main was not running - I tried rebooting the the GPY using the reset button, at which point it printed out:

    rst:0x1 (POWERON_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
    configsip: 0, SPIWP:0xee
    mode:DIO, clock div:1
    entry 0x400a05bc

    And that was it.

    Reinstalling the firmware does not seem to help, and I am not sure how to reflash the original software on to it. As I said - quite a noob here.

    Any help is appreciated - thanks!

  • hi @goldfishalpha - thanks for taking the time to answer!

    And good that you did, as I already solved the issue, but forgot to update. For anyone with the same problem:

    Using the "Pycom Firmware Update", if you tick on "show advanced settings":


    you'll have the option to "Erase during update". I've also ticked both RESET buttons, but not sure if strictly necessary:


    That did the trick for me.

  • Top of the head, without going too deep into your issue, try reflashing to a really old firmware update the firmware (i.e. at least a few minor versions) from there. I only stumbled across your question because that's how I recovered a device which wouldn't boot (same log output).

Log in to reply

Pycom on Twitter