TriForceX / MiyooCFW

Custom firmware source code and resources for BittBoy, PocketGo, PowKiddy V90-Q90-Q20 and third party handheld consoles
GNU General Public License v2.0
1.1k stars 112 forks source link

Flashing on Mac Instructions don't work #315

Closed kerberw closed 2 years ago

kerberw commented 2 years ago

I tried following the Flashing on Mac Instructions.

Tried it 2 times, ended up with a card that just black screened on powkiddy v90. The resulting card wouldn't even mount on the Mac either. Same card worked on PC with the same instructions.

Tried on MacBook Air M1 and MacBook Pro Intel, both running 12.2.1

Thanks!

Rezzy-dev commented 2 years ago

Did you successfully unmount the card in step 3 before writing the disk image to the card?

Make sure that neither the SD card nor the disk image are mounted while you are writing/flashing to the card.

(In any case, if you have access to a Windows or Linux PC, it's a lot faster and much less troublesome to flash the card there.)

kerberw commented 2 years ago

Yes I did unmount the disk before. It showed as unmounted in disk utility.

Also, I do have windows access, although I use a Mac mainly. It works as described on Windows, was hoping to make you aware of the issues on Mac and I am available to troubleshoot to help fix the instructions for those who don't have access to windows or linux.

Rezzy-dev commented 2 years ago

Glad to hear that, @kerberw, and I'm happy to work through this with you, and see if we can find out what the problem is. I suspect it has something to do with the changes Apple has been making to the way it handles non-Apple volumes lately. They seem to be targeting Windows technologies in particular (FAT32 is a Microsoft-created standard/format).

There is a bit of corporate warfare going on behind the scenes, and Apple hasn't been playing the game clean lately.

But these are just my suspicions, based on the evidence I've been presented with.

I don't have a Mac computer anymore, but I have a Linux laptop (practically also Unix-based), so together maybe we can figure what is going on with Macs.

Rezzy-dev commented 2 years ago

The other thing I can think of -- although I doubt that is the issue -- is to make sure that you erase all volumes from the SD card before you unmount and flash it.

Rezzy-dev commented 2 years ago

What happens if you add "bs=512" to the end of the "dd" command as you flash the card?

sudo dd if="IMAGE.img" of="/dev/DISK" bs=512

(Substitute IMAGE and DISK with the path to the disk image and the device name of the SD card you're flashing to, of course -- which you can double-check in Disk Utility.)

"bs" stands for block size. This will specifically tell dd to use the default block size for writing the image to the SD card. (In case Apple has changed something in how dd operates normally.)

kerberw commented 2 years ago

The other thing I can think of -- although I doubt that is the issue -- is to make sure that you erase all volumes from the SD card before you unmount and flash it.

So I am trying to erase the volume and reformat it to FAT in disk utility first, then the stock commands I will let you know as soon as that is done.

Update: That didn't help same issue, black screen no boot, disk was unmountable on Mac as well.

kerberw commented 2 years ago

What happens if you add "bs=512" to the end of the "dd" command as you flash the card?

sudo dd if="IMAGE.img" of="/dev/DISK" bs=512

(Substitute IMAGE and DISK with the path to the disk image and the device name of the SD card you're flashing to, of course -- which you can double-check in Disk Utility.)

"bs" stands for block size. This will specifically tell dd to use the default block size for writing the image to the SD card. (In case Apple has changed something in how dd operates normally.)

Trying this now. Will update when done.

Update: Same issue no change, no mounting on the Mac and same black screen on v90

Rezzy-dev commented 2 years ago

Update: Same issue no change, no mounting on the Mac and same black screen on v90

Very strange... :/

Hmm...

(At this point I'm out of ideas. I'll have to think about it...)

Rezzy-dev commented 2 years ago

When you check the flashed SD card in Disk Utility (after you eject it and insert it again), what volumes does Disk Utility show on the card?

Also, can you paste here the results of diskutil list in Terminal with the SD card inserted?

That may tell us what dd has actually done with the SD card, and may give us a clue as to why things are not working.

Rezzy-dev commented 2 years ago

Update: That didn't help same issue, black screen no boot, disk was unmountable on Mac as well.

The SD card was unmountable on the Mac?? o.O

Rezzy-dev commented 2 years ago

Can you paste me here all the steps you're taking and commands you're entering into Terminal as you flash the SD card? I just want to make sure that you're following all the steps correctly.

It's very unusual how it's still not working, and especially how the card won't mount on the Mac after flashing. I'm starting to wonder if it may be a hardware problem with your Mac (with the SD card reader/writer, or its driver).

Asppire commented 2 years ago

I tried following the Flashing on Mac Instructions.

See my post in the discussion forum for an easier way:

https://github.com/TriForceX/MiyooCFW/discussions/223#discussioncomment-2211901

Rezzy-dev commented 2 years ago

See my post in the discussion forum for an easier way: https://github.com/TriForceX/MiyooCFW/discussions/223#discussioncomment-2211901

Be VERY careful with ApplePi-Baker! It's not a supported method here, because ApplePi-Baker is a rather hacky homebrew application that can mess up your system with just a few clicks if you're not careful!

kerberw commented 2 years ago

When you check the flashed SD card in Disk Utility (after you eject it and insert it again), what volumes does Disk Utility show on the card?

Also, can you paste here the results of diskutil list in Terminal with the SD card inserted?

`/dev/disk4 (external, physical):

: TYPE NAME SIZE IDENTIFIER

0: FDisk_partition_scheme *128.2 GB disk4 1: DOS_FAT_32 ⁨⁩ 128.2 GB disk4s1`

That may tell us what dd has actually done with the SD card, and may give us a clue as to why things are not working.

Update: That didn't help same issue, black screen no boot, disk was unmountable on Mac as well.

The SD card was unmountable on the Mac?? o.O

Yeah so the disk was totally unmountable on the Mac and PC says it needs to be initialized when plugged in.

kerberw commented 2 years ago

Can you paste me here all the steps you're taking and commands you're entering into Terminal as you flash the SD card? I just want to make sure that you're following all the steps correctly.

It's very unusual how it's still not working, and especially how the card won't mount on the Mac after flashing. I'm starting to wonder if it may be a hardware problem with your Mac (with the SD card reader/writer, or its driver).

Insert SD card, open disk utility, click erase, name the disk and format as "MS-DOS (FAT)" Get disk info from the device property in disk utility. Unmount w/: diskutil unmountDisk "/dev/disk4s1" Downloaded CFW and unzipped where downloaded. Command points to right download path and disk. Flash w/: sudo dd if="~/Downloads/Powkiddy-V90-Q90_CFW_v1.3.3_04_10_20.img" of=/dev/disk4s1

Repeated all steps and at this step I also tried w/ (bs=512): sudo dd if="/Users/williamkerber/Downloads/Powkiddy-V90-Q90_CFW_v1.3.3_04_10_20.img" of=/dev/disk4s1 bs=512

The output of this: 7815168+0 records in 7815168+0 records out 4001366016 bytes transferred in 1603.007021 secs (2496163 bytes/sec)

Test drive in device, black screen. try device in Mac and PC get a warning to initialize/format respectively.

kerberw commented 2 years ago

Can you paste me here all the steps you're taking and commands you're entering into Terminal as you flash the SD card? I just want to make sure that you're following all the steps correctly.

It's very unusual how it's still not working, and especially how the card won't mount on the Mac after flashing. I'm starting to wonder if it may be a hardware problem with your Mac (with the SD card reader/writer, or its driver).

I tried on 2 different Macs, one an M1 and one an Intel. Same problem on both! Running latest public release: 12.2.1 Same card, same download, same reader all work on PC.

jSTE0 commented 2 years ago

Flash w/: sudo dd if="~/Downloads/Powkiddy-V90-Q90_CFW_v1.3.3_04_10_20.img" of=/dev/disk4s1

I think that's the wrong device. I don't have a Mac but that looks like disk 4 partition 1 to me which means the image ended up inside the FAT partition, which is why it ends up unmountable in any OS. Based on instructions from https://osxdaily.com/2018/04/18/write-image-file-sd-card-dd-command-line/ I think it should be:

sudo dd if="~/Downloads/Powkiddy-V90-Q90_CFW_v1.3.3_04_10_20.img" of=/dev/rdisk4

so that the entire drive is overwritten as the image includes its own partition table and the separate partitions for boot, root and main.

kerberw commented 2 years ago

PEBKAC? So in my case it would be sudo dd if="~/Downloads/Powkiddy-V90-Q90_CFW_v1.3.3_04_10_20.img" of=/dev/disk4 instead of disk4s1 ?

Thanks for seeing this, I used the identifier in disk utility once unmounted.

jSTE0 commented 2 years ago

No, of=/dev/rdisk4, note the r for raw disk. I wouldn't call it PEBKAC, the instructions in the wiki are, in hindsight, a little vague if you're not familiar with partitions vs whole disks. It wasn't until I saw of=/dev/disk4s1 that I thought "that doesn't look right". The equivalent in Linux would be /dev/sdc4 for the 4th partition of the 3rd SCSI/SATA/PATA/USB disk compared to /dev/sdc for the whole of the 3rd disk itself. Do double-check that the rdiskNUMBER is correct though.

Rezzy-dev commented 2 years ago

Correct. Either "disk#" or "rdisk#" are fine, but NOT "disk#s#", seeing as the "s" number stands for sector number (meaning the physical partition/volume on the disk). It's a strange labelling system that Mac OS uses, but that's how it works.

You need to write/flash to the disk directly, NOT to a sector/partition on the disk.

I will update the documentation to better reflect/detail this unusual labelling system in Mac OS.

As for the unusual preceding "r", here is the explanation behind it:

Using Mac OS X

Note: In OS X each disk may have two path references in /dev: /dev/disk# is a buffered device, which means any data being sent undergoes extra processing. /dev/rdisk# is a raw path, which is much faster, and perfectly OK when using the dd program. On a Class 4 SD card the difference was around 20 times faster using the rdisk path.

So either "disk#" or "rdisk#" are fine using dd on Mac OS, but "rdisk#" tends to work faster.

Rezzy-dev commented 2 years ago

Documentation updated:

Note: The disk# does not include the s# following it! The s# stands for sector (partition/volume) number in Mac OS. You need to write to the disk directly, not to a partition on the disk. If you write to a partition on the disk, you will need to re-flash, as the flashed SD card will not work/mount.

https://github.com/TriForceX/MiyooCFW/wiki/Custom-Firmware-Setup

kerberw commented 2 years ago

I tried this with the updated help, and yea! It worked! I will close this, thanks for helping me resolve it!

Rezzy-dev commented 2 years ago

Thanks to you, @kerberw, for your brave openness, team spirit, and persistence, and to @jSTE0, who chipped in with a bit of very useful insight even I was not aware of! :+1: ^_^ <3

Glad to know that the Mac process/documentation will be much clearer to follow from now on, and that the process still works. This was a great team effort! *^_^* <3