Skip to content

drivers: lora: deadlock in sx126x lora driver #90435

Open
@mjm987

Description

@mjm987

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:

  1. set CONFIG_LORA=y in prj.conf .
  2. define a lora device node in the device tree.
  3. build and flash on a board without sx126x or with disconnected busy line.
  4. 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)

Metadata

Metadata

Labels

area: LoRabugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions