Skip to content

Fixed Beaglebone Black detection for Kernel 5.10 or higher #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def _pi_rev_code(self) -> Optional[str]:
# pylint: disable=no-self-use
def _beaglebone_id(self) -> Optional[str]:
"""Try to detect id of a Beaglebone."""

board_value = self.detector.get_device_compatible()
# Older Builds
if "freedom-u74-arty" in board_value:
Expand All @@ -232,7 +231,11 @@ def _beaglebone_id(self) -> Optional[str]:
with open("/sys/bus/nvmem/devices/0-00500/nvmem", "rb") as eeprom:
eeprom_bytes = eeprom.read(16)
except FileNotFoundError:
return None
try:
with open("/sys/bus/nvmem/devices/0-00501/nvmem", "rb") as eeprom:
eeprom_bytes = eeprom.read(16)
except FileNotFoundError:
return None

if eeprom_bytes[:4] != b"\xaaU3\xee":
return None
Expand All @@ -249,7 +252,6 @@ def _beaglebone_id(self) -> Optional[str]:
return model

board_value = self.detector.get_armbian_release_field("BOARD")

return None

# pylint: enable=no-self-use
Expand Down