Skip to content
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

silabs-flasher: Support Yellow with CM5 #3851

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
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
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
Loading