Open
Description
Describe the bug
The sx126x lora driver uses a busy loop in drivers/lora/sx126x.c::SX126xWaitOnBusy() which stalls the system endless in case ...
- the device does not work correctly eg. when the battery is weak.
- the busy line is disconnected eg. by a bad connection.
Unfortunately the problem is not visible in the Log unless CONFIG_LORA_LOG_LEVEL_DBG is set.
To Reproduce
Steps to reproduce the behavior:
- set CONFIG_LORA=y in prj.conf .
- define a lora device node in the device tree.
- build and flash on a board without sx126x or with disconnected busy line.
- the system hangs on reboot without error log in console and without executing main() .
Expected behavior
The polling in SX126xWaitOnBusy() should have a timeout after which the polling will be aborted and error message is visible in the log.
Impact
- main() thread not executed at all in case of lora hardware problem.
- Freezing of system if a lora device hardware problem occures during runtime.
Environment (please complete the following information):
- all Zephyr releases (tested at v4.1)