mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-12 01:29:29 +00:00
Combine per-device firmware ZIPs into a single unified flasher (#3070)
* Add combined firmware ZIP creation and update flashing script for device selection * Refactor firmware flashing scripts and update README for improved device selection and actions * Remove outdated flash script for PortaPack Mayhem * Add write permissions to release jobs in nightly and stable release workflows * Rename HackRF firmware files for consistency in nightly and stable release workflows * Refactor release workflows to streamline asset preparation and upload process * Fix file paths for HackRF firmware in nightly and stable release workflows * Updated labels * Refactor mayhem_flasher.bat for improved clarity * Added reset after flash Updated the flashing script to include error handling and improved user prompts. * Remove --reset from DFU as it is known to cause issues
This commit is contained in:
+2
-2
@@ -1,3 +1,3 @@
|
||||
Plug HackRF+Portapack, set it in HackRF mode, launch flash_portapack_mayhem.bat
|
||||
Run mayhem_flasher.bat and follow the prompts to select your device and action (flash Mayhem, DFU unbrick, or restore factory firmware).
|
||||
|
||||
Read https://github.com/portapack-mayhem/mayhem-firmware/wiki/Update-firmware for more detailed information
|
||||
Read https://github.com/portapack-mayhem/mayhem-firmware/wiki/Update-firmware for more detailed information.
|
||||
@@ -1,19 +0,0 @@
|
||||
@echo off
|
||||
|
||||
echo *** Run HackRF firmware in RAM via LPC DFU ***
|
||||
echo.
|
||||
echo This is used to "unbrick" your HackRF, if you are no longer able to use
|
||||
echo HackRF tools to flash or operate your HackRF.
|
||||
echo.
|
||||
echo Connect your HackRF One to a USB port on your computer.
|
||||
echo.
|
||||
echo Hold down both the DFU and RESET buttons on the HackRF.
|
||||
echo Then release the RESET button (closest to the edge).
|
||||
echo Then release the DFU button.
|
||||
echo.
|
||||
pause
|
||||
|
||||
echo.
|
||||
"utils/dfu-util-static.exe" --device 1fc9:000c --download "utils/hackrf_usb.dfu" --reset
|
||||
echo.
|
||||
pause
|
||||
@@ -1,32 +0,0 @@
|
||||
@echo off
|
||||
|
||||
echo *** Re-flash the HackRF with PortaPack firmware ***
|
||||
echo.
|
||||
echo Connect your HackRF One to a USB port on your computer.
|
||||
echo.
|
||||
echo If using a PortaPack, put the PortaPack in HackRF mode by selecting
|
||||
echo the "HackRF" option from the main menu.
|
||||
echo.
|
||||
pause
|
||||
|
||||
echo.
|
||||
|
||||
REM Check if the firmware file exists
|
||||
if not exist portapack-mayhem-firmware.bin (
|
||||
echo The firmware file "portapack-mayhem-firmware.bin" does not exist.
|
||||
echo Please ensure that you have downloaded the latest release from:
|
||||
echo https://github.com/portapack-mayhem/mayhem-firmware/releases/
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
"utils/hackrf_spiflash.exe" -w portapack-mayhem-firmware.bin
|
||||
echo.
|
||||
echo "If your device never boot after flashing, please refer to won't boot article"
|
||||
echo.
|
||||
echo "click-to-open url: https://github.com/portapack-mayhem/mayhem-firmware/wiki/Won%%27t-boot"
|
||||
echo "or"
|
||||
echo "copy-and-paste url: https://github.com/portapack-mayhem/mayhem-firmware/wiki/Won't-boot"
|
||||
echo.
|
||||
pause
|
||||
@@ -0,0 +1,160 @@
|
||||
@echo off
|
||||
|
||||
echo =========================================================
|
||||
echo PortaPack Mayhem - Device Flasher
|
||||
echo =========================================================
|
||||
echo.
|
||||
echo Connect your device to a USB port on your computer.
|
||||
echo.
|
||||
|
||||
REM ── Step 1: Select device ─────────────────────────────────
|
||||
echo What is your device?
|
||||
echo.
|
||||
echo 1. HackRF One / PortaPack
|
||||
echo 2. PortaRF
|
||||
echo 3. HackRF Pro / PortaPack
|
||||
echo.
|
||||
set /p DEVICE_CHOICE="Enter your choice (1, 2 or 3): "
|
||||
|
||||
if "%DEVICE_CHOICE%"=="1" set DEVICE_NAME=HackRF One / PortaPack
|
||||
if "%DEVICE_CHOICE%"=="2" set DEVICE_NAME=PortaRF
|
||||
if "%DEVICE_CHOICE%"=="3" set DEVICE_NAME=HackRF Pro / PortaPack
|
||||
|
||||
if not defined DEVICE_NAME (
|
||||
echo.
|
||||
echo Invalid choice. Please run the script again and enter 1, 2, or 3.
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
echo.
|
||||
echo Device: %DEVICE_NAME%
|
||||
echo.
|
||||
|
||||
REM ── Step 2: Select action ──────────────────────────────────
|
||||
echo What would you like to do?
|
||||
echo.
|
||||
echo 1. Flash Mayhem firmware
|
||||
echo 2. Flash via DFU (unbrick - run HackRF firmware from RAM)
|
||||
echo 3. Flash factory HackRF firmware (HackRF only - removes PortaPack support)
|
||||
echo.
|
||||
set /p ACTION_CHOICE="Enter your choice (1, 2 or 3): "
|
||||
|
||||
if "%ACTION_CHOICE%"=="1" goto :flash_mayhem
|
||||
if "%ACTION_CHOICE%"=="2" goto :flash_dfu
|
||||
if "%ACTION_CHOICE%"=="3" goto :flash_factory
|
||||
|
||||
echo.
|
||||
echo Invalid choice. Please run the script again and enter 1, 2, or 3.
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
|
||||
|
||||
REM ── Action 1: Flash Mayhem ─────────────────────────────────
|
||||
:flash_mayhem
|
||||
echo.
|
||||
if "%DEVICE_CHOICE%"=="1" set FIRMWARE=firmware\firmware_hackrf.bin
|
||||
if "%DEVICE_CHOICE%"=="2" set FIRMWARE=firmware\firmware_portarf.bin
|
||||
if "%DEVICE_CHOICE%"=="3" set FIRMWARE=firmware\firmware_hpro.bin
|
||||
|
||||
if "%DEVICE_CHOICE%"=="1" (
|
||||
echo If your device has a PortaPack attached, switch it to HackRF mode first by
|
||||
echo selecting the "HackRF" option from the main menu.
|
||||
echo.
|
||||
)
|
||||
echo Firmware: %FIRMWARE%
|
||||
echo.
|
||||
|
||||
if not exist %FIRMWARE% (
|
||||
echo ERROR: The firmware file "%FIRMWARE%" was not found.
|
||||
echo Please ensure you have downloaded the latest release from:
|
||||
echo https://github.com/portapack-mayhem/mayhem-firmware/releases/
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
pause
|
||||
echo.
|
||||
"utils/hackrf_spiflash.exe" -R -w %FIRMWARE%
|
||||
echo.
|
||||
echo If your device does not boot after flashing, see the troubleshooting wiki:
|
||||
echo https://github.com/portapack-mayhem/mayhem-firmware/wiki/Won%27t-boot
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
|
||||
|
||||
REM ── Action 2: DFU unbrick ──────────────────────────────────
|
||||
:flash_dfu
|
||||
echo.
|
||||
echo *** Load HackRF firmware into RAM via LPC DFU ***
|
||||
echo.
|
||||
echo Use this to unbrick your device if you can no longer use HackRF tools
|
||||
echo to flash or communicate with it.
|
||||
echo.
|
||||
echo Before pressing any key, put your device into DFU mode:
|
||||
echo 1. Hold down both the DFU and RESET buttons.
|
||||
echo 2. Release the RESET button first (the one closest to the edge).
|
||||
echo 3. Then release the DFU button.
|
||||
echo.
|
||||
|
||||
if "%DEVICE_CHOICE%"=="3" (
|
||||
set DFU_FILE=firmware\hackrf_hpro_usb.dfu
|
||||
) else (
|
||||
set DFU_FILE=firmware\hackrf_usb.dfu
|
||||
)
|
||||
|
||||
if not exist "%DFU_FILE%" (
|
||||
echo ERROR: "%DFU_FILE%" was not found.
|
||||
echo Please ensure you have downloaded the latest release from:
|
||||
echo https://github.com/portapack-mayhem/mayhem-firmware/releases/
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
pause
|
||||
echo.
|
||||
"utils/dfu-util-static.exe" --device 1fc9:000c --download "%DFU_FILE%"
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
|
||||
|
||||
REM ── Action 3: Flash factory HackRF firmware ────────────────
|
||||
:flash_factory
|
||||
echo.
|
||||
echo *** Restore factory HackRF firmware ***
|
||||
echo.
|
||||
echo This will remove Mayhem and restore the original HackRF firmware.
|
||||
echo PortaPack functionality will no longer be available after this.
|
||||
echo.
|
||||
|
||||
if "%DEVICE_CHOICE%"=="3" (
|
||||
set FACTORY_BIN=firmware\hackrf_hpro_usb.bin
|
||||
) else (
|
||||
set FACTORY_BIN=firmware\hackrf_usb.bin
|
||||
)
|
||||
|
||||
if not exist "%FACTORY_BIN%" (
|
||||
echo ERROR: "%FACTORY_BIN%" was not found.
|
||||
echo Please ensure you have downloaded the latest release from:
|
||||
echo https://github.com/portapack-mayhem/mayhem-firmware/releases/
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
)
|
||||
|
||||
pause
|
||||
echo.
|
||||
"utils/hackrf_spiflash.exe" -R -w "%FACTORY_BIN%"
|
||||
echo.
|
||||
pause
|
||||
exit /b
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
@echo off
|
||||
|
||||
echo *** Re-flash the HackRF with HackRF firmware ***
|
||||
echo.
|
||||
echo Connect your HackRF One to a USB port on your computer.
|
||||
echo.
|
||||
echo If using a PortaPack, put the PortaPack in HackRF mode by selecting
|
||||
echo the "HackRF" option from the main menu.
|
||||
echo.
|
||||
pause
|
||||
|
||||
echo.
|
||||
"utils/hackrf_spiflash.exe" -w "utils/hackrf_usb.bin"
|
||||
echo.
|
||||
pause
|
||||
Reference in New Issue
Block a user