I'm adding support to our XMOS application for updating the firmware over a UART, similar to how firmware updates are handled in lib_tsn.
A couple of quick questions.
The firmware image itself (written using fl_writeImagePage()) – presumably it's not the .xe file itself. Is it the output of xobjdump --strip or something else?
fl_endWriteImage() is called when the image has been uploaded; is there an API call to abort/rollback the in progress firmware update?
Thanks :)
Programmatic firmware updates Topic is solved
-
- Active Member
- Posts: 50
- Joined: Sat Jul 08, 2023 5:15 am
-
- Junior Member
- Posts: 5
- Joined: Wed Jul 24, 2024 12:05 pm
The API expects an upgrade image generated using XFLASH, from the documentation ("Design and manufacture systems with flash memory"):lukehatpadl wrote: ↑Mon Mar 10, 2025 9:28 am The firmware image itself (written using fl_writeImagePage()) – presumably it's not the .xe file itself. Is it the output of xobjdump --strip or something else?
$ xflash --upgrade <version-id> latest-release.xe --factory-version <tools-version> -o upgrade-imageWhere <tools-version> is the version used to create the original factory image. <version-id> by default is expected to be a monotonic version counter; the XFLASH bootloader will by default load the image with the highest version number assuming it's valid.
If the update did not complete, the bootloader will not consider the image as valid and will fall back to another. Clean up can be done using `fl_deleteImage()` on the incomplete image which will free up the flash area for a new image.lukehatpadl wrote: ↑Mon Mar 10, 2025 9:28 am fl_endWriteImage() is called when the image has been uploaded; is there an API call to abort/rollback the in progress firmware update?
-
- Active Member
- Posts: 50
- Joined: Sat Jul 08, 2023 5:15 am
Thanks Daz!
-
- Active Member
- Posts: 50
- Joined: Sat Jul 08, 2023 5:15 am
Fun fact: if the chip is not initially flashed with an upgrade image with xflash, it appears that fl_startImageAdd() returns 1 infinitely.
-
Verified
- XCore Legend
- Posts: 1163
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
do you mean "factory image" rather than "upgrade image"?
Technical Director @ XMOS. Opinions expressed are my own
-
- Active Member
- Posts: 50
- Joined: Sat Jul 08, 2023 5:15 am
I meant it flashed with factory but no upgrade.
i.e.
xflash --spi-div=8 --factory bin/vestibule_xebra.xe
as opposed to
xflash --spi-div=8 --factory bin/vestibule_xebra.xe --upgrade 0 bin/vestibule_xebra.xe
i.e.
xflash --spi-div=8 --factory bin/vestibule_xebra.xe
as opposed to
xflash --spi-div=8 --factory bin/vestibule_xebra.xe --upgrade 0 bin/vestibule_xebra.xe