cr12925 / PiEconetBridge

Linux kernel module for a Raspberry Pi (4) plus command line utilities and hardware interface diagram for a bridge between a hardware BBC Econet and AUN device (including BeebEm emulators) on IP.
21 stars 10 forks source link

Reflashing EEPROM knocks out WiFi on Pi Zero 2W #24

Closed philpem closed 4 months ago

philpem commented 5 months ago

I've followed the instructions in README-V2.1 on the v2.1-pre branch to upgrade the EEPROM on my Pi Econet HAT. After doing so, I found that the Econet bridge didn't work -- and on top of that, the WiFi on the Pi Zero 2 W I was using had stopped working too! (it wasn't even appearing in "ifconfig").

To get back up and running, I needed to add force_eeprom_read=0 to config.txt disable the HAT EEPROM and get the WiFi going, copy my EEPROM backup (which I'd thankfully taken) onto the Pi, and use the EEPROM programming tool to program it. After that, I removed the aforementioned line and enabled the device tree overlay.

Before finding the original EEPROM backup and restoring it, I blanked the EEPROM to all zeroes and tried to use the overlay. This didn't work (WiFi loaded but the Econet card wasn't recognised and the module didn't load), but perhaps that's expected?

I don't mind reprogramming the EEPROM and meddling around with the Pi if needed to debug this.

Version of PiEconetBridge in use: commit 067f220ed32abbd3b814b2565b3611ed266a607c (HEAD -> v2.1-pre, origin/v2.1-pre)

Kernel and OS:

$ uname -a
Linux philpem-piz2w-ecobridge 6.6.28+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:    12
Codename:   bookworm

The OS image was the 64bit Pi OS Lite image downloaded earlier today with the Pi Imager tool, which I updated with "apt full-upgrade" per the README.

philpem commented 5 months ago

Update - I've just tried again with the EEPROM and the overlay. Loading the overlay or flashing the EEPROM kills the onboard WiFi on the Zero 2W.

philpem commented 5 months ago

I've also tested with a 32-bit build of the latest Pi OS - this worked fine. The issue with the device-tree overlay breaking WiFi is thus specific to the 64-bit version, running on Pi Zero 2W hardware.

The Pi 3B+ uses a similar WiFi chip, also on the SDIO interface, so may also be affected.

cr12925 commented 5 months ago

Solution for now is to use 32 bit PiOS until I can work out what is going on. It seems odd that the overlay breaks only 64 bit functionality; it may be that there is some pointer/address arithmetic or casting going wrong somewhere in the kernel module. I will keep this open and try to work out how to fix.

cr12925 commented 4 months ago

Resolved in v2.1-release.