Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Catch OTA.Update Error

I'm seeing an issue with the OTA.Update in my code (cc3200)where if I call it and there's not enough memory I get errors and it reboots the system. How can I detect an issue with the OTA.Update call and recover without rebooting the system?

mgos_rpc_call("RPC.LOCAL", "OTA.Update", "{\"url\": \"http://firmware.com/fw_dev.zip\", \"commit_timeout\": 0}", NULL, NULL);

Comments

  • Here's the output I am seeing

  • rojerrojer Dublin, Ireland

    so, error -30 is SL_FS_ERR_NO_AVAILABLE_BLOCKS, meaning there's no space available on SPI flash. we try our best to have it not happen, as that pretty much means no further OTA updates are possible.
    i need to understand how the system gets into this state. do you add your own files to SLFS? can you reliably reproduce it? it would also be great to have a list of files on the FS after such failed update.
    you can use UniFlash v3 to list contents of the SLFS (SimpleLink filesystem).

  • rojerrojer Dublin, Ireland

    example of filesystem dump

  • rgrifin12rgrifin12 Newtown, CT

    Please see below!

    [15:12:46] Operation ListFileSystem returned.
    [15:12:50] Begin ListFileSystem operation.
    [15:12:50] INFO: > Executing Operation: Connect
    [15:12:52] INFO: setting break signal
    [15:12:52] INFO: connection succeeded
    [15:12:52] INFO: getting storage list
    [15:12:53] INFO: > Executing Operation: Init
    [15:12:53] INFO: reading version info
    [15:12:53] INFO: DEVICE CC3200 ES1.33
    [15:12:53] INFO: reading version info
    [15:12:54] INFO: reading version info
    [15:12:55] INFO: > Executing Operation: ListFileSystem
    [15:12:55] INFO: extracting file system information...
    [15:12:55] INFO: Serial Flash block size: 4096 bytes
    [15:12:55] INFO: Serial Flash capacity: 256 blocks

    [15:12:55] INFO: file start size fail total size filename
    [15:12:55] INFO: index block [BLKs] safe [BLKs]
    [15:12:55] INFO: ----------------------------------------------------------------------------
    [15:12:55] INFO: N/A 0 5 N/A 5 FATFS
    [15:12:55] INFO: 0 19 4 no 4 /sys/mcuimg.bin
    [15:12:55] INFO: 4 5 14 no 14 /sys/servicepack.ucf
    [15:12:55] INFO: 6 23 1 no 1 mg-boot.cfg.0
    [15:12:55] INFO: 7 24 1 no 1 mg-boot.cfg.1
    [15:12:55] INFO: 8 25 60 no 60 genican_release_1.bin.0
    [15:12:55] INFO: 9 85 25 no 25 spiffs.img.0.0
    [15:12:55] INFO: 10 110 60 no 60 genican_release_1.bin.1
    [15:12:55] INFO: 11 170 25 no 25 spiffs.img.0.1
    [15:12:55] INFO: 12 195 25 no 25 spiffs.img.1.0
    [15:12:55] INFO: 13 220 5 yes 10 /tmp/phy.cal
    [15:12:55] INFO: 14 230 1 yes 2 /sys/mode.cfg
    [15:12:55] INFO: 15 232 1 yes 2 /sys/ipcfg.ini
    [15:12:55] INFO: 16 234 1 yes 2 /sys/stacfg.ini
    [15:12:55] INFO: 17 236 1 yes 2 /tmp/table.arp
    [15:12:55] INFO: 18 238 1 yes 2 /sys/ap.cfg
    [15:12:55] INFO: 19 240 1 yes 2 /sys/dhcpsrv.cfg
    [15:12:55] INFO:

    [15:12:55] INFO: Flash usage
    [15:12:55] INFO: -------------------------
    [15:12:55] INFO: used space: 242 blocks
    [15:12:55] INFO: free space: 14 blocks
    [15:12:55] INFO: memory hole: [242-255]
    [15:12:55] INFO: > Executing Operation: Disconnect
    [15:12:55] Operation ListFileSystem returned.

  • rgrifin12rgrifin12 Newtown, CT

    Heres the output with formatting.

  • rojerrojer Dublin, Ireland

    ok, i see. device is flashed with genican_release_1 and you're flashing crc080317 over it. the firmware name needs to match.

  • rojerrojer Dublin, Ireland

    although that should not be a requirement, i'll fix it

Sign In or Register to comment.