Bricked Device Updating Firmware



  • Hello, I have a GPY with a Pytrack Connected by USB to a laptop running Windows 10. I tried following the guide for SecureBoot and Encryption under advanced topics with Ubuntu for windows. However, after I finished running all the commands in the guide my Gpy seems to be bricked. Opening pymkr in atom I get the following error below. I have tried to flash new firmware using the Pycom upgrade application with my gpy being in download mode through having P2 and ground connected and also having erase flash selected in advanced options. Also, I have tried holding P12 and 3.3V. However, nothing I have tried has helped and I am still getting this error message. I have another Gpy that works but I am hesitant to flash any firmware as I am afraid of bricking it too. Where did I go wrong with the SecureBoot and Encryption Guide? How can I fix my Gpy and make sure this doesn't happen again? Thank you.

    rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    flash read err, 1000
    ets_main.c 371
    ets Jun 8 2016 00:22:57

    Here is my flash encryption status:
    I ran this with python $IDF_PATH/components/esptool_py/esptool/espefuse.py -p /dev/ttyS9 summary

    Security fuses:
    FLASH_CRYPT_CNT Flash encryption mode counter = 1 R/W (0x1)
    FLASH_CRYPT_CONFIG Flash encryption config (key tweak bits) = 15 R/W (0xf)
    CONSOLE_DEBUG_DISABLE Disable ROM BASIC interpreter fallback = 1 R/W (0x1)
    ABS_DONE_0 secure boot enabled for bootloader = 1 R/W (0x1)
    ABS_DONE_1 secure boot abstract 1 locked = 0 R/W (0x0)
    JTAG_DISABLE Disable JTAG = 0 R/W (0x0)
    DISABLE_DL_ENCRYPT Disable flash encryption in UART bootloader = 0 R/W (0x0)
    DISABLE_DL_DECRYPT Disable flash decryption in UART bootloader = 0 R/W (0x0)
    DISABLE_DL_CACHE Disable flash cache in UART bootloader = 0 R/W (0x0)
    BLK1 Flash encryption key
    = ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? -/-
    BLK2 Secure boot key
    = ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? -/-
    BLK3 Variable Block 3
    = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W

    Efuse fuses:
    WR_DIS Efuse write disable mask = 384 R/W (0x180)
    RD_DIS Efuse read disablemask = 3 R/W (0x3)
    CODING_SCHEME Efuse variable block length scheme = 0 R/W (0x0)
    KEY_STATUS Usage of efuse block 3 (reserved) = 0 R/W (0x0)

    Config fuses:
    XPD_SDIO_FORCE Ignore MTDI pin (GPIO12) for VDD_SDIO on reset = 1 R/W (0x1)
    XPD_SDIO_REG If XPD_SDIO_FORCE, enable VDD_SDIO reg on reset = 1 R/W (0x1)
    XPD_SDIO_TIEH If XPD_SDIO_FORCE & XPD_SDIO_REG, 1=3.3V 0=1.8V = 0 R/W (0x0)
    CLK8M_FREQ 8MHz clock freq override = 51 R/W (0x33)
    SPI_PAD_CONFIG_CLK Override SD_CLK pad (GPIO6/SPICLK) = 0 R/W (0x0)
    SPI_PAD_CONFIG_Q Override SD_DATA_0 pad (GPIO7/SPIQ) = 0 R/W (0x0)
    SPI_PAD_CONFIG_D Override SD_DATA_1 pad (GPIO8/SPID) = 0 R/W (0x0)
    SPI_PAD_CONFIG_HD Override SD_DATA_2 pad (GPIO9/SPIHD) = 0 R/W (0x0)
    SPI_PAD_CONFIG_CS0 Override SD_CMD pad (GPIO11/SPICS0) = 0 R/W (0x0)
    DISABLE_SDIO_HOST Disable SDIO host = 0 R/W (0x0)

    Identity fuses:
    MAC Factory MAC Address
    = 24:0a:c4:c7:af:f0 (CRC 0x4b OK) R/W
    CHIP_VER_REV1 Silicon Revision 1 = 1 R/W (0x1)
    CHIP_VER_REV2 Silicon Revision 2 = 0 R/W (0x0)
    CHIP_VERSION Reserved for future chip versions = 2 R/W (0x2)
    CHIP_PACKAGE Chip package identifier = 0 R/W (0x0)

    Calibration fuses:
    BLK3_PART_RESERVE BLOCK3 partially served for ADC calibration data = 0 R/W (0x0)
    ADC_VREF Voltage reference calibration = 1149 R/W (0x7)

    Flash voltage (VDD_SDIO) set to 1.8V by efuse.



  • After I followed that forum post I woud get another error. E (389) esp_image: image at 0x10000 has invalid magic byte



  • I think that error is because your firmware isn´t encrypted with the key stored on your device. You cannot run stock firmware again if encryption is enabled. Did you save all commands that you´ve executed, preferable with the output? Without that information it will be hard to tell what´s wrong.

    I think I didn´t succeed to 100% following the instructions, I got some error. See my notes in this thread for information about how I got it working.

    https://forum.pycom.io/topic/4949/secureboot-and-encryption?_=1591330156340

    Johan


Log in to reply
 

Pycom on Twitter