Revert to factory from upgrade image written with xflash
Posted: Thu Jun 27, 2019 12:24 pm
Dear community,
using the reference usb audio implementation on a custom board with QSPI flash, I ran into the following problem:
I generate a flash image to a bin file and then program the flash using xflash --write-all.
The flash image contains both the factory image and an upgrade image. I can confirm that the processor boots from the upgrade image.
I however cannot revert back to the factory image by sending the XMOS_DFU_REVERTFACTORY in the dfu mode.
It appears that the code in module_dfu/src/flash_interface.c does not recognize the upgrade image. upgrade_image_valid is 0 and the erase is therefore not performed. Since the libquadflash is closed-source, I cannot track it further.
I can also confirm that the factory image is there and I can "revert to it" by canceling a DFU upgrade process i.e. writing an incomplete upgrade image.
As soon as I write a new upgrade image trough DFU, XMOS_DFU_REVERTFACTORY starts to work.
Any help is appreciated!
Cheers,
Zdenek
using the reference usb audio implementation on a custom board with QSPI flash, I ran into the following problem:
I generate a flash image to a bin file and then program the flash using xflash --write-all.
The flash image contains both the factory image and an upgrade image. I can confirm that the processor boots from the upgrade image.
I however cannot revert back to the factory image by sending the XMOS_DFU_REVERTFACTORY in the dfu mode.
It appears that the code in module_dfu/src/flash_interface.c does not recognize the upgrade image. upgrade_image_valid is 0 and the erase is therefore not performed. Since the libquadflash is closed-source, I cannot track it further.
I can also confirm that the factory image is there and I can "revert to it" by canceling a DFU upgrade process i.e. writing an incomplete upgrade image.
As soon as I write a new upgrade image trough DFU, XMOS_DFU_REVERTFACTORY starts to work.
Any help is appreciated!
Cheers,
Zdenek