[Guide] How to flash a modded AMI UEFI BIOS

I’ve downloaded a vanilla BIOS for my X370-PRIME PRO and used UBU to update the CPU microcode inside. I tried to use the latest “afuefix64.efi” from AMI’s website to update the BIOS but I just get the standard “secure flash rom verify fail” error. This PC doesn’t have Windows installed, which means neither of the methods advertised in the first post of this thread are available.

Is there another way to flash this modded BIOS?

@gloobox - yes, only this model has USB Flashback >> M5A97 R2.0
LE model doesn’t have it - renaming BIOS to flashback name only works on the M5A97 R2.0 board with flashback.
If you can flashback stock BIOS on the M5A97 R2.0 board, but not your mod BIOS, upload your mod BIOS and I will fix it for you to it will work with flashback.
I know what you mean with AI Suite method, I never had any luck the few times I tested that either.

@DragonQ , for modern AMD boards options are VERY limited when it comes to flashing mod BIOS. Often only options are flash programmer or Flashback if the board has this feature.
You can try method linked on page one, search Valkyriestar and follow that link to the guide, download the attached tools in that guide and follow the flash method only in the last spoiler on that guide

Thanks! Here is the bios modded.I just add the nvme module in it.

M5A97R20.rar (2.99 MB)


Thanks for the tip, unfortunately his method is also Windows based, so not helpful for me. :frowning:

@DragonQ - install windows temporarily on some drive. Or you’ll have to get flash programmer like CH341A and SOIC8 test clip w/ cable if BIOS is soldered to board or U Type Flat chip IC extractor if BIOS is in a socket. If you need links to those items let me know.

@gloobox - yes, this is failing due to unsigned capsule.
To make this not happen, extract BIOS Body from capsule using UEFITool then modify that, then open stock.cap in hex editor, go to 800h location, then open mod BIOS body in another tab of hex, select all and copy, then on stock.cap BIOS at 800h paste the mod BIOS body, then save as flashbackname.cap
To do same with your current BIOS, what I did for file below, open the file in hex, go to 800h, select all of file from there to end of file (800000h length), copy and then past into stock.cap at 800h as mentioned above, then save as flashbackname.cap
Here is fixed BIOS - http://s000.tinyupload.com/index.php?fil…531816785177750


Yeah I guess I’ll need to find a spare SSD somewhere. I’m using all the SATA ports though so it’s still a bit annoying. Not sure if it’s worth spending the time installing Windows etc. or just waiting for a new BIOS with a non-beta ComboPI AGESA.

Thanks for your help.

@Lost_N_BIOS
It’s perfect!!!USB FLASHBACK works!!!
Btw,could this file be flashed OK with AI Suite method even AFU method?If so ,I can flash it in the MA5A97 LE R2.0.
haha,I’ll try it tonight and give you feedback!

@gloobox - I expected that would fix it right up for you! I’m not sure about Ai Suite method, I’ve never had any luck doing that, and have only seen few reports of success too, you’ll have to try and see.
* you edited while I replied I’m not sure if you can crossflash BIOS from one model to another that easily, but maybe you can get lucky? If not, I can make BIOS for you from the Non LE BIOS that will flash on that system, once you find a way to flash mod BIOS.

@DragonQ - no spare HDD? If you’re using all the SATA ports, how can you not have a spare drive to make a small partition on to install test setup of windows?
It may all be for naught anyway though, sadly, AMD is tough to find a way with mod BIOS sometimes

@Lost_N_BIOS
Could I just delete the 800h of modded bios and then add the 800h of original bios to the modded bios in hex editor?
(There seems no "cover" function of hex editor,or I can just copy 800h of original bios then paste and cover the 800h of modded bios~)

@gloobox - Yes, same/same if you do either of those things! Cut/paste, or cut/insert over selected, or delete first 0-799h then paste back in, insert etc.
800h line is where BIOS body starts, so you’ll be replacing the first 0-799 with stock capsule, however you want to accomplish that.
Then you can check your BIOS once done in UEFITool, proper will show Signed Capsule instead of Unsigned.


It’s a file server, so it has 6x HDD for storage (ZFS), 1x HDD for scratch (ext4), and 1x SSD for OS and VMs (ext4) - I definitely don’t want to mess with the partitions on those disks! I do have a spare SSD lying around, so I can swap out the SSD for the spare one. It’s just a lot more effort than I was hoping for simply updating my microcode. It was a lot easier on my desktop’s ancient X58 motherboard!

@Lost_N_BIOS
I tried AISUITE and AFU,but all failed~~~what a pity

@DragonQ - I was going to say use the scratch disk for a little but, but since it’s ext4 not so sure you can create a small partition at the end in NTFS for Windows
There may be some working DOS or EFI AFU that will flash mod BIOS on your model, have you googled around or looked in Youtube videos for more modern board models AMD Mod BIOS flashing?

@gloobox I can send you some ES DOS AFU’s that should be OK to use on that board, but I’m not 100% sure, so you may need to recover with programmer if they fail.
If you want to try them send me a PM. Before trying any of those I would try all regular DOS versions I could find, usually more luck there than in windows.

You can hotswap flash it, pop the BIOS out (Carefully!) and then pop the BIOS out (carefully) of your non-LE board but then sit it back in gently with a ribbon or something underneath so you can pull up easily from both sides at once and pop it out without issue.
Then with your original non-LE BIOS in the non-LE board, boot to BIOS and have stock non-LE BIOS.cap on a USB ready for EZ Flash. Enter EZ Flash but do not select a file to flash yet, now pop out that BIOS chip and put in your other LE boards BIOS chip, then select the non-LE BIOS to flash with EZ Flash and proceed.
Once it’s done let it reboot if it’s going to, if not, shut down once flash is done. Remove that chip and put into other board, if it doesn’t work then the Non-LE BIOS is not compatible and you’ll then need flash programmer to reflash stock BIOS for that board.
You can do this on a spare chip too if you have one, that way you don’t loose your chip/BIOS that’s working on the Non-LE board

Similar process can be done with flashback too I think, swap BIOS chip while board is powered off, invoke flashback with non-LE stock BIOS or mod BIOS on USB ready for flashback. I’ve not done this, but I have done the above hot-swap many times on many different models.

@Lost_N_BIOS

The mobo is my old friend,and he don’t get any spi programmer.So I am afraid that will make his mobo into brick…I am giving him an advise to buy one.The bios file I will upload to you~
many thanks to you!!!

M5A97-LE-R20-ASUS-2701.rar (2.95 MB)

@gloobox - I see report here of mod BIOS flash OK with EZ Flash on this model - so you may just need to correct your mod BIOS like we discussed above and it will work for EZ Flash (Send to me mod BIOS if you can’t get it working, I will check)
https://www.bios-mods.com/forum/Thread-M5A97-LE-R2-0

@Lost_N_BIOS

Thanks!!!
I just add the nvme module in it.Here is the bios below~~~

nvme M5A97-LE-R20-ASUS-2701.rar (2.96 MB)

@gloobox - yes, same issue as before, you can fix this as we discussed above
http://www.filedropper.com/m5a97le

@Lost_N_BIOS
Had no luck with new bios. Using an older bios still works and able to get 4.5 on 6400 with ram 2800ish
Settings on the new bios don’t really change much unless I am missing something but all I do is:

Set OC Explore Mode to Expert
Set Beta Runner to NOC (this is the option to enable non-K OC!))
Change the CPU Base Clock (BCLK) to the value you need (in my case 120)
Set the Extreme Memory Profile (XMP) to Enabled
Adjust the DRAM Frequency to a value around 2600 MHz
Set the CPU Core Voltage to 1.325 (i had to use 1.350 to get it stable on this CPU)

as per: https://overclocking.guide/updated-msi-z…guide-new-bios/
Not sure if allowed to link to other forums, do apologise if not

Above link mentions 2 bioses a42 and c41 which is pretty dated and probably before all the updates with microcode
Is there anything else I could try?
https://www.msi.com/Motherboard/support/Z170M-MORTAR
Latest bios is 7972vAC which I have tried to patch and you had a look at but it simply wont do with the above mentioned settings

@CivilDrone - If you are using exact same settings on old/new BIOS then this is the issue, you need to retweak for stability again, this may be voltages only, or could be timings/subtimings too.
Link to other site is fine as long as it’s related and not spam If you are setting XMP, why are you changing memory speed? What is the XMP profile speed of the XMP profile you apply?
XMP sets memory speed to what the XMP profile you choose is designed to use, if you are raising it above that then you can’t use XMP otherwise you are going outside of what it’s tested to be stable at and should be setting things manually instead.
Additionally, what do you mean by CPU voltage comment “On this CPU” Did you have some other before now? If yes, you will need to find new stable voltage as you’ve mentioned, not all CPU will overclock the same.

On your last comment about patching BIOS. What did I try to patch for you, and what failed, how did it fail etc? I found your folder I have for this, doesn’t look like I edited anything, I only have your mod BIOS and stock BIOS.
Do you need that BIOS modified? If yes, what do you need modified

@Lost_N_BIOS
Thanks!
It could be flashed in AISUITE.
But it’s couldn’t show the pata in the boot list.I found the bios didn’t have nvme module when I backup the bios after flashing.