How update the BIOS from IPFire with PC Engines APUx

EDIT: Scroll down and read Arne.F’s comment before following my instructions. I wasn’t aware that there was an even easier way to do this and that only certain BIOS versions are supported. That being said, this did work fine for my APU2D4 and seems to run just fine on version 4.11.0.5.


This post comes as a result of seeing an old post about this same topic here and realizing that there is another way to do this that does not involve installing another small Linux distribution onto your APUx to do the BIOS upgrade. Also I want to give credit where I got some of this information at the following link which is also where I bought it.

https://teklager.se/en/knowledge-base/apu-bios-upgrade/

These instructions assume that your APUx will first boot and install IPFire before updating the BIOS.

IPFire now has “flashrom” available as a add-on.

https://wiki.ipfire.org/addons/flashrom

After installing IPFire, log into the web admin page on your web browser. From the horizontal menu selections across the top select “IPFire” then “Pakfire”. Scroll down the list of available add-ons until you find “flashrom” and select it, then click on the + sign below to install the add-on.

You will need to preferably connect via the USB to serial cable with Putty (Needed for the very last step), or SSH into IPFire with a Linux terminal. Remember that SSH is not enabled by default. You can enable it from the web admin log in page at the menus “System > SSH Access”

First find the link for the correct binary files (.rom) for your model router. And be sure it is indeed the correct file as I suspect the flashrom command argument I used forces it onto the motherboard regardless of the version being correct or not, which could brick your router if using the wrong file.

BIOS files are at the link below:
https://pcengines.github.io/

I’ve been using the mainline releases as recommended and as of today updated to version 4.11.0.5. Copy the link to the file.

Log into “root” on your IPFire install and run the command “wget” and paste the link you copied right after it. If you’re using a Linux terminal the paste command is “Ctrl+Shift+V”. If you are using Putty a single middle mouse button click will paste. This downloads the file onto your IPFire router. You can verify the file is there by doing a “ls”, or “ls -l” (for more detail) command.

So for example, the command I used was:

wget https://3mdeb.com/open-source-firmware/pcengines/apu2/apu2_v4.11.0.5.rom

Now lets verify that the file has not been corrupted or altered by using the “sha256sum” command. The format is sha256sum and the name of the file that you can start typing a few letters and press the “Tab” to auto fill the rest.

My example was:

sha256sum apu2_v4.11.0.5.rom

Highlight the resulting sum output only and copy it to the clipboard. Linux terminal is Ctrl+Shift+C. Putty is single middle mouse click to copy and the same to paste elsewhere. Paste this into a text editor. Then using the above mentioned pcengines link, click on the “SHA256” button just to the right of the file you copied the link from, click on this and copy the entire line and paste it into the next line down in the same text editor you did the prior paste. Make sure each pasted line is different after the sum so as to show you did two separate pastes and not accidentally paste the same line twice. In this example the first line would be just the sum copied from the IPFire router results, and the second line would be the sum plus the file name from the pcengines SHA256 link.

6d64a388dc41943d65285cbe8af1472184bd4230ee4b368c6d6bcfb88b3ff1b6
6d64a388dc41943d65285cbe8af1472184bd4230ee4b368c6d6bcfb88b3ff1b6  apu2_v4.11.0.5.rom

Verify each sum is the same. If it is, it’s time to flash the BIOS. If not, double check which file you chose versus the SHA256 sum, or try the download again.

To flash the BIOS, the command format is:

flashrom -w your_file_name.rom -p internal:boardmismatch=force

What I used is:

flashrom -w apu2_v4.11.0.5.rom -p internal:boardmismatch=force

Adjust the file name depending on what it is.

Be patient and do not power off the router until it is done. You’ll know it’s done when the last line it gives you is:

Verifying flash...  VERIFIED.

And then it puts you back at the command or terminal prompt.

To check that the BIOS is updated you’ll need to be connected with the USB to serial cable with Putty and re-boot the router. Watch the BIOS version numbers at the very beginning. It should match up with what you upgraded to. All done!

4 Likes

Thanks for these steps! Will follow when needed next time.

Maybe worth a Wiki entry? Linked to the flashrom command or vice versa?

We don’t suggest to use boardmismatch=force
This is only needed if you have a very old bios on the apu1 or 2.

Also we have not tested this bios version.
I have seen that there are again acpi and smbios changes. This may dangerous because
IPFire has some special drivers that use the old smbios api’s. The latest tested version is 4.10.0.3
at the moment.

The latest tested is also in pakfire.
pakfire install pcengines-apu-firmware
and run
firmware-update info
for checking and
firmware-update update
to install.

This may fail on apu1 because flashrom doesn’t detect the used flashchip. In this case you can try to flash mannually.

3 Likes

here no problems with 4.11.05 and Core 142 on apu https://fireinfo.ipfire.org/profile/3bf89ad5603ea955c7ee2ed8ef93e8fbca548a18

Hellfire,

You’re welcome. I’d be hesitant to set this up as a Wiki entry or link to flashrom based on Arne.F’s comment, unless the developers want me to do that. I’m not an expert about this by any means, but I can follow instructions.

Arne.F,

Thank you for commenting. I’ve edited my post to have users read your post first before following my instructions. I didn’t know any of this information you have typed here, but it is certainly good to know now and for future reference. Where would a user have found that information if they were searching for it?

Version 4.11.0.5 seems to run fine so far on the lastest IPFire version, but I assume there must be certain use cases that will cause failures or corruption. If it becomes a problem I’ll certainly down grade.
Thanks again!

Thanks John Doe and Arne.F for the information about how to do the firmware update. I have to reinstall my IPFire and thougt about an update of the firmware but didn’t really know how to do this.

After reading this, i’ve just tried an “firmware-update info” but only get this:
Board :
HW Version :
Serial :
BIOS Version: SageBios_PCEngines_APU-45 (04/05/2014)

Is it normal that there are infos missing? Or is it maybe because of the very old firmware version? It’s an APU1C Board. Any hints for a save update?

Thanks

I recently tried with a very old firmware on an APU1 as well. Not only I got the same result, but when I tried the update I got the following error:

'/dev/mem mmap failed: Operation not permitted’

see https://www.flashrom.org/FAQ

I think if I decide to give it an other go I will use a usb with TinyCore

I just recently updated from a very old version to v4.11.0.5 on my APU1. Even here you don’t need internal:boardmismatch=force and as said it is not recommended.

According to the following link, you just need to specify the chip name with -c option: https://github.com/pcengines/apu2-documentation/blob/master/docs/firmware_flashing.md#corebootrom-flashing

Just manually reverted to 4.10.0.3 as suggested with the following command:

flashrom -w apu1_v4.10.0.3.rom -p internal -c MX25L1605A/MX25L1606E/MX25L1608E

It does not work for my APU1C2.
Any other ideas?

Here is all I tried - I used core 142 i586 fresh install.

[root@blue-i586 ~]# firmware-update info
Board :
HW Version :
Serial :
BIOS Version: SageBios_PCEngines_APU-45 (04/05/2014)
[root@blue-i586 ~]# firmware-update update
Detected running BIOS version SageBios_PCEngines_APU-45
Unkown vendor:
Support for this vendor might not have been implement, yet

[root@blue-i586 bios]# flashrom -w apu1_v4.10.0.3.rom -p internal
flashrom v1.0.1 on Linux 4.14.173-ipfire (i686)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x7efdf000.
Found chipset “AMD SB7x0/SB8x0/SB9x0”.
Enabling flash write… Error accessing SB600 SPI registers, 0x1000 bytes at 0xf7f04000
/dev/mem mmap failed: Operation not permitted
FAILED!
FATAL ERROR!
Error: Programmer initialization failed.

[root@blue-i586 bios]# flashrom -w apu1_v4.10.0.3.rom -p internal -f
flashrom v1.0.1 on Linux 4.14.173-ipfire (i686)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x7efdf000.
Found chipset “AMD SB7x0/SB8x0/SB9x0”.
Enabling flash write… Error accessing SB600 SPI registers, 0x1000 bytes at 0xf7f04000
/dev/mem mmap failed: Operation not permitted
FAILED!
FATAL ERROR!
Error: Programmer initialization failed.
[root@blue-i586 bios]# flashrom -w apu1_v4.10.0.3.rom -p internal -c MX25L1605A/MX25L1606E/MX25L1608E
flashrom v1.0.1 on Linux 4.14.173-ipfire (i686)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x7efdf000.
Found chipset “AMD SB7x0/SB8x0/SB9x0”.
Enabling flash write… Error accessing SB600 SPI registers, 0x1000 bytes at 0xf7f04000
/dev/mem mmap failed: Operation not permitted
FAILED!
FATAL ERROR!
Error: Programmer initialization failed.

If you read further down at the " Motherboard mismatch warning" section. It looks like you need to still use internal:boardmismatch=force for very old legacy versions, as they do have issues related to SMBIOS table entries.

flashrom -w coreboot.rom -p internal:boardmismatch=force

Once you are up to date, it is NOT recommended to use internal:boardmismatch=force anymore, because it skips motherboard tests. Use then:

flashrom -w coreboot.rom -p internal -c "MX25L1605A/MX25L1606E/MX25L1608E"

This worked for me (APU1D) when I updated from a very old firmware.

After this it shows correct information:

firmware-update info
Board : PC Engines apu1
HW Version : 1.0
Serial : xxxxxxxx
BIOS Version: v4.10.0.3 (11/07/2019)

:exclamation: But don’t blame me if it does not work with your system

That does not work either…
Forgot to mention: this is an APU1C 2GB…
With the “stable” bios from 2015… :wink:
Last time when I had these problems I changed the flashrom version…

I see that pakfire delivers 1.0.1… I will try with latest 1.2.x …

flashrom -p internal:boardmismatch=force
flashrom v1.0.1 on Linux 4.14.173-ipfire (i686)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
coreboot table found at 0x7efdf000.
Found chipset “AMD SB7x0/SB8x0/SB9x0”.
Enabling flash write… Error accessing SB600 SPI registers, 0x1000 bytes at 0xf7f04000
/dev/mem mmap failed: Operation not permitted
FAILED!
FATAL ERROR!
Error: Programmer initialization failed.

Looks like the APU1C has a differnet chip. My output with the APU1D looks like this:

Found Macronix flash chip “MX25L1605A/MX25L1606E/MX25L1608E”

So maybe send an email to pcengines support.

Someone here has a similar error like you:

“However, using the TinyCore installer with a dedicated USB stick worked on both these boards. But I don’t recall which flash chip was actually found on my APU1s.”

Yeah, that brings me a memory!!
I did used that years ago - found my post on PCengines Forum:

http://www.pcengines.info/forums/?page=post&id=02832FA6-5B72-49C8-BDBB-C8344E0C1CBC&fid=6D8DBBA4-9D40-4C87-B471-80CB5D9BD945

I did exactly like then and it worked: apparently the older version 0.9 of flashrom was the SOLUTION for APU1C- at least this is what I wrote in that post in PCEngines forum :wink:
I am old, don’t mind me.

And HUGE thanks

Here is my APU now

**PC Engines apu1coreboot build 20190711 **
BIOS version v4.10.0.3

:fist_right: :fist_right: :fist_right: :fist_right:

And from IPFire

> [root@blue-i586 ~]# firmware-update info
> Board : PC Engines apu1
> HW Version : 1.0
> Serial : 871955
> BIOS Version: v4.10.0.3 (11/07/2019)

Congratulaions … glad to hear that … so you could declare this as solved :beers:

Just to be secure I’d also use gpg --verify as you can watch this video How to verify PC Engines Open Source Firmware Release v4.13.0.1 signature - asciinema . Only checksuming isn’t secure enough I think. So you do it on your PC. Then you’d need to flash the checked ROM from a USB thumbdrive. It’s a little more work than wget, but you don’t update your BIOS every day.

Hello,

I encountered the same issue while trying to flash my APU1 board. The following link helped me to solve that problem: FAQ - flashrom.

Regards,

Martin Krieger (makrie)