XFlash libcompressor time - large data array in program

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
LumiCore
Member++
Posts: 21
Joined: Fri Jul 01, 2016 6:36 am

XFlash libcompressor time - large data array in program

Post by LumiCore »

Hi,

We have a large data array included in our source code in a header file.
It is declared as:

uint name[]=
{
0x...,
0x...,
etc
};

The size is >100kByte.

This works and runs fast (<1minute) when building and running/debugging with the XTAG.
Now we want to flash this image onto the board with xflash. We have used --verbose to see what's going on. The lines where the libcompressor is running take forever to complete.
After half an hour we decided it was enough and terminated the process.

If we reduce the size of the array to say 100 words, xflash runs fast and smooth, and the image gets flashed onto the board. This takes 1-2 minutes to complete like we are used to.

We are building this for the USB slicekit with XU216, compiler 14.2.1.

Would anyone have a clue about where to start looking for this issue?

Thanks!


colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Post by colin »

Hi LumiCore

It sounds like the compression algorithm is failing to compress the large array correctly. Can you share the data that the array contains? This is something we can investigate in the tools and try to have fixed in a future release. In the meantime you can use the --no-compression flag with xflash to disable the compression step and get you past this issue.

Colin.
LumiCore
Member++
Posts: 21
Joined: Fri Jul 01, 2016 6:36 am

Post by LumiCore »

Hi Colin,

The flag did the short term trick! The data is sent to you for your reference.

Thanks!
RitchRock
XCore Addict
Posts: 186
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Sorry to resurrect an old thread, however I'm having this exact same problem w/ 14.2.4 on the xCORE-200 MC-Audio development board. My project is a modified version of the reference application, but now has large header files containing filter coefficients. xflash with --verbose shows libcomrpessor taking a very, very long time.

Adding the --no-compression flag enables flash programming as expected. What is the ramification, if any, of not compressing binary data?
colin
Experienced Member
Posts: 74
Joined: Mon Dec 16, 2013 12:14 pm

Post by colin »

The only ramification is that your flash image will occupy more space in flash memory and therefore you can not fit as many images into flash. Depending on the size of your image and the amount of compression you might have attained, your boot time may be marginally faster or slower (time to read from flash vs time to decompress).

Colin
User avatar
fabriceo
XCore Addict
Posts: 181
Joined: Mon Jan 08, 2018 4:14 pm

Post by fabriceo »

resurrecting again, "the only ramification..." is that if your image is uncompressed, there are chances that its size will be over your FLASH_MAX_UPGRADE_SIZE parameter, or boot partition, therefore the product cannot be upgraded anymore...
see an experience here :
viewtopic.php?f=26&t=8016
User avatar
akp
XCore Expert
Posts: 578
Joined: Thu Nov 26, 2015 11:47 pm

Post by akp »

Quick question -- how long did you wait for the compression to finish? I've waited over an hour and it eventually succeeded. I think from now on I will start it before I head to bed at night.
Post Reply