Preparing SD card to Flash Raspberry PI-5 with Android-15
This article explains all the steps for SD Card recovery and preparing it for flashing. These steps are common and not specific to only Raspberry for SD card recovery we can use it for any other task too.
I have been working on Android 15, building AOSP source code and preparing a Raspberry Pi image for flashing. During this process, I encountered some issues while flashing the Pi board. To help others avoid the same problems, I documented the steps needed to prepare an SD card for the setup.
If you face errors while making the SD card bootable, or if your card gets corrupted like mine did, you’ll need to recover it first. I’ll start by explaining how to retrieve an SD card and then move on to making it bootable.
I am using Ubuntu on my PC, so the instructions will primarily apply to Ubuntu users. However, I will also include information about tools available for Windows to perform similar tasks.
Recover the SD card:
Install “gparted” on your PC, GParted is a free and powerful partition editor for managing disk partitions, including formatting, resizing, and recovering storage devices like SD cards.
sudo apt-get install gparted
Start GParted →
sudo gparted
It will look like this →
You’ll find an option to select your SD card in the top-right corner. Be cautious and ensure you are working on the correct storage device.
To delete partitions, right-click on any partition. If the “Delete” option is greyed out, unmount the partition first. Once unmounted, proceed to delete it.
After deleting all partitions, click the green checkmark icon in the toolbar to apply the changes.
Now, the SD card space is unallocated, and you can format it to the desired file system.
Right-click the unallocated space, select “New,” and the following dialogue box will appear.
Select the details according to your requirement, for Raspberry PI flashing use the Fat32 file format.
After selecting all options click Add and apply the changes again.
Finally, our SD Card is ready to make it Bootable.
Make SD Card Bootable
If you’re planning to flash Android 15 and already have the Raspberry Pi Android 15 image ready, the next step is to use tools like Raspberry Pi Imager or Etcher.
I recommend Raspberry Pi Imager as it’s the official tool and provides clear error messages if flashing fails. In contrast, Etcher may show a successful flash, but the device might not boot, leading to issues later.
Download Raspberry Pi Imager and install it on your PC to proceed.
https://www.raspberrypi.com/software/
Open Imager →
Choose Device, OS, and Storage appropriately, As I am flashing Android-15 I will use the custom AOSP Build system image.
Option: Raspberry PI 5 selected →
Option Use Custom Selected →
I have selected the Raspberry PI AOSP15 AOSP to build an image for flashing and chose storage as an SD card.
Click Next →
If you want to edit settings and enter some settings please do that this option is not available with Etcher.
Click Yes and proceed →
Click Yes and Proceed.
Imager has started writing the Android OS to SD card this will take a while.
It will verify and show the final dialogue on the SD card bootable.
Wait for verification for a while.
Now SD card is ready to flash you can insert it into the Raspberry PI 5 board and supply power.
Key Points Captured
While Preparing the AD card I encountered a few errors and, a few points I would like to add.
I formatted the SD card to ext4 which did not work for me you can try it if it works let me know as far as I know, Raspberry PI requires Fat32 file format to flash.
After falling with some general errors you may see objections of the SD card size greater than 32GB required exfat File format. It was not a problem because, verifying this I tried this with 16 GB, 32 GB and 64 GB SD cards and all were fine.
I encountered the below error →
This was neither an SD card issue nor a file Format issue It was the RaspberryPIAOSP-15 Image issue so please look for the correct OS image generations.
Tools for Windows OS are disk management build-in options, Erase US tool is a replacement for gparted and Imager and Etcher are available for Windows.
Thanks for Reading!
Please comment with questions and suggestions!! If this blog is helpful for you then hit Please hit the clap! Follow on Medium, Connect on LinkedIn, Follow on Insta and send emails if any discussion is needed on the same topic on copy email.
Thank you!