bluetooth-init: ccimx6ul: validate FW was correctly loaded

Sporadically, the BT FW is uploaded but the interface is not functional
as it is not up and its entries are not populated. Validate the FW
was correctly set, if not, rely on the retry mechanism.

https://onedigi.atlassian.net/browse/DEL-9006

Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
Isaac Hermida 2024-10-29 15:52:45 +01:00
parent 5f3a9fd7da
commit 5451a0f4bc
1 changed files with 4 additions and 1 deletions

View File

@ -70,7 +70,10 @@ bluetooth_init() {
if hciattach ttyBt qca ${BT_RATE:-3000000} -t30 ${BT_FLOW:-flow} unused ${BT_MACADDR} >${HCIATTACH_LOG} 2>&1; then if hciattach ttyBt qca ${BT_RATE:-3000000} -t30 ${BT_FLOW:-flow} unused ${BT_MACADDR} >${HCIATTACH_LOG} 2>&1; then
# hciattach performs a reset to load the new firmware and needs some time to be ready # hciattach performs a reset to load the new firmware and needs some time to be ready
sleep 1 sleep 1
return # Validate that FW was correcly loaded by checking if file exists
if [ -f "/sys/kernel/debug/bluetooth/hci0/features" ]; then
return
fi
fi fi
sleep 1 sleep 1