Skip to content

Commit abe4055

Browse files
authored
Merge pull request #221 from makermelissa/main
Fixed Beaglebone Black detection for Kernel 5.10 or higher
2 parents edf96ea + a5178c3 commit abe4055

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

adafruit_platformdetect/board.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ def _pi_rev_code(self) -> Optional[str]:
218218
# pylint: disable=no-self-use
219219
def _beaglebone_id(self) -> Optional[str]:
220220
"""Try to detect id of a Beaglebone."""
221-
222221
board_value = self.detector.get_device_compatible()
223222
# Older Builds
224223
if "freedom-u74-arty" in board_value:
@@ -232,7 +231,11 @@ def _beaglebone_id(self) -> Optional[str]:
232231
with open("/sys/bus/nvmem/devices/0-00500/nvmem", "rb") as eeprom:
233232
eeprom_bytes = eeprom.read(16)
234233
except FileNotFoundError:
235-
return None
234+
try:
235+
with open("/sys/bus/nvmem/devices/0-00501/nvmem", "rb") as eeprom:
236+
eeprom_bytes = eeprom.read(16)
237+
except FileNotFoundError:
238+
return None
236239

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

251254
board_value = self.detector.get_armbian_release_field("BOARD")
252-
253255
return None
254256

255257
# pylint: enable=no-self-use

0 commit comments

Comments
 (0)