Skip to content

Commit

Permalink
silabs-flasher: Support Yellow with CM5
Browse files Browse the repository at this point in the history
Support flashing the internal radio on Home Assistant Yellow with CM5.
  • Loading branch information
agners committed Dec 3, 2024
1 parent 5d9cb42 commit 5f767bd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions silabs_flasher/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.3.2

- Update flasher script to work with Home Assistant Yellow with CM5

## 0.3.1
- Update firmwares to EmberZNet 7.4.4
- Update universal-silabs-flasher to v0.0.25
Expand Down
2 changes: 1 addition & 1 deletion silabs_flasher/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 0.3.1
version: 0.3.2
slug: silabs_flasher
name: Silicon Labs Flasher
description: Silicon Labs firmware flasher add-on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,30 @@ function exit_no_firmware {
exit 0
}

# Function to check if the device is Home Assistant Yellow
function is_home_assistant_yellow {
# First, ensure the device is /dev/ttyAMA1
if [ "${device}" != "/dev/ttyAMA1" ]; then
return 1
fi

# Check the known paths for Home Assistant Yellow
local paths=(
"/sys/devices/platform/soc/fe201800.serial/tty/ttyAMA1"
"/sys/devices/platform/axi/1000120000.pcie/1f0003c000.serial/tty/ttyAMA1"
)
for path in "${paths[@]}"; do
if [ -d "${path}" ]; then
return 0
fi
done
return 1
}

device=$(bashio::config 'device')
bootloader_baudrate=$(bashio::config 'bootloader_baudrate')

if [ -d /sys/devices/platform/soc/fe201800.serial/tty/ttyAMA1 ] && [ "${device}" == "/dev/ttyAMA1" ]; then
if is_home_assistant_yellow; then
bashio::log.info "Detected Home Assistant Yellow"
gpio_reset_flag="--bootloader-reset yellow"
else
Expand All @@ -50,7 +70,7 @@ if bashio::config.has_value 'firmware_url'; then
firmware="firmware.gbl"
else
# Assume to run on Yellow if UART4 is mapped to ttyAMA1
if [ -d /sys/devices/platform/soc/fe201800.serial/tty/ttyAMA1 ] && [ "${device}" == "/dev/ttyAMA1" ]; then
if is_home_assistant_yellow; then
firmware="yellow_zigbee_ncp_7.4.4.0.gbl"
else
# Check device manufacturer/product information
Expand Down

0 comments on commit 5f767bd

Please sign in to comment.