This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Rounding error in the uflash tool? DM36x

Hi,

There is a rounding error in the uflash tool, file uflash.c.

/* Get UBL file size and round it to upper 512 byte boundary */

ubl_size = get_file_size(ubl_name);
...
ubl_size = (ubl_size + BLOCK_SIZE - 1) & ~BLOCK_SIZE;

/* Get U-boot file size and round it to upper 512 byte boundary */
uboot_size = get_file_size(uboot_name);
...
uboot_size = (uboot_size + BLOCK_SIZE - 1) & ~BLOCK_SIZE;

The correct rounding should be

ubl_size = (ubl_size + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1);

...

uboot_size = (uboot_size + BLOCK_SIZE - 1) & ~(BLOCK_SIZE - 1);

Regards,

JP