Other Parts Discussed in Thread: CC3235SF, UNIFLASH, CC3220SF
Hi All
I am trying to run the Amazon FreeRTOS OTA demo on the launchxl-CC3235SF development kit. I have asked an earlier question on this forum if it was possible to do this, because the CC3235SF is not officially supported by Amazon FreeRTOS. You can find my question here.
I have followed all the required steps, documented on the official AFR documentation.
When running the demo, everything seems fine. It successfully connects to WIFI and initializes the connection to the MQTT broker. It creates the OTA task and starts listening for new job events. After an OTA job is created in AWS, the demo receives the job and starts the download. After this, the downloaded image gets validated and a reboot is executed to load this image. Here arises the first problem. The MCU freezes when the reboot is executed (I have traced this back to line 349 in vendors/ti/boards/cc3220_launchpad/ports/ota/aws_ota_pal.c: sl_Stop( OTA_SL_STOP_TIMEOUT ); /*lint !e534 ignore return code because we are going to reset the device below. */). When the OTA_SL_STOP_TIMEOUT variable is set to 0, the MCU is able to reboot.
When the MCU reboots, the demo starts in self-test mode. In this mode, checks are executed to validate the new firmware image and according to that, the firmware gets accepted or gets rolled back to the previously working firmware. Here the second problem arrives. In the validation process, the version of the currently running firmware is compared to the firmware version which started the OTA job ('old' firmware). Here the check returns that the two versions are the same and rolls back the firmware. I have changed the application version variable as described here.
I don't know the cause of the first problem (maybe some of you know this?), but I think the second problem has to do with the downloaded firmware which is not written into flash, the boot flags which are set incorrectly or the MCU which performs a factory-reset when it is rebooting, causing the 'old' firmware version to be reloaded.
Can someone help me with this? You can find the output of the AFR OTA demo here.
Thanks in advance!
Greetings
Hans