Flashing SD image to eMMC fails with I/O errors

Hi!

I was recently flashing a Debian image from https://rcn-ee.net to internal eMMC using an SD card. I was flashing 6 BeagleBone Green boards and 2 of those showed errors in the console during the process:

[ 336.911666] omap_hsmmc 481d8000.mmc: prep_slave_sg() failed
[ 336.917278] omap_hsmmc 481d8000.mmc: MMC start dma failure
473.56M 84% 9.12MB/s 0:00:08 [ 336.952874] mmcblk1: unknown error -1 sending read/write command, card status 0x900
[ 336.960803] blk_update_request: I/O error, dev mmcblk1, sector 1087424
[ 336.967438] blk_update_request: I/O error, dev mmcblk1, sector 1087432

etc …

The copying completed, the boards rebooted and I couldn’t detect any immediate problems running the mal-flashed boards. It does look rather scary, however, so I gave it a quick googling and ended up with this thread:
https://archlinuxarm.org/forum/viewtopic.php?t=9379&p=48893

Adding the line below to the beginning of “/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh” resolves the I/O error.

sysctl -w vm.min_free_kbytes=16384

Any guesses as to whether there’s an actual problem with rsync’s memory usage, causing errors in the flashing process? Would it be a good idea to update the upsream script used in rcn-ee.net?

Thanks Tarmo!

I've added the change, looks like it's booting with only 2667 kbytes..

==> sysctl: vm.min_free_kbytes=[2667]
==> sysctl: setting: [sysctl -w vm.min_free_kbytes=16384]
vm.min_free_kbytes = 16384

https://github.com/RobertCNelson/boot-scripts/commit/8257ea5800adb6cdc8d4ca3230eac44ae7c54eea

Now running on one of my very (early alpha) picky bbgw, that usually
doesn't want to flash the eMMC..

Regards,

Very Cool Tarmo!!!

That just flashed my alpha bbgw that almost never flashes. :wink:

Regards,

Great, I’m happy to hear that :slight_smile: