Update BIOS apu2

I just upgraded IPFire to core 159 and decided to update the firmwar, too. I followed my own notes and additionally checked https://community.ipfire.org/t/how-update-the-bios-from-ipfire-with-pc-engines-apux/1820/8

I’ve downloaded the binary https://3mdeb.com/open-source-firmware/pcengines/apu2/apu2_v4.15.0.1.rom and used sha256sum to checked for corrupted file.

After executing flashrom -p internal -w apu2_v4.15.0.1.rom
I got many errors like these and I stopped the process:

# flashrom -p internal -w apu2_v4.15.0.1.rom
flashrom v1.2 on Linux 4.14.212-ipfire (x86_64)
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 0xcfec4000.
Found chipset "AMD FCH".
Enabling flash write... OK.
Error accessing GD25Q256D, 0x2000000 bytes at 0x00000000fe000000
/dev/mem mmap failed: Operation not permitted
Could not map flash chip GD25Q256D at 0x00000000fe000000.
Error accessing IS25LP256, 0x2000000 bytes at 0x00000000fe000000
/dev/mem mmap failed: Operation not permitted
Could not map flash chip IS25LP256 at 0x00000000fe000000.
Error accessing IS25WP256, 0x2000000 bytes at 0x00000000fe000000
/dev/mem mmap failed: Operation not permitted

So are there any issues with the flashrom command or the update process in general?

Of course I was logged into SSH using root…

Any hints and tips are greatly appreciated!

2 Likes

In a next try I, used the command firmware-update and let the command finish. I saw the very same error messages, but nevertheless it successfully did its job:

Found Winbond flash chip “W25Q64.V” (8192 kB, SPI) mapped at physical address 0x00000000ff800000.
Reading old flash chip contents… done.
Erasing and writing flash chip… Erase/write done.
Verifying flash… VERIFIED.
Flashing was successful! Please reboot.

So, I guess those errors above are just “warnings” about not installed hardware on my apu2c4 mainboard.

3 Likes

https://www.flashrom.org/FAQ

You need iomem relaxed for flashing else it’s not permitted. Ipfire ships firmware upgrades for the APu (pakfire pcengines-apu-firmware). After installing the package and iomem relaxed you have to reboot and do
firmware-update info && firmware-update update

2 Likes

Hi @hellfire.

I have always used the command in this way and have never had a problem.

flashrom -p internal:boardmismatch=force -w apu1_v4.xx.x.x.rom

Give it a try, it might work for you.

Greetings.

1 Like

Did the firmware-update add-on not work? This should be easier!


Full disclosure - the current firmware versions is ( v4.14.0.4 ). A newer firmware version was recently created on December 6 but not yet fully approved & released.

https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=3b1482e9394447343a3a0cfb9e2f9ec9b5f95626

2 Likes

The new firmware version is running on my system for about a week now.
Without any problems.

2 Likes

Yes, that command worked with same errors about hardware, but at the end, it finished successfully.

A reboot is missing though.

1 Like

I’ve downloaded the latest update, but finally updated with the one, core 159 delivered guess it’s 4.14.0.4

I’ve downloaded version 4.15.01 from https://pcengines.github.io/ to /lib/firmware/pcengines/apu/
and did a firmware-update.
That’s nearly the same as updating from the next core-update.

Regards,
Bernhard

2 Likes

Thanks for your reply! So I will give it a try, too, with the latest firmware :laughing:

1 Like

I also want to perform this update on an fairly outdated APU2 box:

# firmware-update info
Board : PC Engines APU2
HW Version : 1.0
Serial : 14***60
BIOS Version: 4.0.7 (02/28/2017)

As I have to do that remote via an IPFire OpenVPN connection, what will be the best practice? I can log by OpenVPN connect into a remote server, which has serial console attached to that box. Also local ssh via green would be an option, or remote ssh via OpenVPN… And do I have to reboot after ‘firmware-update’, or is that included in the command (from the Wiki I get the impression this is done by hand after flashing)? Any hint will be appreciated. Cheers, Martin

I would OpenVPN to your IPFire machine. Make sure you have installed with pakfire firmware-update and pcengines-apu-firmware. Then, from the web user interface: system/SSH access you activate the ssh access, you ssh to your local IPFire IP address on port 222. After the login with your root account, you follow the instructions of the wiki.

Older firmware in the APU1 would give the following error:

/dev/mem mmap failed: Operation not permitted:

In that case the only solution I could find is to download tinycore which contains flashrom, burn the image on a usb stick, boot from the stick and do the flashrom update from there. This is impossible to do remotely, but as far as I know, this is an APU1 problem therefore it should not concern you.

Of course, an electrical failure while flashrom is updating will brick the machine. However this is recoverable, by installing this chip from pcengines in the motherboard, which will allow the booting of an OS and then re-flashing the rom. Still, I would try very hard not to brick the machine.

4 Likes

Just to let you know, updating via remote ssh session (OpenVPN) worked like a charm. There came a lot of error messages (see wiki) and also the error message about the wrong “coreboot image”, but updating was successful. Thanks for all hints.

[root@xx]# ls -al /lib/firmware/pcengines/apu/apu2_v4.17.0.2.rom
-rw-r--r-- 1 root root 8388608 Dec 27 13:54 /lib/firmware/pcengines/apu/apu2_v4.17.0.2.rom

[root@xx]# firmware-update update
Detected PC Engines APU2 running BIOS version 4.0.7
New firmware version available: v4.17.0.2

You are going to flash the firmware on device. This is a dangerous operation
that might potentially damage your device.

Please do NOT TURN OFF the system while the update is in progress and do
not abort the process.

  Firmware file: /lib/firmware/pcengines/apu/apu2_v4.17.0.2.rom

Do you want to proceed? [y/n]
Flashing process is starting now...
PLEASE DO NOT TURN OFF THE SYSTEM WHILE FLASHING!
flashrom v1.2 on Linux 5.15.71-ipfire (x86_64)
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 0xdffae000.
Found chipset "AMD FCH".
Enabling flash write... OK.
Error accessing GD25Q256D, 0x2000000 bytes at 0x00000000fe000000
/dev/mem mmap failed: Operation not permitted
...
Error accessing W25Q256JV_M, 0x2000000 bytes at 0x00000000fe000000
/dev/mem mmap failed: Operation not permitted
Could not map flash chip W25Q256JV_M at 0x00000000fe000000.
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) mapped at physical address 0x00000000ff800000.
This coreboot image (PC Engines:apu2) does not appear to
be correct for the detected mainboard (PC Engines:PCEngines apu2).
Proceeding anyway because user forced us to.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.
Flashing was successful! Please reboot.

[root@xx]# reboot

[root@xx]# firmware-update info
Board       : PC Engines apu2
HW Version  : 1.0
Serial      : 1437960
BIOS Version: v4.17.0.2 (07/28/2022)
2 Likes

Nice side effect: In section Status / Hardware Graphs a new graph “ACPI Thermal-Zone Temp Graph” popped up. And together with updating from Core 169 to 172 the temperature lowered by about 5 degrees, see image attached.

1 Like