This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

OTA Max Filesize?

Other Parts Discussed in Thread: CC3200, UNIFLASH

Hello,

I have a CC3200 with 16MB of SFlash attached and I'm trying to get OTA updates working with it but I have problems when trying to OTA update files that are larger than 190KB.

The problem file is 372KB in size and in my Uniflash configuration I set it's Max Size to 1040384. The file that the OTA keeps failing on is /www/app.min.js. All the other files are much smaller, the next biggest being 171K.

This is the file system on the CC3200 after Format, Service Pack Program, and Program Uniflash operations:

[13:51:48] INFO: > Executing Operation: ListFileSystem
[13:51:48] INFO: extracting file system information...
[13:51:49] INFO: Serial Flash block size:	4096 bytes
[13:51:49] INFO: Serial Flash capacity:		4096 blocks

[13:51:49] INFO: 	file	start	size	fail	total size	filename
[13:51:49] INFO: 	index	block	[BLKs]	safe	[BLKs]
[13:51:49] INFO: ----------------------------------------------------------------------------
[13:51:49] INFO: 	N/A	0	5	N/A	5		FATFS
[13:51:49] INFO: 	0	71	4	no	4		/sys/mcuimg.bin
[13:51:49] INFO: 	4	5	33	yes	66		/sys/servicepack.ucf
[13:51:49] INFO: 	6	75	1	yes	2		/sys/mode.cfg
[13:51:49] INFO: 	7	77	1	yes	2		/sys/ipcfg.ini
[13:51:49] INFO: 	8	79	1	yes	2		/sys/ap.cfg
[13:51:49] INFO: 	9	81	1	yes	2		/sys/devname.cfg
[13:51:49] INFO: 	10	83	1	yes	2		/sys/dhcpsrv.cfg
[13:51:49] INFO: 	11	85	1	yes	2		/sys/httpsrv.cfg
[13:51:49] INFO: 	12	87	2	yes	4		/sys/pref.net
[13:51:49] INFO: 	13	91	1	yes	2		/sys/stacfg.ini
[13:51:49] INFO: 	14	93	1	yes	2		/sys/pmcfg.ini
[13:51:49] INFO: 	15	95	255	no	255		/www/index.html
[13:51:49] INFO: 	16	350	255	no	255		/www/dashboard.html
[13:51:49] INFO: 	17	605	255	no	255		/www/app.min.js
[13:51:49] INFO: 	18	860	255	no	255		/www/app.min.css
[13:51:49] INFO: 	19	1115	2	no	2		/www/device.json
[13:51:49] INFO: 	20	1117	2	no	2		/www/gateruntimedata.json
[13:51:49] INFO: 	21	1119	17	no	17		/www/gatessetupdef.xml
[13:51:49] INFO: 	22	1136	2	no	2		/www/network.json
[13:51:49] INFO: 	23	1138	9	no	9		/www/nxtsetupdef.xml
[13:51:49] INFO: 	24	1147	2	no	2		/www/singlegatefullruntimedata.json
[13:51:49] INFO: 	26	1149	2	no	2		/www/singlegategatedriversettings.json
[13:51:49] INFO: 	27	1151	2	no	2		/www/singlegatesimpleruntimedata.json
[13:51:49] INFO: 	28	1153	2	no	2		/www/systemruntimedata.json
[13:51:49] INFO: 	29	1155	9	no	9		/www/systemsetupdef.xml
[13:51:49] INFO: 	30	1164	17	no	17		/www/foundation-icons.eot
[13:51:49] INFO: 	31	1181	17	no	17		/www/foundation-icons.ttf
[13:51:49] INFO: 	32	1198	17	no	17		/www/foundation-icons.woff
[13:51:49] INFO: 	33	1215	9	no	9		/www/company-logo.png
[13:51:49] INFO: 	34	1224	9	no	9		/www/company-logo-tight-86.png
[13:51:49] INFO: 	35	1233	2	no	2		/www/modbusread.json
[13:51:49] INFO: 	36	1235	2	no	2		/www/devicetime.json
[13:51:49] INFO: 	37	1237	2	no	2		/www/confirmationcode.json
[13:51:49] INFO: 	38	1239	255	no	255		/sys/mcuimg1.bin
[13:51:49] INFO: 	39	1494	5	yes	10		/tmp/phy.cal
[13:51:49] INFO: 


[13:51:49] INFO: 	Flash usage
[13:51:49] INFO: -------------------------
[13:51:49] INFO: used space:	1504 blocks
[13:51:49] INFO: free space:	2592 blocks
[13:51:49] INFO: memory hole:	[1504-4095]
[13:51:49] INFO: > Executing Operation: Disconnect
[13:51:49] Operation ListFileSystem returned. 

Here are the files that I have in the Dropbox OTA folder and their file sizes:

256B f00_sys_servicepack.sig
171K f00_www_app.min.css
372K f00_www_app.min.js
 39B f00_www_confirmationCode.json
1.1K f00_www_dashboard.html
267B f00_www_device.json
3.2K f00_www_company-logo.png
3.2K f00_www_company-logo-tight-86.png
 54K f00_www_foundation-icons.eot
 56K f00_www_foundation-icons.ttf
 32K f00_www_foundation-icons.woff
 59B f00_www_gateRuntimeData.json
 27B f00_www_deviceTime.json
 73K f00_www_index.html
 27B f00_www_modbusRead.json
671B f00_www_network.json
 27B f00_www_singleGateFullRuntimeData.json
 65B f00_www_singleGateGateDriverSettings.json
 27B f00_www_singleGateSimpleRuntimeData.json
 27B f00_www_systemRuntimeData.json
 26K f43_sys_servicepack.ucf
122K f80_sys_mcuimgA.bin

When I try to run the OTA the CC3200 downloads servicepack.sig and app.min.css without issue but when it finishes downloading app.min.js the sl_extLib_OtaRun function returns RUN_STAT_ERROR_METADATA (-5) and the OTA process ends.

Looking in the simplelink_extlib/ota/OtaApp.c file this return value is sent when OtaClient_ResourceMetadata returns < 0.

I tried truncating the problem file to different sizes and when it was 190K it did not work but once I truncated it down to 189K the OTA process completed without issue.

I was under the impression that the largest file size on the CC3200 is 1MB, is this smaller for files updated by OTA? Is there something wrong with my configuration that is causing this issue?

Any help in resolving this issue would be much appreciated.

Thank You,
Marek

  • Hi Marek,


    Enable debug print and share console log with us. To enable debug print you need to define "DEBUG_PRINT" in project properties of simplelink_extlib\ota library and recompile ota library and application.


    Regards,
    Aashish
  • Hi Aashish,

    Thanks for the reply.

    My CC3200 uses the serial port for Modbus communication so I cannot easily read the debug prints but I have gotten closer to the problem with the debugger.

    The error actually occurs after the large file has been successfully downloaded and OtaClient_ResourceMetadata has been called for the next OTA file.

    Line 179 in OtaClient.c in function OtaClient_ResourceMetadata returns -1:

    len = sl_Send(pOtaClient->serverSockId, send_buf, (_i16)strlen((const char *)send_buf), 0);

    For some reason the sl_Send call in the OTA library fails when the OtaClient_ResourceMetadata function is called for the file AFTER the large file. The large file itself is correctly updated on the SFlash.

    If I make the large file the last file to be updated by renaming it from f00_www_app.min.js to f00_www_zapp.min.js (I also removed the firmware and service pack files from the Dropbox folder) the OTA completes successfully.

    It looks as though some state in the OTA library is left over or overflows from downloading the large file to the next file in the OTA and prevents the sl_Send call from completing successfully.

    I'm not sure how to proceed to resolve the issue. Do you have any suggestions on how to proceed?

    Thank You,
    Marek

  • Hi Marek,


    Please put debug point in SimpleLinkSockEventHandler() and let us know whether it or not. If it hits, post value of all member of SlSockEvent_t.


    Regards,
    Aashish
  • Hi Aashish,

    The SimpleLinkSockEventHandler() is regularly called when about 200K of a large file has been downloaded.

    With a 413313 Byte file it occurs at 227322 Bytes.
    With a 323139 Byte file it occurs at 197114 Bytes.

    When downloading a small 1K file the function does not get called.

    After the SimpleLinkSockEventHandler() gets called when downloading the large file it gets called again about 12 seconds later with different data. I'm not sure what is happening there.

    Here is the SLSockeEvent_t data on the first call:

    And on the second delayed call:

    Regards,
    Marek

  • Hi Marek,


    Is it possible to enable UART log for temporary. May be using EVM board. As it will be easy for us to know from log what really happening.


    After sl_Send failure please send the following info:
    len from len = sl_Send(… ,
    send_buf string and also memory dump of all its 512 bytes
    memory dump of response_buf (1440 bytes) before the memset(response_buf… + compare to last bytes of the previous file (f00_www_app.min.js)


    Also note that default library support max files for OTA. So please sure you have updated MAX_RESOURCES macro value from 16 to max number of files required to update.


    Regards,
    Aashish
  • Hi Aashish,

    After further inspecting the ota_update example and making some changes to my firmware it looks like the issue has mostly been resolved.

    It looks to have been caused by two main things:

    1. I had one continuous SSL connection and one intermittent SSL connection running while the OTA update was running. Because the CC3200 only supports 2 simultaneous SSL connections I think this was causing issues when the OTA was trying to connect to Dropbox. Now I pause these connections for the duration of the OTA.
    2. I was ending the OTA process as soon as sl_extLib_OtaRun returned any error instead of ignoring all of them except RUN_STAT_ERROR_CONTINUOUS_ACCESS_FAILURES as the ota_update example does.

    The OTA process still fails on a file that is 986061 Bytes and succeeds on a file that is 964240 Bytes so it's not completely solved but I have already spend too much time with this issue.

    Thank you very much for you help.

    Regards,

    Marek