If you followed the TI ota examples and got "Error retrying ..." in the terminal output, you were not alone. This problem took me 2 days to resolve.
No matters if you are using the ota_os or ota_nonos example, you can use the IDE debug mode to step through the main.c code, and examine the value for iRet. As described in ota_api.h, below are the meaning of the returned value:
#define RUN_STAT_ERROR -1
#define RUN_STAT_ERROR_TIMEOUT -2
#define RUN_STAT_ERROR_CONNECT_OTA_SERVER -3
#define RUN_STAT_ERROR_RESOURCE_LIST -4
#define RUN_STAT_ERROR_METADATA -5
#define RUN_STAT_ERROR_CONNECT_CDN_SERVER -6
#define RUN_STAT_ERROR_DOWNLOAD_SAVE -7
#define RUN_STAT_ERROR_CONTINUOUS_ACCESS_FAILURES -1000
The common error I have encountered were error -3 and error -4. Error -3 means the CC3200 cannot connect to the Dropbox server, so check the key gen token. Error -4 generally means the folder in the Dropbox cannot be found. This is what I'm going to explain in detail here.
First of all, make sure you got the right detail in otaconfig.h
#define OTA_SERVER_NAME "api.dropbox.com"
#define OTA_SERVER_IP_ADDRESS 0x00000000
#define OTA_SERVER_SECURED 1
#define OTA_SERVER_REST_UPDATE_CHK "/1/metadata/auto/" // returns files/folder list
#define OTA_SERVER_REST_RSRC_METADATA "/1/media/auto" // returns A url that serves the media directly
#define OTA_SERVER_REST_HDR "Authorization: Bearer "
#define OTA_SERVER_REST_HDR_VAL "5It23efsJ5wAAAAAAAAS3JO0YhzVu5UEdDH_8NsJvO2QhBfVu-qmi6j7d5G_gPjx"
#define LOG_SERVER_NAME "api-content.dropbox.com"
#define OTA_SERVER_REST_FILES_PUT "/1/files_put/auto/"
#define OTA_VENDOR_STRING "Vid01_Pid00_Ver00"
The two definitions you need to change here are
OTA_SERVER_REST_HDR_VAL - put your Dropbox token here with the double quotes
OTA_VENDOR_STRING - for this example here, just use "Vid01_Pid00_Ver00" and I will make sure that you will get it working at the end.
Now, from the screenshot above, you can see that in this example, my Nwp Version is 2.4.0.2.31.1.3.0.1.1.0.3.34
Please noted that I highlighted the 4th bytes in Red because this number is very important, and it has to be 2 digits, so 2 = 02.
Now in your Dropbox, create the App and and folder as follows
https://www.dropbox.com/home/Apps/TI_CC3200_OTA/Vid01_Pid00_Ver0002
In that directory, the folder name "TI_CC3200_OTA" is arbitrary, so you can use whatever name you want, and this is the folder the Token in OTA_SERVER_REST_HDR_VAL is pointing to.
Now it comes to the critical part, which is subfolder called "Vid01_Pid00_Ver0002". The name consists of two parts : Part 1 = Vid01_Pid00_Ver00, and Part 2 = 02. Part 1 is arbitrary but it has to be exactly the same as the string you defined for OTA_VENDOR_STRING in otaconfig.h, whereas Part 2 is NOT arbitrary, Part 2 is the two digit numbers of the Nwp Version, in this example, is 02.
In side the folder Vid01_Pid00_Ver0002, you put the firmware that you wish to be loaded to the CC3200 processor. In the simplest case, just compile the ota_os or ota_nonos example, but change the APP_VER_BUILD = 1 in otaconfig.h so that you will know if the new firmware is loaded to the processor. Once the new firmware is built, go to the release folder of your workspace directory to look for the .bin file, check the file's last modify time to make sure this is the file just been built. Then rename the file to f80_sys_mcuimgA.bin and copy it into the Vid01_Pid00_Ver0002 folder in Dropbox.
And here you go, just follow the usual steps in the TI example documentation, load the ota_os or ota_nonos code (with APP_VER_BUILD = 0) to the processor using Uniflash. In Uniflash, when you add the mcuimg1.bin file, make sure to name the file /sys/mcuimg1.bin and left the Max Size to 0. For the Url, just point it to the built file (with APP_VER_BUILD = 0 and for example, mine is located in Eclipse Workspace\ota_update_nonos\Release\ota_update_nonos.bin).
Then unplug the USB cable, take the jumper of the SOP2 out, then plug the USB cable back in, and open terminal. Once the Internet connection is established, the press SW3, it should work if you follow the steps above closely. Good luck.