Building with BOARD=GPY has max firmware image size ~2MB

  • Hi there!

    We are trying to compile down our code and flash it on our devices, eventually with SecureBoot. I have encountered an interesting thing in this process though. Running the following commands:

    #In pycom-micropython-sigfox
    cd esp32
    #Download our firmware
    echo "Downloading Firmware..."
    cd frozen/Base
    git clone -b "production"
    mv firmware/* . #Move the downloaded firmware into the Base directory
    echo "Firmware downloaded and unpacked."
    cd ..
    cd .. #Move back to base dir
    make BOARD=GPY clean
    make V=1 BOARD=GPY TARGET=boot #Add V=1 for extra debugging
    make BOARD=GPY TARGET=app
    make BOARD=GPY flash

    gives an error on the last one, when trying to flash the image:
    2031856 bytes => Firmware size exceeds available space 2027520 on board

    This sounds strange in my ears, since the GPy is supposed to have 8MB of external flash according to the specsheet? The code can be flashed onto the device using Visual Studio Code (non-frozen using PyCom's plugin) without getting any size-related errors.

    Is the approach to extracting frozen code wrong, or is there something that is done wrong here, hence the size-related errors?

  • @techykermit the flash partition layout splits the total available flash between the boot loader, 2 copies of the firmware (for secure OTA), the “NVRAM” data and the file system.

    Can’t find the current layout right away, but I wouldn’t be surprised if there were about 2 MB for each of the firmware partitions and 4 for the file system or something similar.

    It’s possible to adjust the partition layout (to reduce the file system for instance), but that requires you to fully erase the whole flash. I believe that should be somewhere in the files in esp32/boards/GPY.

Log in to reply

Pycom on Twitter