xflash problem cant find target XN

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

xflash problem cant find target XN

Post by bearcat »

Using Community 14.3.0 on linux. Trying to generate a .bin from the .xe file. I load the bin file into the custom hardware using another application.

Code: Select all

#!/bin/bash

cd /opt/XMOS/xTIMEcomposer/Community_14.3.0
source SetEnv
xflash --noinq --target-file ../src/SMe.xn --boot-partition-size 1048576 --factory ../bin/SMe.xe --spi-spec ../src/SPANSION_S25FL216K -o ../bin/SMe.bin
Paths shortened above. Program compiles fine. Makefile has TARGET = SMe in application. Flashing directly from xTimeComposer also works. Running the shell command script above gives this error:
Warning: F03130 --target/--target-file options ignored when an XE file is given
target-xn-v0-90c6e88c: Error: F03000 Failed to open file: target-xn-v0-90c6e88c.
Worked in a prior release using --target-file to specify the .XN file (on windows if that matters). Have no idea where the above target name is set or generated.

Thanks.


User avatar
xsamc
Active Member
Posts: 55
Joined: Fri Mar 04, 2011 3:38 pm

Post by xsamc »

Hi bearcat,

I believe it should be possible to run xflash without passing in a target file when using an xe file (as the xe contains the required information). When I attempted running a similar command to yours with tools 14.3.0, but omitting both the --target-file and --spi-spec arguments, xflash completed successfully and created me a bin file.

Could you give it a go without specifying the target file? Without the SPI spec file you're using there isn't much else I can try sorry.

Cheers,
Sam
bearcat
Respected Member
Posts: 283
Joined: Fri Mar 19, 2010 4:49 am

Post by bearcat »

Removing --target-file and --spi-spec doesn't work either.

Code: Select all

target-xn-v0-5871c5f1: Error: F03000 Failed to open file: target-xn-v0-5871c5f1.
I was able to generate a bin file and successfully use through the run / flash inside xTimeComposer. Put in my options in the correct fields and it generated the bin file.
So I have a work around. Would still prefer the command line.

Thanks.
User avatar
jb123
Junior Member
Posts: 6
Joined: Mon Oct 09, 2023 9:45 pm

Post by jb123 »

bearcat wrote: Wed Jun 28, 2017 2:09 pm I was able to generate a bin file and successfully use through the run / flash inside xTimeComposer. Put in my options in the correct fields and it generated the bin file.
So I have a work around. Would still prefer the command line.
How specifically did you get the GUI to generate a .bin file?
User avatar
fabriceo
XCore Addict
Posts: 184
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Hi, in the xTimecomposer, in the flash configuration menu, in the tab Flash Option you will find a field in the bottom called Other xflash option, where you can type the same arguments than on a flash command line. for the argument, see the xTimecomposer studio guide.pdf
User avatar
jb123
Junior Member
Posts: 6
Joined: Mon Oct 09, 2023 9:45 pm

Post by jb123 »

fabriceo wrote: Tue Oct 31, 2023 9:47 pm where you can type the same arguments than on a flash command line. for the argument, see the xTimecomposer studio guide.pdf
Do you mean this line from DFU-loader-for-XMOS-USB-Audio-devices_1_1.pdf?
To generate the firmware upgrade image run the following command

Code: Select all

xflash --upgrade 1 usb_audio.xe 0x20000 -o new_firmware.bin
You should now have the file usb_audio_class1.bin which contains the firmware for
the audio class 1 implementation.
User avatar
fabriceo
XCore Addict
Posts: 184
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

Exact but without « xflash ». Just the arguments.
But youd better launch a shell an setenv.bat or .sh and then you are more confortable to type your custom commans
User avatar
jb123
Junior Member
Posts: 6
Joined: Mon Oct 09, 2023 9:45 pm

Post by jb123 »

I still can't get it to work. Can you paste your exact arguments and Studio version?

I have

Code: Select all

λ xflash --version
Community_14.4.1 (build 235-acbb966, Dec-01-2019)
Copyright (C) XMOS Limited 2008-2019. All Rights Reserved.
and xTIMEcomposer says the same:

Code: Select all

Version: Community_14.4.1 (build 235-acbb966, Dec-01-2019) 
Copyright 2015 Xmos Ltd.
and I'm putting the arguments here:
2023-11-03 12_55_55-.png
2023-11-03 12_55_55-.png (3.46 KiB) Viewed 21810 times
2023-11-03 12_55_55-.png
2023-11-03 12_55_55-.png (3.46 KiB) Viewed 21810 times
2023-11-03 12_56_17-Flash Configurations.png
2023-11-03 12_56_17-Flash Configurations.png (8.69 KiB) Viewed 21810 times
2023-11-03 12_56_17-Flash Configurations.png
2023-11-03 12_56_17-Flash Configurations.png (8.69 KiB) Viewed 21810 times
Full path results in

Code: Select all

Error: F03144 Too many values supplied for option --upgrade
while .xe filename only results in

Code: Select all

Error: F03146 Input file for option --upgrade app_usb_aud_custom_208_2i2o2xxxxxx.xe not found
.


Thanks for your help.
Last edited by jb123 on Fri Nov 03, 2023 5:59 pm, edited 2 times in total.
mmar
Experienced Member
Posts: 123
Joined: Fri Jul 05, 2013 5:55 pm

Post by mmar »

You create some mistakes , cant place after upgrade 1 path to file, you learn right syntax
For bin name and folder is simpler use checkbox Output to file etc.
User avatar
jb123
Junior Member
Posts: 6
Joined: Mon Oct 09, 2023 9:45 pm

Post by jb123 »

What should the actual command be? Nothing I try works. The correct syntax is supposed to be:

Code: Select all

  --upgrade arg             Specify upgrade images;
                            arg = <version> <file> [size]
and the example in the documentation is:

Code: Select all

   xflash --upgrade 1 usb_audio.xe 0x20000 -o new_firmware.bin
Last edited by jb123 on Wed Nov 29, 2023 5:14 pm, edited 1 time in total.
Post Reply