Need Instructions for Mac OS

I have Mac OS and all the instructions for creating a bootable card appear to be for either Linux or for Windows.

My ultimate goal is to get my Khadas VIM booting into Ubuntu but I have tried for many hours and still cannot get to work. I am unsure if I 1) am not creating the TF card correctly, or 2) if something is wrong with my Khadas VIM. It used to boot Android until I erase EMMC using Key Mode: http://docs.khadas.com/develop/HowtoEraseEMMC/

I am stuck. I really want to get my Khadas VIM working but right now nothing I try seems promising. Help!

Mac OS also support the ‘dd’ CLI one, just take a reference with Linux instructions.

That is what I have been trying for many hours. Here is what I have been trying:

1.) With DiskUtil UI, format:

MS-DOS (FAT)/Master Boot Record

2.) Then in terminal:

sudo diskutil unmount /dev/disk6s1  && sync
sudo dd if=u-boot.bin.sd.bin of=/dev/disk6s1  bs=1 count=444 && sync	
sudo dd if=u-boot.bin.sd.bin of=/dev/disk6s1  bs=512 seek=1 skip=1 && sync
sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_20170118.img of=/dev/disk6 bs=4m && sync

When I insert card into Khada VIM after this, nothing.

The above is after much trial and error, and you will note it is not exactly the same as Linux instructions. But it still does not work.

In our instructions here:

  • dd Armbian images first
  • then dd u-boot

please follow the steps one by one and try again. and take note that your SD card should be format as FAT32 first.

If your problems haven’t got fixed, please post all the steps and printings on your terminal to us, we can help to locate the issues.

Those are the instructions I have been (trying to) follow. But I don’t fully understand what they (are meant to) do so it is easy for me to do the wrong thing.

That is the first problem; I do not know for sure the right way to do this on Mac OS because your Linux instructions do not work for Mac.

When I run:

sudo fdisk /dev/disk6

This is what I get:

Disk: /dev/disk6	geometry: 968/255/63 [15564800 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0E   16   0   1 - 1023   3  32 [      2048 -     131072] DOS FAT-16
 2: 83 1023   3  32 - 1023   3  32 [    133120 -    3256320] Linux files*
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused

So I try to run this:

sudo fdisk -i -a dos /dev/disk6

And I get:

fdisk: /dev/disk6: Resource busy

So I try:

sudo diskutil eraseDisk FAT32 BOOT /dev/disk6

Now sudo fdisk /dev/disk6 gives me:

Disk: /dev/disk6	geometry: 968/255/63 [15564800 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: 0B 1023 254  63 - 1023 254  63 [    411648 -   15151104] Win95 FAT-32
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused

But that is multiple sectors so I think it is wrong?

So I try the Disk Utility.app and in the UI I format as MS-DOS (FAT)/Master Boot Record. Now sudo fdisk /dev/disk6 gives me:

Disk: /dev/disk6	geometry: 968/255/63 [15564800 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: 0B 1023 254  63 - 1023 254  63 [         2 -   15564798] Win95 FAT-32
 2: 00    0   0   0 -    0   0   0 [         0 -          0] unused
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused

Which looks like it may be correct? But I don’t know, because if I do this first step wrong I assume it won’t work no matter what I do after, correct?

So which of the above is how I should “Format the TF Card as Fat32?” from your instructions?

Also, if I first try to run these commands:

sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_20170118.img of=/dev/disk6 bs=4m && sync

Or:

sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_20170118.img of=/dev/disk6s1 bs=4m && sync

I get:

dd: /dev/disk6: Resource busy

Or

dd: /dev/disk6s1: Resource busy

Paste what run on my MacBook for your reference:

Tibet:~ gouwa$ sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_desktop_20161223.img of=/dev/disk2 bs=4m
dd: /dev/disk2: Resource busy
Tibet:~ gouwa$ sudo diskutil umount /dev/disk2
disk2 was already unmounted or it has a partitioning scheme so use "diskutil unmountDisk" instead
Tibet:~ gouwa$ sudo diskutil umountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
Tibet:~ gouwa$ sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_desktop_20161223.img of=/dev/disk2 bs=4m
848+1 records in
848+1 records out
3558866944 bytes transferred in 440.847308 secs (8072788 bytes/sec)
Tibet:~ gouwa$ sync

This was helpful. Thank you.

1.) How long should this command take? It seems like it is just locked up. Is there any way to tell if it is working? It responds to [Enter] and echos a new line while, as it is waiting for more input or something.

2.) Is Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_desktop_20161223.img okay to use instead?

Around 20 mins here, as the images is larger than 3GB.

Wait a moment, I will upload a new u-boot, and post all the commands run on my MacBook.

Yes, can boot here now.

Thank you so much! We want to use this as a base of a product we will sell if we can just get a prototype working. I am so anxious for some success. We have been looking for the right SBC for our product for 4 months now and we hope Khadas VIM is it…

  1. Please visit Firmware page to get the latest boot loader (u-boot)
  2. Commands below are run on my Macbook, and test fine here, for your reference(I’m not quite familiar with MacOS, there may have better way to done that):
Tibet:~ gouwa$ sudo diskutil eraseDisk FAT32 BOOT /dev/disk2
Started erase on disk2
Unmounting disk
Creating the partition map
Waiting for the disks to reappear
Formatting disk2s2 as MS-DOS (FAT32) with name BOOT
512 bytes per physical sector
/dev/rdisk2s2: 15080656 sectors in 1885082 FAT32 clusters (4096 bytes/cluster)
bps=512 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=411648 drv=0x80 bsec=15110144 bspf=14728 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk2
Tibet:~ gouwa$ sudo fdisk /dev/disk2
Disk: /dev/disk2	geometry: 966/255/63 [15523840 sectors]
Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639] <Unknown ID>
 2: 0B 1023 254  63 - 1023 254  63 [    411648 -   15110144] Win95 FAT-32
 3: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused      
Tibet:~ gouwa$ sudo diskutil umountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
Tibet:~ gouwa$ sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_desktop_20161223.img of=/dev/disk2 bs=4m
848+1 records in
848+1 records out
3558866944 bytes transferred in 440.847308 secs (8072788 bytes/sec)
Tibet:~ gouwa$ sync
Tibet:~ gouwa$ sudo diskutil umountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
Tibet:~ gouwa$ sudo dd if=u-boot.bin.sd.bin of=/dev/disk2 bs=1 count=444 && sync
444+0 records in
444+0 records out
444 bytes transferred in 0.002681 secs (165609 bytes/sec)
Tibet:~ gouwa$ sudo diskutil umountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
Tibet:~ gouwa$ sudo dd if=u-boot.bin.sd.bin of=/dev/disk2 bs=512 skip=1 seek=1 && sync
1760+0 records in
1760+0 records out
901120 bytes transferred in 0.876664 secs (1027897 bytes/sec)
Tibet:~ gouwa$ sudo diskutil umountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
Tibet:~ gouwa$ 

BTW, if this reply solve your problem, kindly follow the Problem Solved Button to mart it as solved.

Good luck!

Okay, I am getting some success! This is what I ran:

sudo diskutil umountDisk /dev/disk6  && sync
sudo dd if=Armbian_5.24_Amlogic-s905x_Ubuntu_xenial_3.14.29_20170118.img of=/dev/disk6 bs=4m && sync
sudo dd if=u-boot.bin.sd.bin of=/dev/disk6 bs=1 count=444 && sync	
sudo dd if=u-boot.bin.sd.bin of=/dev/disk6 bs=512 seek=1 skip=1 && sync

It booted until it gave:

CONFIG-ERROR) dhd_conf_set_fw_string_struct_cmd: country setting failed -2

Then it gave a login prompt. I entered root and 1234 and then it asked me to change password. I changed password and it output:

Authentication token manipulation error

Seems like read-only file system? But their solution can’t work if I am not logged in.

And then returned me back to login.

So two steps forward and one step back. Ideas?

I guess you forget to type the current passwd again:

Nope. That was not it. It does not give me a chance to enter it twice.

Sorry. Nevermind (doh!)

To my credit, the HDMI output is cutting off 1 left column and 1/2 last row so it is hard to see.

So, you’ve success, right?

Yes, this version ROM is not quite friendly yet. We will release new ROM in these days.

THANK YOU, THANK YOU, THANK YOU.

I have enough success to move forward to try to get our software installed on the SD card now. I am sure I will have other questions when I want to write to EMMC but I will wait for your new ROM version.

Thanks again.

Ok, I edit the ‘solution’ in post #12.