I’ve got a Raspberry Pi that has been malfunctioning and I’d like to try and debug it on my OSX laptop to try and determine whether the problem is related to the hardware, SD card or software.
I've taken the SD card from the pi and mounted it on my OSX machine, and have copied the files kernel7.img and bcm2709-rpi-2-b.dtb from the /boot partition to the OSX hard drive.
I’ve then unmounted the boot and RECOVERY partitions and then tried starting the emulator with:
sudo qemu-system-arm \
-machine raspi2 \
-no-reboot \
-dtb ./bcm2709-rpi-2-b.dtb \
-kernel ./kernel7.img \
-drive file=/dev/disk2,format=raw
This gives me the output:
**qemu-system-arm: Invalid SD card size: 29.7 GiB SD card size has to be a power of 2, e.g. 32 GiB. You can resize disk images with 'qemu-img resize <imagefile> <new-size>' (note that this will lose data if you make the image smaller than it currently is).**
Is there any way I can get around this?