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

ieee802154: Radio::send followed by Radio::recv panics with v0.14 #368

Closed
japaric opened this issue Dec 21, 2021 · 1 comment · Fixed by #369
Closed

ieee802154: Radio::send followed by Radio::recv panics with v0.14 #368

japaric opened this issue Dec 21, 2021 · 1 comment · Fixed by #369

Comments

@japaric
Copy link
Contributor

japaric commented Dec 21, 2021

steps to reproduce

(sorry I did not try to minimize the repro case):

stack backtrace:

stack backtrace:
   0: HardFaultTrampoline
      <exception entry>
   1: lib::inline::__udf
        at ./asm/inline.rs:172:5
   2: __udf
        at ./asm/lib.rs:49:17
   3: cortex_m::asm::udf
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.3/src/asm.rs:43:5
   4: rust_begin_unwind
        at /home/japaric/github/ferrous-systems/embedded-trainings/common/panic-log/src/lib.rs:12:5
   5: core::panicking::panic_fmt
        at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:100:14
   6: core::panicking::panic
        at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/panicking.rs:50:5
   7: nrf_hal_common::ieee802154::Radio::state
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf-hal-common-0.14.0/src/ieee802154.rs:665:18
   8: nrf_hal_common::ieee802154::Radio::put_in_rx_mode
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf-hal-common-0.14.0/src/ieee802154.rs:626:21
   9: nrf_hal_common::ieee802154::Radio::start_recv
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf-hal-common-0.14.0/src/ieee802154.rs:397:9
  10: nrf_hal_common::ieee802154::Radio::recv_timeout
        at /home/japaric/.cargo/registry/src/github.com-1ecc6299db9ec823/nrf-hal-common-0.14.0/src/ieee802154.rs:355:13
  11: radio_recv::__cortex_m_rt_main
        at src/bin/radio-recv.rs:36:15
  12: main
        at src/bin/radio-recv.rs:13:1
  13: Reset
(HOST) ERROR the program panicked

hal v0.13.0 works fine. I'm currently investigating the cause

@japaric
Copy link
Contributor Author

japaric commented Dec 21, 2021

after PR #356 a send operation leaves the radio in the TXDISABLED state (instead of TXIDLE). recv is lacking the logic to handle starting from that state so it panics. looking into adding code to handle that case

japaric added a commit to japaric/nrf-hal that referenced this issue Dec 21, 2021
after PR nrf-rs#356 the radio is disabled after every `send` operation.
if one calls `send` immediately after `recv`, `recv` can observe the radio in the TXDISABLE state
TXDISABLE is a transitory state that leads to the final DISABLED state which the impl knows how to handle

this PR adds logic to handle the transitory TXDISABLE state

fixes nrf-rs#368
bors bot added a commit that referenced this issue Jan 3, 2022
369: ieee802154: handle the transitory state TXDISABLE r=jonas-schievink a=japaric

after PR #356 the radio is disabled after every `send` operation.
if one calls `recv` immediately after `send`, `recv` can observe the radio in the TXDISABLE state
TXDISABLE is a transitory state that leads to the final DISABLED state which the impl knows how to handle

this PR adds logic to handle the transitory TXDISABLE state

fixes #368

---

I have checked that the programs in https://github.com/ferrous-systems/embedded-trainings-2020 work again with this change

Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
bors bot added a commit that referenced this issue Jan 3, 2022
369: ieee802154: handle the transitory state TXDISABLE r=jonas-schievink a=japaric

after PR #356 the radio is disabled after every `send` operation.
if one calls `recv` immediately after `send`, `recv` can observe the radio in the TXDISABLE state
TXDISABLE is a transitory state that leads to the final DISABLED state which the impl knows how to handle

this PR adds logic to handle the transitory TXDISABLE state

fixes #368

---

I have checked that the programs in https://github.com/ferrous-systems/embedded-trainings-2020 work again with this change

Co-authored-by: Jorge Aparicio <jorge.aparicio@ferrous-systems.com>
@bors bors bot closed this as completed in f403aa1 Jan 3, 2022
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 a pull request may close this issue.

1 participant