This error appears while using quartus_hps to program the flash. In case if the flash device has bad sectors, the quartus_hps wouldn't be able to deal with these bad sectors. The quartus_hps will copy files but some of them might get corrupted. This gives the following error:
jiffs2: mtd->read,0x.. Bytes from 0x…… returned ECC error
To overcome this error, use the DS-5 debugger and U-Boot to program the flash on an Arria 10 board.
Click here to get the correct procedure to program flash device via alternatives ways.