SD Card flashing

Follow the tutorial below based on your host system: Linux or Windows.

From Linux hosts

This section explains how you should go about formatting and flashing the SD card with the software required to use many of platforms Analog Devices supports. There are several steps that need to be completed before your SD Card will be ready to use.

Download the file

Download the relevant SD card image file from the Kuiper Linux page. Please get the latest if you can. This can be done with wget as well:

time wget \
https://swdownloads.analog.com/cse/kuiper/image_2021-07-28-ADI-Kuiper-full.zip
# --2021-12-15 17:12:33--
# http://swdownloads.analog.com/cse/image_2021-07-28-ADI-Kuiper-full.zip Resolving
# swdownloads.analog.com (swdownloads.analog.com)... 81.196.26.153, 81.196.26.177
# Connecting to swdownloads.analog.com
# (swdownloads.analog.com)|81.196.26.153|:80... connected. HTTP request sent,
# awaiting response... 200 OK Length: 15931539 (14.8 GB)
# [application/octet-stream] Saving to: 'image_2021-07-28-ADI-Kuiper-full.zip'
#
# 100%[=======================================================================>]
# 15931539 1.94M/s in 6m 52s
#
# 2021-12-15 17:19:26 (1.83 MB/s) - 'image_2021-07-28-ADI-Kuiper-full.zip' saved
# [15931539/15931539]
#
# real 6m53.573s user 0m0.740s sys 0m32.342s

Yeah, it takes an hour (or more if your connection is slow). At least you can drive down to your favourite coffee store, and indulge yourself.

Verify the download

  1. Check the md5, to make sure you have the right file.

    md5sum image_2021-07-28-ADI-Kuiper-full.zip
    # 279097240dec7156ff5e15b7ce0b8a25 image_2021-07-28-ADI-Kuiper-full.zip
    
  2. A zip file is a compressed file, you need to uncompress it, and check the md5sum on resulted file:

    time unzip image_2021-07-28-ADI-Kuiper-full.zip real
    # 1m17.40s user 74.44s sys 2.11s
    
  3. Again, check the results:

    md5sum 2021-07-28-ADI-Kuiper-full.img
    # b160453396e482234094a92134769ec6 2021-07-28-ADI-Kuiper-full.img
    

Writing SD Card GUI

Warning

This will overwrite your entire SD card completely. Backup anything from the card you want to keep.

It is recommended to use Etcher to write to your SD card but other options exist. Only the process for Etcher is covered here.

Insert your target SD card and launch Etcher. With Etcher:

  1. Select write image from file

  2. Select the .img file that you have already extracted

  3. Select the SD card that you inserted

  4. Click flash

  5. Wait for the card to be flashed and verified

../../../_images/etcher.png

At this point the SD card is still not bootable, follow the topics after Imaging your SD Card.

Writing SD Card Command Line

Warning

This will overwrite your entire SD card completely. Backup anything from the card you want to keep.

Now that everything looks OK, write the file to your SD Card.

This will depend on your system, where your SD card installed itself. You also need to do this as root, since normal users shouldn’t be able to randomly write files to block devices.

  1. plug the SD Card into your SD-Writer. If this mounts the device (which many Linux distributions do), it is important that you unmount it.

    sudo umount /dev/mmcblk0p1

  2. Write the file (input file or if) to the storage device (output file or of).

    time sudo dd \
         if=2021-07-28-ADI-Kuiper-full.img \
         of=/dev/mmcblk0 \
         bs=4194304
    # [sudo] password for user:
    # 0+60640 records in 0+60640 records out 7948206080 bytes (7.9 GB) copied, 571.766 s, 13.9 MB/s
    # real 7m54.11s user 0.29s sys 8.94s
    

    Now, you have that slice of pizza that you got too… :)

This section explains how you should go about formatting and flashing the SD card with the software required to use many of platforms Analog Devices supports. There are several steps that need to be completed before your SD Card will be ready to use.

  1. Ensure the output buffers are flushed:

    sync
    
  2. Unplug the SD card from your PC.

Verify

Since it’s possible that the write process of a disk image can have some issues (if the target had a sector marked as bad, dd will not notice, and write on top of it), the safest thing to do is to run a file system consistency check on things. If you are unsure of how to use this tool, check the man page.

Important

Most Linux kernels will need to have a physical eject between the steps above, and the steps below.

  1. Unmount the file systems (fsck will not work on a mounted file system)

    sudo umount /dev/mmcblk0p1
    sudo umount /dev/mmcblk0p2
    

    If it fails with a umount: /dev/mmcblk0p2: not mounted error, that’s OK. If it fails with a umount: /dev/mmcblk0p2: not found error, that means you have no disk inserted, or did a typo in the path.

  2. Perform the file system consistency check:

    sudo fsck -y /dev/mmcblk0p1
    # fsck from util-linux 2.20.1
    # dosfsck 3.0.13, 30 Jun 2012, FAT32, LFN
    # /dev/mmcblk0p1: 158 files, 76420/130812 clusters
    sudo fsck -y /dev/mmcblk0p2
    # fsck from util-linux 2.20.1
    # e2fsck 1.42.5 (29-Jul-2012)
    # /dev/mmcblk0p2: clean, 157918/452480 files, 717760/1808128 blocks
    

At this point the SD card is still not bootable, follow the topics after Imaging your SD Card.

From Windows hosts

This section explains how you should go about formatting and flashing the SD card with the software required to use many of platforms Analog Devices supports. There are several steps that need to be completed before your SD Card will be ready to use.

  1. Download the compressed software image file

  2. Extract the software image file

  3. Connect the SD Card to the computer

  4. Verify the software image file (Optional)

  5. Format the SD Card (Optional)

  6. Flash the SD Card

Download the SD Card File

Download the software image file you want to write onto your SD Card. Typically this is going to be the standard Kuiper Linux, but in some instances specialized pre-compiled images are created for projects that are not yet included on the standard image. So be sure you have the correct file.

  • Save the .Zip file or .Xz file to your local hard drive, and remember the file location.

Extract the Software Image File

This step will decompress the large software image file you downloaded. Ensure you have a decompression utility installed on your computer, capable of extracting .Zip file format or .Xz file format such as 7-Zip

  • Extract the software image file to a known location on your computer.

../../../_images/7zip.png

Connect the SD Card to the Computer

Connect the SD Card to either an internal or external SD Card reader which is connected to your computer. Most newer computers have an SD Card reader, but there are plenty of USB connectable SD Card reader devices available.

Verify the Download (Optional)

This step is used to validate that the image you downloaded. Ensuring that it is the version is correct and that the software wasn’t corrupted during download.

Ensure you have the following application installed on your computer: WinMD5.

  1. Open up WinMD5 application on your computer.

  2. Browse to the extracted file location.

  3. Check the m5dsum of the resulting file.

../../../_images/winmd5free.png

Format the SD Card (Optional)

This step should be used if the SD Card format is unknown or needs to be reconfigured.

Using SD Card Formatter

Ensure you have the following application installed on your computer: SD Card Formatter.

Open the SD Card Formatter application on your computer, and set the following fields:

  1. Select Card = SD Card drive you want to format (usually says “boot” or “volume”)

  2. Card Information = Make sure the disc size approximately matches your SD Card capacity

  3. Formatting Options = Select Quick Format

    ../../../_images/sd_card_formatter_gui.png
  4. Once set, click the Format button

  5. The program will notify you that the formatting is complete.(could take several minutes)

    ../../../_images/sd_card_format_success.png

Using DISKPART via Windows command prompt

Windows command prompt has DISKPART that is also capable of reformatting SD cards and other drives.

  1. Run Windows command prompt as administrator.

  2. Type list disk. All current dives will be shown.

  3. Type select disk X where X is the SD card drive number. (Do not mistake this part)

  4. Type clean to clean the drive. If an error occurs simply retry typing clean.

  5. Type create partition primary.

  6. Type format fs=FAT32. The formatting may take 45 minutes or so. FAT32 is the tested file system type.

  7. After the progress is at 100%, type assign to finalize the drive letter for Windows.

Flash the SD Card

This step will physically write the software image file onto the SD Card so it will be ready for use.

There are several Windows applications that can flash SD Cards, we will describe how to do it using two common tools. Ensure you have at least one of the following tools installed on your computer:

Win32DiskImager from Sourceforge or Etcher from Sourceforge.

Important

If you are unsure, or don’t understand these directions - STOP. If you are not careful, you could accidentally write a Linux image to your PC hard drive. Your PC will not function properly after this, and your IT department should not blame ADI.

Win32DiskImager

  1. Open up the Win32DiskImager application on your PC

    ../../../_images/sd_card_flash_gui.png
  2. Using the small folder button in the Image File section, navigate to the location of your software image file you want to flash and select it.

    ../../../_images/sd_card_flash_file_select.png
  3. Double check that the Device location in the upper-right corner, matches the SD Card drive location.

    Attention

    You DO NOT want to accidentally re-image your hard drive, so this step is critical to ensure you are flashing the SD Card and not anything else.

  4. When you are ready to flash the SD Card, click on the “Write” button.

  5. Win32DiskImager will also alert you to make sure you want to write to this drive, acting as another failsafe so that you don’t accidentally image the wrong drive.

    ../../../_images/sd_card_flash_write_confirm.png
  6. Flashing the image to the SD Card typically take 10-15 minutes, but a progress bar is provided during the process. So grab yourself a coffee.

  7. “Write Successful” will appear when the program is finished, letting you know the SD Card is ready.

    ../../../_images/sd_card_flash_success.png
  8. Exit the Win32DiskImager program, and use the Windows “safely remove hardware” function to eject the disk, before physically removing the SD card from the reader.

Etcher

  1. Open Balena Etcher and select the .img file you want to write to the SD card.

    ../../../_images/etcher_start.png ../../../_images/etcher_file_select.png
  2. Select the drive you want to write your image to.(should display as an SD Card)

    ../../../_images/etcher_disk_select.png ../../../_images/etcher_disk_selection.png
  3. Review your selections and click ‘Flash!’ to begin writing data to the SD card.

    ../../../_images/etcher_sd_card_selected.png ../../../_images/etcher_flashing_sd_card.png
  4. After flashing, Etcher will automatically validate the image flash correctly. You can either wait for this to finish or click skip.

    ../../../_images/etcher_verifying.png
  5. After the validation is complete, your SD card is finished and ready for use.

    ../../../_images/etcher_finished.png
  6. Go to the toolbar of your Windows OS, and click on “safely remove hardware”, and remove your completed SD card.