Problem in generating binary for DFU

Technical questions regarding the XTC tools and programming with XMOS.
arun.v@emqos.com
Junior Member
Posts: 6
Joined: Wed Dec 04, 2024 9:30 am

Problem in generating binary for DFU

Post by arun.v@emqos.com »

Hello Xmos team:
I am working on Firmware upgrade feature for xmos. When I create a binary for flashing using xobjdump, using the command like "xobjdump --strip mybin.xe"
(a) I get a file 277440 bytes
(b) binary upgrade using the file does not work

So i flashed the build(.xe file) to xmos, and then i copied the file out to try binary flashing. I notice the file size is 280608 bytes and I am able to perform firmware update sucessfully.

I not sharing the binary files, with this post, here as it is a public forum. If anyone from xmos side want to take a look at binary files, please send an email to arun.v@emqos.com

Please provide me the correct way to generate binary file for firmware upgrade.

Regards,
Arun
User avatar
fabriceo
XCore Addict
Posts: 244
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hi !
you should have a look in detail on the recent AN02019 here
it describe how this works and the good command line to generate the image (it also depends on your tools version...)

hope this helps
fabriceo
arun.v@emqos.com
Junior Member
Posts: 6
Joined: Wed Dec 04, 2024 9:30 am

Post by arun.v@emqos.com »

Hi fabriceo:
It is not clear to me how to generate the image in command line. I use 15.2.1 version the tool. Can you please provide me exact instructions on how to generate the firmware for dfu

Regards
Arun
User avatar
fabriceo
XCore Addict
Posts: 244
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hi Arun,

assuming you have a working program written in the flash memory as a factory image and also containing a DFU interface recognized on USB, then you can program another upgrade image with a DFU utility like xmosdfu or dfuutil.
The binary file must be generated with the xflash utility and the --upgrade option.
It is important to have the --factory-version option with value aligned with the version of the tools that has been used to generate and flash the factory image, most likely 15.2 in your case. So the command should be:

xflash --factory-version 15.2 --upgrade 1 yourprogram.xe -o yourimage.bin

hope this helps
fabriceo
arun.v@emqos.com
Junior Member
Posts: 6
Joined: Wed Dec 04, 2024 9:30 am

Post by arun.v@emqos.com »

Let me explain the scenario in little bit detail. Our product doesnt have usb port connected to xmos. We have an MSP chip (TI Arm chip), which has connected to modem for external computation. XMOS connects to MSP chip, via a shared flash and uart(for exchanging commands)
The way firmware upgrade works is MSP checks for new firmware in a FTP server, downloads them into shared flash when available. Further after downloading xmos is activated. xmos checks for new firmware in shared flash and upgrades itself.
The question is how to generate the firmware image for download and upgrade.
One of the earlier instruction provided by Andrew(from XMOS) was to use a command like xobjdump --strip mybin.xe to generate firmware file, which could be used. But it doesnt work.
However, when i flash the xmos with an image in factory image (not dfu), and that when i copied out to share flash and then upload it the ftp server, i could use that image successfully for Firmware upgrade. Currently, the only option i have is to flash the image in xmos, and upload it to ftp server, in the way described earlier. My hope is i will be able to write a command in my PC where XMOS drivers are installed and it will generate the binary file from .xe file. I hope this is clear and you will be able to provide a solution.
User avatar
andrewxcav
Verified
Experienced Member
Posts: 69
Joined: Wed Feb 17, 2016 5:10 pm

Post by andrewxcav »

Hi Arun,

I think you want to use xflash with the --outfile option:

https://www.xmos.com/documentation/XM-0 ... sh-outfile

For more details on the .xe file format:

https://www.xmos.com/documentation/XM-0 ... cture.html

Cheers,
-Andrew
arun.v@emqos.com
Junior Member
Posts: 6
Joined: Wed Dec 04, 2024 9:30 am

Post by arun.v@emqos.com »

Hello Andrew/Xmos team:

I created binary image using xflash --factory example_freertos_explorer_board.xe -o XMOS_arun_4.bin

(1) The binary is not working for DFU
(2) The binary has different size than the one uploaded from bollard (and contents also different)

Regards
Arun
User avatar
andrewxcav
Verified
Experienced Member
Posts: 69
Joined: Wed Feb 17, 2016 5:10 pm

Post by andrewxcav »

Try this:

xflash --noinq --factory-version 15.2 --upgrade [UPGRADE_VERSION] [UPGRADE_EXECUTABLE] -o [OUTPUT_BINARY]

For upgrade version just put a version number that is higher than any previous upgrade versions.