pretzel11
Posts: 4
Joined: Thu Aug 16, 2018 9:17 pm

Re-flashing Compute Module 3

Thu Aug 16, 2018 9:35 pm

I am able to flash the 4GB eMMC on a CM3 with Raspbian stretch lite if the CM3 is fresh out of the box, but I'm having issues re-flashing an image or even erasing the flash.

Process that I'm using:
Using a Compute Module IO Board and usbboot..

Code: Select all

sudo ./rpiboot

sudo dd if=<raw image>.img of=/dev/sdX bs=4MiB
444+0 records in
444+0 records out
1862270976 bytes (1.9 GB, 1.7 GiB) copied, 403.092 s, 4.6 MB/s

This works great the first time, but if I try to repeat the process after modifying the image, dd completes much more quickly and does not seem to actually write anything (note 4.6MB/s vs 831MB/s).

444+0 records in
444+0 records out
1862270976 bytes (1.9 GB, 1.7 GiB) copied, 2.24096 s, 831 MB/s

Is there a better approach to re-flashing or erasing a CM3 in order to load a new image?

Thanks!

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1335
Joined: Sat Sep 10, 2011 11:43 am

Re: Re-flashing Compute Module 3

Fri Aug 17, 2018 8:42 am

What version of rpiboot are you using? Are you using a Raspberry Pi to program the compute module?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

pretzel11
Posts: 4
Joined: Thu Aug 16, 2018 9:17 pm

Re: Re-flashing Compute Module 3

Fri Aug 17, 2018 2:11 pm

Hi Gordon,
Thanks for the quick reply. I cloned the latest usbboot from GitHub a week ago per the instuctions at https://www.raspberrypi.org/documentati ... lashing.md

I don't see a version option on the rpiboot utility itself.

I am using an Ubuntu 16.04 VM VirtualBox running on a Windows 10 host to program the compute module.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1335
Joined: Sat Sep 10, 2011 11:43 am

Re: Re-flashing Compute Module 3

Fri Aug 17, 2018 3:34 pm

What about if you use the rpiboot installer on Windows 10?

https://github.com/raspberrypi/usbboot/ ... _setup.exe

Does it have the same effect?
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

pretzel11
Posts: 4
Joined: Thu Aug 16, 2018 9:17 pm

Re: Re-flashing Compute Module 3

Sat Aug 18, 2018 12:06 am

Mixed results in Windows. rpiboot.exe runs, finds the Compute Module, executes some commands and exits. Then the compute module shows up as USB Drive (E:). So far, the same as my Ubuntu VM setup.

When I try to write the image with Win32 Disk Imager I get
"An error occurred when attempting to write data to handle. Error 5: Access is denied."
I have tried with and without running as administrator.

Interestingly, Etcher seems to work just fine...

After Etcher worked, I tried with my Ubuntu VM again. Still, the rpiboot step works fine. The first attempt at 'dd' did the same quick load at ~1GB/s. I tried 'dd' a second time without unplugging anything and it took a more appropriate amount of time (~4.5MB/s). It seems like the image loaded fine this time with 'dd', but I'm having issues getting the network running, so I don't have a lot of confidence that it worked cleanly. That could certainly be a problem on my end, but I would feel better if I could fully erase the flash with 'dd' (or any Unix command) and then write the image.

Any ideas on what the issue could be with 'dd' (or Win32 Disk Imager for that matter)? Or what Etcher is doing that's so magical?

voycel
Posts: 1
Joined: Tue Sep 04, 2018 2:28 pm

Re: Re-flashing Compute Module 3

Tue Sep 04, 2018 2:37 pm

Hi,

Just add oflag=dsync to your dd command and it will show speed as it should or use full command below to see the progress too:

pv -tpreb /image_file.img | dd of=/dev/sdX bs=4M oflag=dsync conv=notrunc,noerror

to use pv you will need to install it first : sudo apt-get install pv

Hope it helps

Return to “Compute Module”