I went to the software tab and installed the openssh-sftp-server package and the flashrom package
i used filezilla to upload my bin file
I ran the command to update the bios and I got this error:
root@OpenWrt:~# flashrom -p internal -w apu4_v4.16.0.2.rom --fmap -i COREBOOT
flashrom v1.2 on Linux 5.4.179 (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).
Critical error: open(/dev/mem): No such file or directory
Error accessing low megabyte, 0x100000 bytes at 0x0000000000000000
/dev/mem mmap failed: No such file or directory
Failed getting access to coreboot low tables.
Found chipset "AMD FCH".
Enabling flash write... Critical error: open(/dev/mem): No such file or directory
Error accessing SB600 SPI registers, 0x1000 bytes at 0x00000000fec10000
/dev/mem mmap failed: No such file or directory
FAILED!
FATAL ERROR!
Error: Programmer initialization failed.
root@OpenWrt:~#
I did some googling but I am not understanding what I need to do to enable the /dev/mem so i can upgrade my bios
no it is not possible to use normal OpenWrt image because OpenWrt disables access to /dev/mem for security reasons. This is a compile option, so to enable it you must recompile the kernel. It's not something you can just "change" and reboot.
I had to recompile a special OpenWrt image with that option enabled, that image is available in the generic Pcengines APU upgrade guide on the OpenWrt wiki https://openwrt.org/toh/pcengines/apu-bios-update
(that is more or less a copu-paste of what I did to help others in the thread linked by frollic)
because their instructions already tell you to do that, it's OpenWrt that causes flashrom to fail because the access to /dev/mem is disabled at kernel compile time.