Flashing Gigabyte while avoiding "Invalid BIOS image"

Firmware security signature implementtions prevents the use of modified files.

I though I was clear, I am asking how can I avoid “Invalid BIOS image” when flashing an unmodified BIOS with Q-Flash. I would expect such BIOS not to have this problem and I know that a solution is to use EFIFlash, but is there a way to make it work with Q-Flash?

Hello,
I’m trying to flash a modded BIOS on my Gigabyte B360M DS3H with the Turing ReBar module, using Q-Flash i get the infamous “Invalid BIOS Image” error, using the EFiflash method i get the “Secure Flash” warning, probably because I updated my BIOS to F19 previously and using flashrom the flashing completes but Resizable BAR is still disabled in GPU-Z after using the .exe to configure the ReBAR size.
I should mention my GPU is a 1660Ti
If anyone could give some other method to flash the BIOS or tell me what I’m doing wrong I would be grateful.

@poweruser0409 Hi and welcome to the Win-RAID forum.

For your Gigabyte B360M you can also use Intel FPT (Flash Programming Tool) to flash a modified BIOS.

You will need to use the correct version of FPT that matches the ME Firmware version (v12.x).

FPT_v12.0.x.zip

WARNING: Unlike Qflash or Efiflash, FPT will not verify that the BIOS file it is told to flash matches the hardware you are trying to flash. You can brick your motherboard if your BIOS mod is bad or the motherboard is accidentally cross-flashed with the BIOS from another motherboard model - so please be careful!

DISCLAIMER: I am not responsible if you brick your board trying to flash any BIOS using FPT. It is a good idea to use FPT to make a backup of your current BIOS before you attempt to write anything to the BIOS chip. It is a good idea to have a hardware programmer available so that you can recover the motherboard in the case of a brick.

You can use FPT from within Windows, an MS-DOS bootable USB stick or an EFI shell.

Command to do a full BIOS EEPROM backup from a Windows command prompt:

fptw64 -d bios.bin

You should see “FPT Operation Successful.” If not then you may have a BIOS chip that FPT cannot recognize.

Use the following commands to flash the entire EEPROM (all BIOS regions are overwritten i.e. Descriptor, GbE, ME and BIOS);

fptw64 -f MODBIOSName.bin

Once the flash operation says it has completed successfully type the following command to IMMEDIATELY reboot and load the BIOS you just flashed;

fptw64 -greset

Note that your PC will restart instantly without any warning as though you have pressed the reset button.

Also note that If you choose to use the DOS or EFI version note that the FPT filename will be different from above.

1 Like

Thanks, I figured it out in the meanwhile, but I appreciate the prompt response.

1 Like

@poweruser0409 Glad to hear you got it sorted out :+1:

I am trying to rephrase what I previously asked, can “Invalid BIOS image” appear when using Q-Flash and official BIOS from Gigabyte?

@kyriacos

No one else here seems to anwsered you… so i think we lack a bit more info on the file actions, Q-Flash is an embebded bios utility from GigaByte and for sure it checks the file signature for its information, if you have issues with an original GigaByte file why dont you contact them since is a Beta file and in the way you can also ask them why the files works on X but not on Y. Or is the file somehow modified by you?
Maybe the Beta file hasn’t enough info or not compatible signatures for Q-Flash…
By the way this thread is about using EFIFLASH for flashing mod files.
I may not be enterely correct but Q-Flash is mainly a bios region update/recovery…we may say, while EFIFLASH can do a full writting to several components of the SPI IC that maybe Q-Flash cannot.
My pov only.

EDIT:

Yes my “poor” native English knowledge, understood it… and you got my anwser.

1 Like

@MeatWar I am trying to flash unmodified BIOS and with Q-Flash I get “Invalid BIOS image”. Same unmodified BIOS can be flashed with EFIFlash. I can try asking Gigabyte about this, but I thought someone here could answer sooner.

@kyriacos Newer Gigabyte BIOS may not allow BIOS version downgrade via Q-Flash.

In these cases EFIFlash can be used to downgrade if the BIOS is not encapsulated.

Intel FPT can be used to downgrade any BIOS (just be careful as FPT can overwrite/erase the Intel Gigabit MAC address) as long as there are no BIOS locks present (i.e. Asus, ASRock).

I get the “BIOS is protected by SecureFlash” and it then counts down to restart but doesn’t restart. (I’ve tried restarting manually and same problem.) I’ve tried FreeDOS on a USB with multiple version up to Efiflash_v0.87_mod.exe and I’ve tried UEFI on a USB with Efiflash_v0.87_mod.efi.

Edit: this is attempting to flash my modded (with UEFI-Editor BIOS F15 to my motherboard with version F15. I looked at the Efiflash.exe included with the BIOS from the website and using notepad I found some text at the bottom in the binary with version 0.87 so this should be the right one (though I’ve tried newer and older versions with different errors). This is a Gigabyte H370N Wifi ITX motherboard.

@NicholasFlamy Hi and welcome to the Win-RAID forum.

Looking at the Gigabyte notes from your link for BIOS F15:

Introduce capsule BIOS support starting this version

I suggest using Intel Flash Programming Tool (FPT) v12.x to flash your modified BIOS:

FPT_v12.0.x.zip

WARNING: Unlike Qflash or Efiflash, FPT will not verify that the BIOS file it is told to flash matches the hardware you are trying to flash. You can brick your motherboard if your BIOS mod is bad or the motherboard is accidentally cross-flashed with the BIOS from another motherboard model - so please be careful!

2ND WARNING: Your motherboard has 2x Intel Gigabit Ethernet Adapters of which FPT can overwrite (erase) their MAC address(es) causing them to no longer function! Although the MAC addresses may be recoverable it is a big hassle that you will want to avoid. You will know if you have erased them if they display 888888888788 as their MAC address.

DISCLAIMER: I am not responsible if you brick your board trying to flash any BIOS using FPT. It is a good idea to use FPT to make a backup of your current BIOS before you attempt to write anything to the BIOS chip. It is a good idea to have a hardware programmer available so that you can recover the motherboard in the case of a brick.

BEFORE YOU ATTEMPT TO FLASH YOUR MODIFIED BIOS YOU SHOULD WRITE DOWN THE MAC ADDRESSES OF ANY INTEL GIGABIT ETHERNET ADAPTERS IN YOUR SYSTEM.

You can use FPT from within Windows, an MS-DOS bootable USB stick or an EFI shell.

Command to do a full BIOS EEPROM backup from a Windows command prompt:

fptw64 -d bios.bin

You should see “FPT Operation Successful.” If not then you may have a BIOS chip that FPT cannot recognize.

To backup the MAC address(es) type the following commands;

fptw64 -gbe -d gbe.bin

NOTE: If you read this file in a hex editor your MAC address(es) should be at the start.

Use the following commands to flash the entire EEPROM (all BIOS regions are overwritten i.e. Flash Descriptor, GbE, ME and BIOS);

fptw64 -SAVEMAC -f MODBIOSName.bin

The command -SAVEMAC will retain your Intel MAC address(es) so don’t leave it out!

Once the flash operation says it has completed successfully type the following command to IMMEDIATELY reboot and load the BIOS you just flashed;

fptw64 -greset

Note that your PC will restart instantly without any warning as though you have pressed the reset button.

Also note that If you choose to use the DOS or EFI version the FPT filename will be different from above.

Thank you for the welcome and thank you for the info. I saw about FPT earlier. I’m wondering if there are any other options that I can try first, like modifying the F16 BIOS (1 version newer). The reason is because this is my first time BIOS modding so I’m trying to be especially cautious. I have a lot of experience with tinkering and modding outside of BIOS and firmware.

My goal is to enable hidden settings on this motherboard with the primary focus being ASPM as this is my home server/NAS. I run a Debian-based Linux distro on it so for Windows tools I have to use portable drives. I specifically bought an ASM1166 M.2 to SATA card for this system for ASPM support and I might have to update the firmware using Windows.

@NicholasFlamy Unfortunately you have limited options and using a newer BIOS does not offer you more.

  1. Use Intel FPT to flash the BIOS

  2. Use a hardware programmer to flash the BIOS

Both methods have risk but a programmer can be used to recover from a brick, which can easily happen when modifying any BIOS.

It’s better to be prepared for the worst case scenario.

1 Like

One other thing I discovered is Q-Flash shows invalid image. Then I used Q-Flash to save the current image to the USB flash drive. Then I tried to flash the image I just saved and it said invalid image. It’s very strange since it’s invalidating the image that it actively has.

@NicholasFlamy Can you zip and upload the Q-flash image?

I’ll have to do that tomorrow, it’s late here.

(Communicating on my phone.)

1 Like

Dang, can’t upload directly because I created this account yesterday. Maybe GDrive link will work:

I checksummed the Q-Flash image, and it was a different result than from the website. I would guess that is because of BIOS profiles.

1 Like

@NicholasFlamy Try these with Q-flash:

Q-Flash-Saved_mod1.zip (7.1 MB)

V1-H370NWF.F15_mod1.zip (6.8 MB)

They both report invalid BIOS image.

1 Like