Bug in Xflash for upgrades?

Technical questions regarding the XTC tools and programming with XMOS.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Bug in Xflash for upgrades?

Post by kster59 »

According to the manual, if you specify -o with xflash then the device will generate an output binary.

so:
xflash --spi-div 2 --upgrade 1 maint.xe -o output.bin

should generate the output.bin file without writing anything to flash.

However, I found that the device itself must be connected to the programmer otherwise xflash doesn't make output.bin.

The simple workaround is just to connect the device whenever you want to generate the flash file but this is certainly not the intended behavior.

Please let me know if I am missing anything...


User avatar
segher
XCore Expert
Posts: 844
Joined: Sun Jul 11, 2010 1:31 am

Post by segher »

You might want the --dump-image option? Works fine here without device connected.
The output is bit-reversed (per byte) of course.


Segher
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

--dumpimage is removed from 10.4

I think that only works with 9.9.2

So the bug is in 10.4 and not 9.9.2
m_y
Experienced Member
Posts: 69
Joined: Mon May 17, 2010 10:19 am

Post by m_y »

In order to produce exactly the same output to file as it would have written to a flash, xflash attempts to connect to a target in order to query the SPI device. You can suppress this with "--noinq" at the cost of xflash not being able to determine the sector layout. For a single upgrade image the sector size doesn't matter so you can ignore the warning.

IIRC "--noinq" is missing from the help message. This omission is a bug and the option will be listed in future releases.
kster59
XCore Addict
Posts: 162
Joined: Thu Dec 31, 2009 8:51 am

Post by kster59 »

Isn't the sector layout specific to the flash device which is in the .xn file?

I will just leave it as is connected to the device for now to ensure it is programmed correctly.

Also, is there an option to order XMOS chips preprogrammed? I've made my PCB with holes that fit an XTAG2 20pin .100" header and use a spring loaded pogo adapter to program without having to install the connector but as I move to higher volumes of 3k-10k it will become a pain.
m_y
Experienced Member
Posts: 69
Joined: Mon May 17, 2010 10:19 am

Post by m_y »

kster59 wrote:Isn't the sector layout specific to the flash device which is in the .xn file?
The XN file describes how the device is attached and how it should be used to boot but the field for type is just a textual note. It is libflash which identifies a flash and this needs to run in order to work.