The iPhone Wiki is no longer updated. Visit this article on The Apple Wiki for current information. |
Difference between revisions of "DFU Mode"
(Fix thinko) |
m |
||
(30 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
− | '''DFU''' or '''Device Firmware Upgrade''' mode allows all devices to be restored from any state. |
+ | '''DFU''' or '''Device Firmware Upgrade''' mode allows all devices to be restored from any state. It is essentially a mode where the BootROM can accept [[iBSS]]. DFU is part of the [[Bootrom|SecureROM]] which is burned into the hardware, so it cannot be removed. On A7+ devices, it generates an ApNonce and recognizes APTickets as well, so even in DFU, it can accept an APTicket. |
− | ==DFU Mode== |
+ | == Entering DFU Mode == |
+ | NOTE: If you are using a USB-C cable to enter DFU mode, it might not work. If this happens, you need to use the normal USB cable. You can use a normal USB cable and a USB to USB-C adapter. |
||
− | ===Entering DFU Mode (Official Instructions)=== |
||
− | # Plug your device into your computer. |
||
− | # Turn off the device. |
||
− | # Hold the Power button for 3 seconds |
||
− | # Hold the Home button without releasing the Power button for 10 seconds |
||
− | # Release the Power Button but keep holding the Home button |
||
− | # Keep holding the Home button until you are alerted by iTunes saying that it has detected a device in Recovery Mode |
||
+ | === Apple TV === |
||
− | '''Make sure the device screen is blank and no logos are present''' |
||
+ | # Plug the device into your computer using a Micro-USB cable. |
||
+ | # Force the device to reboot by holding down the "Menu" and "Down" buttons simultaneously for 6-7 seconds. |
||
+ | # Press "Menu" and "Play" simultaneously right after reboot, until a message pops up in [[iTunes]] or Finder, saying that it has detected an Apple TV in Recovery Mode. |
||
+ | === iPhone, iPad, iPod touch === |
||
− | ===Exiting DFU Mode=== |
||
+ | ==== A9 and older devices (iPad other than the ones listed below, iPhone 6s and below, iPhone SE and iPod touch 6 and below) ==== |
||
− | Hold Home and Power Button till the Apple Logo appears |
||
+ | # Connect the device to a computer using a USB cable. |
||
+ | # Hold down both the Home button and Lock button. |
||
+ | # After 8 seconds, release the Lock button while continuing to hold down the Home button. |
||
+ | #* If the Apple logo appears, the Lock button was held down for too long. |
||
+ | # Nothing will be displayed on the screen when the device is in DFU mode. If open, iTunes will alert you that a device was detected in recovery mode. |
||
+ | #* If your device shows a screen telling you to connect the device to iTunes, retry these steps. |
||
+ | |||
+ | ==== A10 devices (iPhone 7 and iPhone 7 Plus, iPad 2018, iPod touch 7) ==== |
||
+ | # Connect the device to a computer using a USB cable. |
||
+ | # Hold down both the Side button and Volume Down button. |
||
+ | # After 8 seconds, release the Side button while continuing to hold down the Volume Down button. |
||
+ | #* If the Apple logo appears, the Side button was held down for too long. |
||
+ | # Nothing will be displayed on the screen when the device is in DFU mode. If open, iTunes will alert you that a device was detected in recovery mode. |
||
+ | #* If your device shows a screen telling you to connect the device to iTunes, retry these steps. |
||
+ | |||
+ | ==== A11 and newer devices (iPhone 8 and above, iPad Pro 2018, iPad Air 2019, iPad Mini 2019) ==== |
||
+ | # Connect the device to a computer using a USB cable. |
||
+ | # Quick-press the Volume Up button |
||
+ | # Quick-press the Volume Down button |
||
+ | # Hold down the Side button until the screen goes black, then hold down both the Side button and Volume Down button. |
||
+ | # After 5 seconds, release the Side button while continuing to hold down the Volume Down button. |
||
+ | #* If the Apple logo appears, the Side button was held down for too long. |
||
+ | # Nothing will be displayed on the screen when the device is in DFU mode. If open, iTunes will alert you that a device was detected in recovery mode. |
||
+ | #* If your device shows a screen telling you to connect the device to iTunes, retry these steps. |
||
+ | |||
+ | === Apple Watch === |
||
+ | |||
+ | # Connect to computer via [[iBUS]] adapter and lightning cable |
||
+ | # Hold crown and power button (bottom right) |
||
+ | # Wait for the screen to go black |
||
+ | # After 3 seconds of black, let go of the power button but continue to hold the crown |
||
+ | # After about 5 seconds your watch will be in DFU mode |
||
+ | |||
+ | === Mac with the T2 Security chip === |
||
+ | Note: To restore bridgeOS, you will need to use Apple Configurator on a second Mac. |
||
+ | ==== iMac (2020), iMac Pro (2017) ==== |
||
+ | # Disconnect the iMac Pro or iMac from power. |
||
+ | # Plug the USB-C cable into the Thunderbolt port closest to the Ethernet port. |
||
+ | # While holding down the power button, connect the iMac Pro or iMac to power and continue to hold the power button for about 3 seconds. |
||
+ | |||
+ | ==== Mac mini (2018) ==== |
||
+ | # Optional but recommended step. Connect a monitor to your Mac mini (so you can see when the restore process is complete). |
||
+ | # Disconnect the Mac mini from power for at least 10 seconds. |
||
+ | # Plug the USB-C cable into the Thunderbolt port closest to the HDMI port. |
||
+ | # While holding down the power button, connect the Mac mini to power and continue to hold the power button for about 3 seconds. |
||
+ | |||
+ | ==== MacBook Air or MacBook Pro ==== |
||
+ | # Press the Sleep/Wake button for about 5 seconds to shut down the Apple notebook computer. |
||
+ | # Plug the USB-C cable into the front Thunderbolt port on the left side of the Apple notebook computer. |
||
+ | # While holding down the power button, press the right shift key, the left option key and the left control keys for about 3 seconds. |
||
+ | |||
+ | ==== Mac Pro (2019) ==== |
||
+ | # Optional but recommended step. Connect a monitor to your Mac Pro (so you can see when the restore process is complete). |
||
+ | # Disconnect the Mac Pro from power. |
||
+ | # For the desktop Mac Pro, plug the USB-C cable into the Thunderbolt port farthest away from the power button. |
||
+ | # For the rack mount Mac Pro, plug the USB-C cable into the Thunderbolt port closest to the power button. |
||
+ | # While holding down the power button, connect the Mac Pro to power and continue to hold the power button for about 3 seconds. |
||
+ | |||
+ | === Mac with Apple Silicon === |
||
+ | Note: To restore macOS and recoveryOS, you will need to use Apple Configurator on a second Mac. |
||
+ | ==== iMac (24-inch, M1, 2021) ==== |
||
+ | # Disconnect the iMac from power. |
||
+ | # Plug the USB-C cable into the Thunderbolt port closest to the stand. |
||
+ | # While holding down the power button, connect the iMac to power and continue to hold the power button for about 3 seconds. |
||
+ | |||
+ | ==== Mac Studio and Mac mini ==== |
||
+ | # Optional but recommended step. Connect a monitor to your Mac Studio or Mac mini (so you can see when the restore process is complete). |
||
+ | # Disconnect the Mac Studio or Mac mini from power for at least 10 seconds. |
||
+ | # Plug the USB-C cable into the Thunderbolt port closest to the Ethernet port. |
||
+ | # Press and hold the power button. |
||
+ | # Reconnect power while still holding the power button. |
||
+ | # Release the power button. |
||
+ | # The status indicator light should turn amber. This indicates that the Mac Studio or Mac mini is in DFU mode. |
||
+ | |||
+ | ==== MacBook Air or MacBook Pro ==== |
||
+ | Note: the MagSafe LED indicator will be disabled while in DFU Mode. |
||
+ | # Press the power button. |
||
+ | # Plug the USB-C cable into the front Thunderbolt port on the left side of the Apple notebook computer. |
||
+ | # While holding down the power button, press the right shift key, the left option key and the left control keys for about 10 seconds. |
||
+ | # After 10 seconds, immediately release the three keys but continue to hold down the power button until Apple Configurator indicates that the Mac is in DFU mode. |
||
+ | |||
+ | === GPIO Pins === |
||
+ | If you have hardware access to the SoC, you can either perform the above methods for your device by utilizing the <code>GPIO_REQUEST_DFU1</code> and <code>GPIO_REQUEST_DFU2</code> GPIO pins (previously <code>HOLD_KEY</code> and <code>MENU_KEY</code>) corresponding to Power and Home/Vol-, respectively, or by pulling your board's <code>GPIO_FORCE_DFU</code> pin high at SecureROM startup (unless you are using an [[iFPGA]], where Force DFU mode is the default). |
||
+ | |||
+ | The physical GPIO pins for each SoC varies. |
||
+ | |||
+ | == Exiting DFU Mode == |
||
+ | To exit DFU Mode, simply force restart your device. |
||
+ | |||
+ | * For Apple TV, hold down the "Menu" and "Down" buttons on your remote until the Apple TV reboots. |
||
+ | * For iPad, iPhone 6s and below, iPhone SE and iPod touch, hold the Home button and the Lock button until the device reboots. |
||
+ | * For iPhone 7 and iPhone 7 Plus, hold down the Side button and Volume Down button until the device reboots. |
||
+ | * For iPhone 8, iPhone 8 Plus, iPhone SE (2020) and iPhone X or newer, quick-press the Volume Up button, then quick-press the Volume Down button, then hold down the Side button until the device reboots. |
||
+ | * For a Mac (T2 or Apple Silicon), press and hold the power button until you see the Apple logo and/or hear the startup chime. |
||
− | ==DFU mode on [[K66ap|Apple TV (2G)]]== |
||
− | ===Entering DFU Mode=== |
||
− | # Plug the device into your computer using a microUSB cable. |
||
− | # Force the device to reboot by holding down the "Menu" and "Down" buttons simultaneously for 6-7 seconds. |
||
− | # Press "Menu" and "Play" simultaneously right after reboot, until a message pops up in [[iTunes]], saying that it has detected an [[K66ap|Apple TV]] in recovery mode. |
||
− | ===Exiting DFU Mode=== |
||
==Enter True Hardware DFU Mode Automatically== |
==Enter True Hardware DFU Mode Automatically== |
||
− | The EnterDFU function in the [[MobileDevice Library]] does not enter the true DFU Mode in the hardware. It's possible to enter the true DFU Mode without doing it manually, but it cannot be exited unless a restore is performed, as it creates a [[DFU Loop]]. |
+ | The EnterDFU function in the [[MobileDevice Library]] does not enter the true DFU Mode in the hardware. It's possible to enter the true DFU Mode without doing it manually, but it cannot be exited unless a restore is performed, as it creates a [[DFU Loop]]. This doesn't work with [[S5L8900]] devices. |
===Steps=== |
===Steps=== |
||
# Make a copy of a fresh IPSW file. |
# Make a copy of a fresh IPSW file. |
||
− | # Open the IPSW as a zip folder and browse to /firmware/ |
+ | # Open the IPSW as a zip folder and browse to /firmware/all_flash/all_flash.xxxxx.production/ |
− | # Extract LLB.*****.RELEASE.img3 and open it in a hex editor. |
+ | # Extract LLB.*****.RELEASE.img3/im4p and open it in a hex editor. |
# Change some random bit or bits, it doesn't matter which or what you write. |
# Change some random bit or bits, it doesn't matter which or what you write. |
||
# Add the edited file back to the zip, rename zip to ipsw and restore it to your device using iTunes. |
# Add the edited file back to the zip, rename zip to ipsw and restore it to your device using iTunes. |
||
Line 37: | Line 122: | ||
# Delete LLB.*****.RELEASE.img3. |
# Delete LLB.*****.RELEASE.img3. |
||
# Copy applelogo.********.img3 to temporary directory. |
# Copy applelogo.********.img3 to temporary directory. |
||
− | # Rename the copy of applelogo.********.img3 to LLB.*****.RELEASE.img3. (If you forget the name of the LLB file, you can find it again in the file named manifest.) |
+ | # Rename the copy of applelogo.********.img3/im4p to LLB.*****.RELEASE.img3/im4p. (If you forget the name of the LLB file, you can find it again in the file named manifest.) |
# Copy the renamed applelogo file back to the all_flash.xxxxx.production directory. |
# Copy the renamed applelogo file back to the all_flash.xxxxx.production directory. |
||
# Rename the zip. |
# Rename the zip. |
||
Line 43: | Line 128: | ||
==DFU Mode Output to the computer== |
==DFU Mode Output to the computer== |
||
− | <pre>iProduct: "Apple Mobile Device (DFU Mode)"</pre> <pre>iSerialNumber: "CPID:XXXX CPRV: |
+ | <pre>iProduct: "Apple Mobile Device (DFU Mode)"</pre> <pre>iSerialNumber: "CPID:XXXX CPRV:XX CPFM:0X SCEP:XX BDID:XX ECID:XXXXXXXXXXXXXXXX SRTG:[iBoot-XXXX.X.X]"</pre> |
+ | |||
==Revisions== |
==Revisions== |
||
===[[S5L8900]] (0x1222)=== |
===[[S5L8900]] (0x1222)=== |
||
− | This is the device ID in the [[ |
+ | This is the device ID in the [[N45AP|iPod touch]], the [[M68AP|iPhone]], and the [[N82AP|iPhone 3G]]. For more information about the protocol, see [[DFU 0x1222]]. |
===[[S5L8720 Bootrom|S5L8720]], [[S5L8920]], and [[WTF|WTF mode post-2.0]] (0x1227)=== |
===[[S5L8720 Bootrom|S5L8720]], [[S5L8920]], and [[WTF|WTF mode post-2.0]] (0x1227)=== |
||
− | This is the device ID in the [[ |
+ | This is the device ID in the [[N72AP|iPod touch (2nd generation)]], the [[N88AP|iPhone 3GS]], the [[N90AP|iPhone 4]], subsequent 32 bit devices, all 64 bit devices, and [[WTF|WTF mode]]. For more information on the protocol, see [[DFU 0x1227]]. |
− | [[Category: |
+ | [[Category:Bootrom]] |
Latest revision as of 16:14, 29 November 2022
DFU or Device Firmware Upgrade mode allows all devices to be restored from any state. It is essentially a mode where the BootROM can accept iBSS. DFU is part of the SecureROM which is burned into the hardware, so it cannot be removed. On A7+ devices, it generates an ApNonce and recognizes APTickets as well, so even in DFU, it can accept an APTicket.
Contents
Entering DFU Mode
NOTE: If you are using a USB-C cable to enter DFU mode, it might not work. If this happens, you need to use the normal USB cable. You can use a normal USB cable and a USB to USB-C adapter.
Apple TV
- Plug the device into your computer using a Micro-USB cable.
- Force the device to reboot by holding down the "Menu" and "Down" buttons simultaneously for 6-7 seconds.
- Press "Menu" and "Play" simultaneously right after reboot, until a message pops up in iTunes or Finder, saying that it has detected an Apple TV in Recovery Mode.
iPhone, iPad, iPod touch
A9 and older devices (iPad other than the ones listed below, iPhone 6s and below, iPhone SE and iPod touch 6 and below)
- Connect the device to a computer using a USB cable.
- Hold down both the Home button and Lock button.
- After 8 seconds, release the Lock button while continuing to hold down the Home button.
- If the Apple logo appears, the Lock button was held down for too long.
- Nothing will be displayed on the screen when the device is in DFU mode. If open, iTunes will alert you that a device was detected in recovery mode.
- If your device shows a screen telling you to connect the device to iTunes, retry these steps.
A10 devices (iPhone 7 and iPhone 7 Plus, iPad 2018, iPod touch 7)
- Connect the device to a computer using a USB cable.
- Hold down both the Side button and Volume Down button.
- After 8 seconds, release the Side button while continuing to hold down the Volume Down button.
- If the Apple logo appears, the Side button was held down for too long.
- Nothing will be displayed on the screen when the device is in DFU mode. If open, iTunes will alert you that a device was detected in recovery mode.
- If your device shows a screen telling you to connect the device to iTunes, retry these steps.
A11 and newer devices (iPhone 8 and above, iPad Pro 2018, iPad Air 2019, iPad Mini 2019)
- Connect the device to a computer using a USB cable.
- Quick-press the Volume Up button
- Quick-press the Volume Down button
- Hold down the Side button until the screen goes black, then hold down both the Side button and Volume Down button.
- After 5 seconds, release the Side button while continuing to hold down the Volume Down button.
- If the Apple logo appears, the Side button was held down for too long.
- Nothing will be displayed on the screen when the device is in DFU mode. If open, iTunes will alert you that a device was detected in recovery mode.
- If your device shows a screen telling you to connect the device to iTunes, retry these steps.
Apple Watch
- Connect to computer via iBUS adapter and lightning cable
- Hold crown and power button (bottom right)
- Wait for the screen to go black
- After 3 seconds of black, let go of the power button but continue to hold the crown
- After about 5 seconds your watch will be in DFU mode
Mac with the T2 Security chip
Note: To restore bridgeOS, you will need to use Apple Configurator on a second Mac.
iMac (2020), iMac Pro (2017)
- Disconnect the iMac Pro or iMac from power.
- Plug the USB-C cable into the Thunderbolt port closest to the Ethernet port.
- While holding down the power button, connect the iMac Pro or iMac to power and continue to hold the power button for about 3 seconds.
Mac mini (2018)
- Optional but recommended step. Connect a monitor to your Mac mini (so you can see when the restore process is complete).
- Disconnect the Mac mini from power for at least 10 seconds.
- Plug the USB-C cable into the Thunderbolt port closest to the HDMI port.
- While holding down the power button, connect the Mac mini to power and continue to hold the power button for about 3 seconds.
MacBook Air or MacBook Pro
- Press the Sleep/Wake button for about 5 seconds to shut down the Apple notebook computer.
- Plug the USB-C cable into the front Thunderbolt port on the left side of the Apple notebook computer.
- While holding down the power button, press the right shift key, the left option key and the left control keys for about 3 seconds.
Mac Pro (2019)
- Optional but recommended step. Connect a monitor to your Mac Pro (so you can see when the restore process is complete).
- Disconnect the Mac Pro from power.
- For the desktop Mac Pro, plug the USB-C cable into the Thunderbolt port farthest away from the power button.
- For the rack mount Mac Pro, plug the USB-C cable into the Thunderbolt port closest to the power button.
- While holding down the power button, connect the Mac Pro to power and continue to hold the power button for about 3 seconds.
Mac with Apple Silicon
Note: To restore macOS and recoveryOS, you will need to use Apple Configurator on a second Mac.
iMac (24-inch, M1, 2021)
- Disconnect the iMac from power.
- Plug the USB-C cable into the Thunderbolt port closest to the stand.
- While holding down the power button, connect the iMac to power and continue to hold the power button for about 3 seconds.
Mac Studio and Mac mini
- Optional but recommended step. Connect a monitor to your Mac Studio or Mac mini (so you can see when the restore process is complete).
- Disconnect the Mac Studio or Mac mini from power for at least 10 seconds.
- Plug the USB-C cable into the Thunderbolt port closest to the Ethernet port.
- Press and hold the power button.
- Reconnect power while still holding the power button.
- Release the power button.
- The status indicator light should turn amber. This indicates that the Mac Studio or Mac mini is in DFU mode.
MacBook Air or MacBook Pro
Note: the MagSafe LED indicator will be disabled while in DFU Mode.
- Press the power button.
- Plug the USB-C cable into the front Thunderbolt port on the left side of the Apple notebook computer.
- While holding down the power button, press the right shift key, the left option key and the left control keys for about 10 seconds.
- After 10 seconds, immediately release the three keys but continue to hold down the power button until Apple Configurator indicates that the Mac is in DFU mode.
GPIO Pins
If you have hardware access to the SoC, you can either perform the above methods for your device by utilizing the GPIO_REQUEST_DFU1
and GPIO_REQUEST_DFU2
GPIO pins (previously HOLD_KEY
and MENU_KEY
) corresponding to Power and Home/Vol-, respectively, or by pulling your board's GPIO_FORCE_DFU
pin high at SecureROM startup (unless you are using an iFPGA, where Force DFU mode is the default).
The physical GPIO pins for each SoC varies.
Exiting DFU Mode
To exit DFU Mode, simply force restart your device.
- For Apple TV, hold down the "Menu" and "Down" buttons on your remote until the Apple TV reboots.
- For iPad, iPhone 6s and below, iPhone SE and iPod touch, hold the Home button and the Lock button until the device reboots.
- For iPhone 7 and iPhone 7 Plus, hold down the Side button and Volume Down button until the device reboots.
- For iPhone 8, iPhone 8 Plus, iPhone SE (2020) and iPhone X or newer, quick-press the Volume Up button, then quick-press the Volume Down button, then hold down the Side button until the device reboots.
- For a Mac (T2 or Apple Silicon), press and hold the power button until you see the Apple logo and/or hear the startup chime.
Enter True Hardware DFU Mode Automatically
The EnterDFU function in the MobileDevice Library does not enter the true DFU Mode in the hardware. It's possible to enter the true DFU Mode without doing it manually, but it cannot be exited unless a restore is performed, as it creates a DFU Loop. This doesn't work with S5L8900 devices.
Steps
- Make a copy of a fresh IPSW file.
- Open the IPSW as a zip folder and browse to /firmware/all_flash/all_flash.xxxxx.production/
- Extract LLB.*****.RELEASE.img3/im4p and open it in a hex editor.
- Change some random bit or bits, it doesn't matter which or what you write.
- Add the edited file back to the zip, rename zip to ipsw and restore it to your device using iTunes.
- The restore will error out and your device will be in DFU Mode.
Alternative Method
If the previous method does not work for you, try this one.
- Do steps 1 and 2 from above.
- Delete LLB.*****.RELEASE.img3.
- Copy applelogo.********.img3 to temporary directory.
- Rename the copy of applelogo.********.img3/im4p to LLB.*****.RELEASE.img3/im4p. (If you forget the name of the LLB file, you can find it again in the file named manifest.)
- Copy the renamed applelogo file back to the all_flash.xxxxx.production directory.
- Rename the zip.
- Restore the file using iTunes. (If every thing goes well, you should receive an error 31 from iTunes.)
DFU Mode Output to the computer
iProduct: "Apple Mobile Device (DFU Mode)"
iSerialNumber: "CPID:XXXX CPRV:XX CPFM:0X SCEP:XX BDID:XX ECID:XXXXXXXXXXXXXXXX SRTG:[iBoot-XXXX.X.X]"
Revisions
S5L8900 (0x1222)
This is the device ID in the iPod touch, the iPhone, and the iPhone 3G. For more information about the protocol, see DFU 0x1222.
S5L8720, S5L8920, and WTF mode post-2.0 (0x1227)
This is the device ID in the iPod touch (2nd generation), the iPhone 3GS, the iPhone 4, subsequent 32 bit devices, all 64 bit devices, and WTF mode. For more information on the protocol, see DFU 0x1227.