Need help fixing bricked GPy



  • I'm concerned I may have bricked my GPy. When I power up the board the LED remains permanently lit red and my attempts to safe boot the module have been unsuccessful . Given that I don't have an expansion board I'm unable connect with the device at all and I'm not really sure what else i can try. Any ideas?



  • @robert-hh Thanks so much for the help!



  • @pycom_user123 Just a note ahead:
    Enclose program code in lines with three backticks ``` . That will keep the indentation. The error is caused by omission of
    import machine

    Through a serial console and the USB/UARt interface you can get access to the REPL prompt. Also, since the connect statement was executed, you may see the device in the network you connected it to, but then under a different IP address, which was assigned by the router. In any case you can deal then with boot.py. In the worst case you can delete it with:

    import uos
    uos.remove("boot.py")

    and then create a new boot.py.



  • @robert-hh This worked, thank you! Another question, somewhat unrelated. I'm following the steps here => https://docs.pycom.io/tutorials/all/wlan.html to connect my GPy to router and I edited the boot.py file with the code below:

    from network import WLAN
    wlan = WLAN(mode=WLAN.STA)
    
    nets = wlan.scan()
    for net in nets:
        if net.ssid == 'ssid':
            print('Network found!')
            wlan.connect(net.ssid, auth=(net.sec, 'password'), timeout=5000)
            while not wlan.isconnected():
                machine.idle() # save power while waiting NameError: name 'machine' is not defined
            print('WLAN connection succeeded!')
            break
    

    I'm getting an error that reads "NameError: name 'machine' is not defined". I'm no longer able to access ftp server using the the command 'ftp 192.168.4.1' to adjust the boot.py file. So my question is how do I access the file system so I can edit the boot.py file to fix this error?



  • @pycom_user123 At least you need an USB/UART bridge. Then you can re-flash the device. Connect:

    GPY   USB/UART bridge
    GND -> GND
    Vin -> 5V
    P0 -> Tx
    P1 -> Rx
    P2 -> GND
    

    and then push reset. Then you can run the firmware updater. Tx and RX have sometimes to be swapped. The labeling at the bridges is sometimes the opposite. When you connect a terminal emulator, you should see a boot message like:

    rst:0x1 (POWERON_RESET),boot:0x2 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_FEO_V2))
    waiting for download
    

    If updating fails, try a complete flash erase using esptool.py (e.g. here: https://github.com/espressif/esptool/tree/4dab24e1b28632d270adf7305fe0d008d1acee99)
    The link contains instructions for reading.
    Command e.g.:
    python3 esptool.py --port your_usb_port erase_flash

    Unless the device is physically damaged, which rarely happens, you can always restore it.


Log in to reply
 

Pycom on Twitter