FOTA with iOS and Android – MTU size? | Cypress Semiconductor
FOTA with iOS and Android – MTU size?
Hello dear community!
We are developing Firmware Over The Air update functionality with our iOS and Android apps. We got everything working and are able to update the firmware from the Bootloader Host Tool, as well as from our iOS app (and the CySmart app on iOS). The remaining platform is Android, and it is causing a lot of headache.
When starting the firmware update on Android, at first, everything seems alright. The bootloader is entered, and all commands are executed perfectly until the data is written. It seems like Android is trying to send 138 bytes of data to write a row to the memory on the chip. The write doesn't get any positive response notification, supposedly because the "Attribute MTU size (bytes)" in the BLE CSD's GAP Settings is set to 23. If you set the MTU size to 138 or bigger, the FOTA process succeeds on Android. Unfortunately, that breaks the FOTA functionality on iOS… As we've already shipped the iPhone apps, we prefer fixing the Android side.
Apparently Android fails to chunk the data under the hood so that the chunks are reassembled at the link layer on the peripheral's side. This happens with both our own Android app and the Android CySmart app.
The underlying code of our embedded application is "BLE OTA Bootloader and Bootloadable Example Project 1.0".
What should the MTU size be?
How should the Android size chunk the data into 20 bytes packets?
Why is the CySmart Android app not able to update the firmware either?
All the best,