Flashing firmware on a Mac for LibreDrive

The place to discuss Mac OS X version of MakeMKV
MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Sun Sep 17, 2023 5:36 am

garygomm wrote:
Thu Sep 10, 2020 2:07 pm
Steps taken
1. download sdf.bin
2. download mk-firmware-pack-YYYYMMDD
- where YYYYMMD is the date of the latest firmware pack

3. Extract the file you need for your drive from mk-firmware-pack-YYYYMMDD -> In my case this was -> HL-DT-ST-BD-RE_BU40N-1.04-NM00500-212005061142.bin

4. then in terminal on the MacBook
- I then copied sdf.bin and the firmware file I extracted from the mk-firmware-pack-YYYYMMDD into my /tmp folder .
(this only to make sure both files in same place and nice easy path to type).


5. then in terminal change directory - > cd /Applications/MakeMKV.app/MacOS/Contents

6. type -> ls - al

you should see a directory listing and one of the objects in the listing is 'makemkvcon'
this step just confirms you are in the right directory


7. the type -> ./makemkvcon f -l

This will allow you to find your drive identifier, in my case -> ''/IOBDServices/D5D25996'
from the following output:
Found 1 drives(s)
00: /IOBDServices/D5D25996, /dev/rdisk3, /dev/rdisk3
HL-DT-ST_BD-RE_BU40N_1.01_211910161032_MOFK6283224


8. to actually perform the update, type -> ./makemkvcon f -d '/IOBDServices/D5D25996' -f /tmp/sdf.bin rawflash main -i /tmp/HL-DT-ST-BD-RE_BU40N-1.04-NM00500-212005061142.bin

you will then be prompted to type in 'yes' to flash the firmware;

Reading input file /tmp/HL-DT-ST-BD-RE_BU40N-1.04-NM00500-212005061142.bin
Flashing flags = 0x0 : 0 0 0 0 : ---- ---- ---- ----
Current Drive ID: HL-DT-ST_BD-RE_BU40N_1.01_211910161032_MOFK6283224
Ready to write drive flash memory.
Type "yes" to continue, "no" to abort
yes

9. Once you type in yes and hit Enter - you should get the following output:

Operation started: Sending flash image to drive
100% Operation finished
Operation started: Programming flash
100% Operation finished
Done successfully

After hitting Enter the upload and flashing took about 20 seconds.
Will you update this to use the included sdftool binary? I believe the sdf.bin image is not necessary when using the sdftool binary. I have tried all syntax possible according to sdftool —help. The error is unknown command. I copied and pasted the /io… designation for the drive and of course included the path to the firmware image both parts surrounded by apostrophe characters [some call them single quotations] just in case. No matter how I format the line I cannot make the syntax accepted. Of course I am using version 1.17.4 of MakeMKV. I am using the release candidate of Mac OS version 14.

dcoke22
Posts: 3049
Joined: Wed Jul 22, 2020 11:25 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by dcoke22 » Sun Sep 17, 2023 2:28 pm

MKV Maker wrote:
Sun Sep 17, 2023 5:36 am
Will you update this to use the included sdftool binary? I believe the sdf.bin image is not necessary when using the sdftool binary. I have tried all syntax possible according to sdftool —help. The error is unknown command. I copied and pasted the /io… designation for the drive and of course included the path to the firmware image both parts surrounded by apostrophe characters [some call them single quotations] just in case. No matter how I format the line I cannot make the syntax accepted. Of course I am using version 1.17.4 of MakeMKV. I am using the release candidate of Mac OS version 14.
I think you're talking about

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/sdftool
It looks like

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/sdftool -l
will print out the available drives.

On my system, I get this output:

Code: Select all

user@machine ~ % /Applications/MakeMKV.app/Contents/MacOS/sdftool -l
Found 3 drives(s)
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
00: /IOBDServices/1E20D1E6
  PIONEER_BD-RW___BDR-212U_1.01_AGDL002389WL

DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
01: /IOBDServices/0DF09974
  ASUS_BW-16D1HT_3.10_211901041014_KLPJ65B3554

DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
02: /IOBDServices/1A4C5045
  HL-DT-ST_BD-RE__WH16NS60_1.02_211810291936_KLHJ9P70118
-d is used to specify the drive, so this command lists the available commands for one of my drives.

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/sdftool -d /IOBDServices/0DF09974 help
which produces this output:

Code: Select all

DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149

MTK19xx firmware module v1.30

Commands:

  dump [auto|full|user]
  Dumps firmware image
    dump full      - dumps full rom image (if not disabled in firmware)
    dump user      - dumps non-volatile user data
    dump auto      - dumps full image if possible, user data otherwise

  rawflash [<flag>,<flag=value>,...]
    Sends the image and flashing flags to drive
    for flashing in self-update mode
  flags:
    main           - flashes main firmware (this is the default)
    full           - flashes boot loader and main firmware (Caution!!!)
    de             - sets DE byte in image
    enc            - encrypts firmware before sending to drive
    slim           - force USB slim drive handshake
I think the command to actually flash a drive would be:

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/sdftool -d /IOBDServices/0DF09974 rawflash main -i <path to flash binary>
Substitute the actual path to the file you're trying to flash of course. And if it has to be encrypted, use 'enc' instead of 'main'.
I haven't actually tried this, since I don't need/want to flash my drive.

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Sun Sep 17, 2023 5:58 pm

Interesting. I set the working directory to that directory and used ./sdftool instead of using the entire path every time. Also, the --help general command mentions flash not rawflash. That seems to be the only difference amongst yours and my syntax. I will try rawflash although it is not mentioned in the general help.

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Sun Sep 17, 2023 6:25 pm

Yes, rawflash worked for both drives instead of flash. Thanks for the clarification. If ever you use the binary then I definitely suggest to change the working directory and use ./sdftool instead of the entire path. If you type ./sdftool --help then you will note the command says flash instead of rawflash. I believe this is an oversight which shall be corrected. If only I would have known…

dcoke22
Posts: 3049
Joined: Wed Jul 22, 2020 11:25 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by dcoke22 » Sun Sep 17, 2023 7:52 pm

MKV Maker wrote:
Sun Sep 17, 2023 6:25 pm
Yes, rawflash worked for both drives instead of flash. Thanks for the clarification. If ever you use the binary then I definitely suggest to change the working directory and use ./sdftool instead of the entire path. If you type ./sdftool --help then you will note the command says flash instead of rawflash. I believe this is an oversight which shall be corrected. If only I would have known…
The 'top level' help does use the vanilla 'flash'.

Code: Select all

Typical usage:

sdftool -l                         list all available drives
sdftool -d D: help                 list all commands available for the drive
sdftool -d D: dump -o c:\out       dump drive firmware
sdftool -d D: flash -i file.bin    flash drive firmware
However, if you do the help for a specific drive, you get a more detailed answer. For example:

Code: Select all

user@machine MacOS % ./sdftool -d /IOBDServices/0DF09974 help
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149
DEBUG: code=00000000 src=YF;}*jq/'~"3+_YtiqC]o-7i4:29395149

MTK19xx firmware module v1.30

Commands:

  dump [auto|full|user]
  Dumps firmware image
    dump full      - dumps full rom image (if not disabled in firmware)
    dump user      - dumps non-volatile user data
    dump auto      - dumps full image if possible, user data otherwise

  rawflash [<flag>,<flag=value>,...]
    Sends the image and flashing flags to drive
    for flashing in self-update mode
  flags:
    main           - flashes main firmware (this is the default)
    full           - flashes boot loader and main firmware (Caution!!!)
    de             - sets DE byte in image
    enc            - encrypts firmware before sending to drive
    slim           - force USB slim drive handshake

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Sun Sep 17, 2023 8:19 pm

I should have done that. I think Mike shall fix this because there is certainly ambiguity. Considering it worked for me I believe for users of Mac OS and MakeMKV this is by far the most easy, simple, and effectual manner by which to flash a drive’s firmware.

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Sun Sep 17, 2023 8:24 pm

I have got two questions. Firstly, what mean those debug codes whenever drives are listed? Secondly, what are the differences in behaviour to flash the main firmware versus to flash the main firmware and the boot loader? Apparently the latter requires caution.

Goddess_Germanika
Posts: 9
Joined: Mon Jan 15, 2024 4:09 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by Goddess_Germanika » Tue Jan 16, 2024 3:58 am

I have an OWC Mercury Pro with an LG BD-RE BH16NS40, svc ns51, ROM v 1.05

Mac mini OS 14.2.1 MakeMVK is 1.17.5 in Libre Drive: Drive platform: MT1959

I am doing this in Terminal which I have used often and understood next to nothing but my copy paste skills are superb!

Manufacturer: HL-DT-ST
Product: BD-RE BH16NS40
Revision: 1.05
Serial number: ***********
Firmware date: 2120-05-06 13:31

In Terminal: /Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -l

Returned: /IOBDServices/5CDB4FF9
HL-DT-ST_BD-RE__BH16NS40_1.05_212005061331_KLEN36A5030

Which appears to match closely the HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin

Only the “BH” instead of WH and the final time 1331 not 1440

I found one man on line whose Terminal script is next

/Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -d '/IOBDServices/5CDB4FF9' \
-f /tmp/sdf.bin rawflash enc \ -i /tmp/HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin

<NOTICE: sdf.bin rawflash enc \ -I/
Is different from the script I found here with : sdf.bin rawflash main -I/

He says the “enc” is for encrypted rom which he says we should assume on any drive after 2020, mine is March 2023

/makemkvcon f -d '/IOBDServices/5CDB4FF9' -f /tmp/sdf.bin rawflash main -i /tmp/HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin

So, my question is is that first one better? Has anyone done this?

Did I miss anything?

Thanks in advance.

Goddess_Germanika
Posts: 9
Joined: Mon Jan 15, 2024 4:09 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by Goddess_Germanika » Tue Jan 16, 2024 11:25 am

This is My Update to this great thread. I want to thank garygomm for this great thread. And Taco Hope for the 1st script from https://blog.paco.to/2023/ripping-blura ... free-easy/

I have been struggling for days to understand this, about 40 pages or more here, another 30 or so elsewhere. LG was their usual very worthless self when it comes to support!

I am an actual beginner so I am always wishing people would explain it to the Baby in the Room! I am an accountant known for documenting my work extensively. I hope this is clear. I welcome any insights, advice or improvements to what I have written.

I have an OWC Mercury Pro with an LG BD-RE BH16NS40, svc ns51, ROM v 1.05

Mac mini M2, OS 14.2.1, MakeMVK is 1.17.5, in Libre Drive: Drive platform: MT1959

I am doing this in Terminal which I have used often and understood next to nothing but my copy paste skills are superb!

Manufacturer: HL-DT-ST
Product: BD-RE BH16NS40
Revision: 1.05
Serial number: ***********
Firmware date: 2120-05-06 13:31

1st: https://makemkv.com/sdf.bin < download that

2nd: In Terminal: /Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -l

Returned: /IOBDServices/5CDB4FF9
HL-DT-ST_BD-RE__BH16NS40_1.05_212005061331_KLEN36A5030

Which appears to match closely the HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin

Only the “BH” instead of WH and the final time 1331 not 1440

3rd: https://www.makemkv.com/download/mk-fir ... 200720.zip

4th: Open zip file and find the ROM version you need

5th: in Finder>Go>Go to Folder - then type: /tmp

6th: Move the sdf.bin and the version you need in that zip file into /tmp

7th ver A: In Terminal: /Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -d '/IOBDServices/5CDB4FF9' \
-f /tmp/sdf.bin rawflash enc \ -i /tmp/HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin

<NOTICE: sdf.bin rawflash enc \ -I/
Is different from the script I found here with : sdf.bin rawflash main -I/

He says the “enc” is for encrypted rom which he says we should assume on any drive after 2020, mine is March 2023

Is the script from this thread. So as I said I do not understand Terminal so I do not know the difference between the “rawflash main -i /tmp” and “rawflash enc \ -i /tmp”
7th ver B: In Terminal: /Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -d '/IOBDServices/5CDB4FF9' -f /tmp/sdf.bin rawflash main -i /tmp/HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin

So, my question is is that first one better? Has anyone done this?

Did I miss anything?

Thanks in advance.

dcoke22
Posts: 3049
Joined: Wed Jul 22, 2020 11:25 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by dcoke22 » Tue Jan 16, 2024 3:39 pm

Goddess_Germanika wrote:
Tue Jan 16, 2024 11:25 am
Is the script from this thread. So as I said I do not understand Terminal so I do not know the difference between the “rawflash main -i /tmp” and “rawflash enc \ -i /tmp”
'rawflash main' vs 'rawflash enc' is a switch that tells the flashing program wether to expect the firmware on the drive to be encrypted or not. 'rawflash main' means the firmware is not encrypted. 'rawflash enc' means the firmware is encrypted.

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -d '/IOBDServices/5CDB4FF9' -f /tmp/sdf.bin rawflash enc -i /tmp/HL-DT-ST-BD-RE_WH16NS40-NS50-1.05-NM00900-212005061440.bin
Since your drive probably has encrypted firmware, that's probably the better of the two command line options you posted.

However, the Ultimate UHD Drives Flashing Guide (which Coopervid pointed you at in your other thread How to flash a 2023 OWC with an LG BD-RE BH16NS40 SVC: NS51 Firmware v 1.05) has a section in it titled Recommended Firmware to flash for MakeMKV: In that section, it says:

WH16NS40 on any Firmware directly to > WH16NS60 1.02MK

As Coopervid mentioned, the BH/WH prefix is just an indicator of how the drive was packaged and doesn't matter for purposes of flashing. The key is you want to take a 16NS40 directly to the 16NS60 1.02MK firmware. The collective wisdom of the forum has determined that the 16NS60 1.02MK firmware is 'the best' for that LG hardware.

That means the firmware specified in the command line should change to the 16NS60 1.02MK version. The command should probably look something like the following:

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -d '/IOBDServices/5CDB4FF9' -f /tmp/sdf.bin rawflash enc -i /tmp/HL-DT-ST-BD-RE_WH16NS60-1.02-NM00100-211810291936.bin

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Tue Jan 16, 2024 5:52 pm

dcoke22 wrote:
Tue Jan 16, 2024 3:39 pm
However, the Ultimate UHD Drives Flashing Guide (which Coopervid pointed you at in your other thread How to flash a 2023 OWC with an LG BD-RE BH16NS40 SVC: NS51 Firmware v 1.05) has a section in it titled Recommended Firmware to flash for MakeMKV: In that section, it says:

WH16NS40 on any Firmware directly to > WH16NS60 1.02MK

As Coopervid mentioned, the BH/WH prefix is just an indicator of how the drive was packaged and doesn't matter for purposes of flashing. The key is you want to take a 16NS40 directly to the 16NS60 1.02MK firmware. The collective wisdom of the forum has determined that the 16NS60 1.02MK firmware is 'the best' for that LG hardware.

That means the firmware specified in the command line should change to the 16NS60 1.02MK version. The command should probably look something like the following:

Code: Select all

/Applications/MakeMKV.app/Contents/MacOS/makemkvcon f -d '/IOBDServices/5CDB4FF9' -f /tmp/sdf.bin rawflash enc -i /tmp/HL-DT-ST-BD-RE_WH16NS60-1.02-NM00100-211810291936.bin
I was about to explain this. The firmware to flash the drive is the incorrect firmware which means the syntax matters not for even if it were correct the firmware is not the necessary unencrypted downgrade. Procure the correct firmware binary then focus on the command. Nothing will change otherwise.

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Tue Jan 16, 2024 5:56 pm

Also, it will benefit every user of Mac OS to make an alias to resolve to the console's binary [e.g. mkvcon] in the shell's configuration file such as zshrc. The command will be more efficient then.

Goddess_Germanika
Posts: 9
Joined: Mon Jan 15, 2024 4:09 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by Goddess_Germanika » Tue Jan 16, 2024 9:09 pm

MKV Maker wrote:
Tue Jan 16, 2024 5:52 pm
dcoke22 wrote:
Tue Jan 16, 2024 3:39 pm
However, the Ultimate UHD Drives Flashing Guide (which Coopervid pointed you at in your other thread How to flash a 2023 OWC with an LG BD-RE BH16NS40 SVC: NS51 Firmware v 1.05) has a section in it titled Recommended Firmware to flash for MakeMKV: In that section, it says:

WH16NS40 on any Firmware directly to > WH16NS60 1.02MK
While I like 'collective wisdom, I'd like to understand why picking from this huge list which had a WH16NS40 1.05 is better than a drive that is WH16NS60? and exactly what is better about 1.02?

Does anyone know the differences between the 40 and the 60?

Paco Hope used WH16NS40 1.05 and that worked.

Does 1.02 work on UHD? Is 1.02 encrypted?
Does 1.05 NOT work on UHD?
or what known defects does 1.05 have that 1.02 does not? <I think the question is WHY does the collective wisdom think the 60 1.02 better? I expect to do this only once and at the moment I am not rich enough to afford to brick a drive.

Thank you all for your input.

MKV Maker
Posts: 45
Joined: Wed Jun 03, 2020 3:42 am

Re: Flashing firmware on a Mac for LibreDrive

Post by MKV Maker » Tue Jan 16, 2024 9:18 pm

From version 1.03 onwards LG began to encrypt the firmware making it unusable for BD-ROM UHD discs. Version 1.02 was the last usable version without the sleep bug– the most nasty bug encountered in these firmwares. Nothing visibly different from …NS40 to …NS60. I have got two OWC purchases that are WH16NS40 and I used the …NS60 version 1.02 firmware on both successfully.

Goddess_Germanika
Posts: 9
Joined: Mon Jan 15, 2024 4:09 pm

Re: Flashing firmware on a Mac for LibreDrive

Post by Goddess_Germanika » Wed Jan 17, 2024 6:57 am

MKV Maker wrote:
Tue Jan 16, 2024 9:18 pm
From version 1.03 onwards LG began to encrypt the firmware making it unusable for BD-ROM UHD discs. Version 1.02 was the last usable version without the sleep bug– the most nasty bug encountered in these firmwares. Nothing visibly different from …NS40 to …NS60. I have got two OWC purchases that are WH16NS40 and I used the …NS60 version 1.02 firmware on both successfully.
Thank you for your response. I spent another few hours reading and researching all of this and I now at least understand what is going on and it does seem like electronics makers are getting increasingly hostile to their customers.

Thank you everyone for your input. I'll downgrade to the 1.02

Post Reply