Skip to content

lora: Fix IRQ bit mask for sx126x#1113

Open
maholli wants to merge 1 commit into
micropython:masterfrom
maholli:master
Open

lora: Fix IRQ bit mask for sx126x#1113
maholli wants to merge 1 commit into
micropython:masterfrom
maholli:master

Conversation

@maholli
Copy link
Copy Markdown
Contributor

@maholli maholli commented May 11, 2026

Fixes #1112 which causes corrupt packets to silently be passed as valid by the driver.

Fixes micropython#1112 which causes corrupt packets to silently be passed as valid by the driver.
Copy link
Copy Markdown
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @maholli, sorry it took me a little while to get back to this. Thanks for very clear description of the problem and the fix.

I have a request about the code comment surrounding this change, and also please edit micropython/lora/lora-sx126x/manifest.py and bump the bugfix version of this package so mip will update it.

Thanks again!

Comment on lines 225 to 232
# If DIO1 is set, mask in just the IRQs that the driver may need to be
# interrupted by. This is important because otherwise an unrelated IRQ
# can trigger the ISR and may not be reset by the driver, leaving DIO1 high.
#
# If DIO1 is not set, all IRQs can stay masked which is the power-on state.
if dio1:
# Note: we set both Irq mask and DIO1 mask to the same value, which is redundant
# (one could be 0xFFFF) but may save a few bytes of bytecode.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments are for the old (broken) code, so please change it to say something "just the IRQs that the driver is interrupted by or needs to read back via a status command" and remove the second "Note:" comment entirely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lora sx126x silently returns crc failed packets as valid

2 participants