Page 1 of 1

XFlash libcompressor time - large data array in program

Posted: Wed Sep 14, 2016 12:31 pm
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!

Re: XFlash libcompressor time - large data array in program

Posted: Wed Sep 14, 2016 1:16 pm
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.

Re: XFlash libcompressor time - large data array in program

Posted: Wed Sep 14, 2016 1:58 pm
by LumiCore
Hi Colin,

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

Thanks!

Re: XFlash libcompressor time - large data array in program

Posted: Fri Sep 08, 2017 7:35 pm
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?

Re: XFlash libcompressor time - large data array in program

Posted: Mon Sep 11, 2017 9:03 am
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

Re: XFlash libcompressor time - large data array in program

Posted: Mon Nov 09, 2020 2:32 pm
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

Re: XFlash libcompressor time - large data array in program

Posted: Mon Nov 09, 2020 3:37 pm
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.