Fix: TWAI transmit hangs on empty bus - #6070
Conversation
| #[cfg(any(esp32, esp32c3, esp32s2, esp32s3))] | ||
| let w = w.err_warn_int_ena().bit(enable); | ||
| #[cfg(any(esp32c6, esp32h2))] | ||
| let w = w.ext_err_warning_int_ena().bit(enable); | ||
| w |
There was a problem hiding this comment.
yes - we should align things
| // status is still set. Gating on both ensures the bus-off state is | ||
| // signalled only once per entry, instead of on every error warning | ||
| // interrupt while the state persists. | ||
| if int_raw.bits() & 0b100 > 0 { |
There was a problem hiding this comment.
This should be a specific .bit_name().bit_is_set() IMO.
There was a problem hiding this comment.
ok - then I probably should align SVD/PACs first instead of unleash even more cfg hell here
|
/hil full --test misc_drivers |
|
Triggered full HIL run for #6070. Run: https://github.com/esp-rs/esp-hal/actions/runs/31190456962 Status update: ✅ HIL (full) run succeeded. |
f2728ea to
f2ff42f
Compare
| if int_raw.err_warn_int_st().bit_is_set() | ||
| || int_raw.err_passive_int_st().bit_is_set() | ||
| || int_raw.bus_err_int_st().bit_is_set() |
There was a problem hiding this comment.
Which bit are we not checking here that we did previously? The mask had 4 1s
There was a problem hiding this comment.
👍 yes - we not checking (reserved) anymore 🤔
There was a problem hiding this comment.
For future reference, that is TWAI_TS_COUNTER_OVFL_INT_ST on the P4
| if int_raw.err_warn_int_st().bit_is_set() | ||
| || int_raw.err_passive_int_st().bit_is_set() | ||
| || int_raw.bus_err_int_st().bit_is_set() |
There was a problem hiding this comment.
For future reference, that is TWAI_TS_COUNTER_OVFL_INT_ST on the P4
|
/hil full --test misc_drivers |
|
Triggered full HIL run for #6070. Run: https://github.com/esp-rs/esp-hal/actions/runs/31378460140 Status update: HIL (full) run is still in progress or status unknown. |
Fixes #5307
We already had an (ignored) HIL test for this issue prepared.
This also restores the async TWAI example we had before - while having non-async and async examples seems redundant, in cases like this it's useful. (i.e. the non-async example didn't show the problem)
Happy to remove one of them if requested. (ideally the non-async)
Changelog
esp-hal
esp-storage
esp-radio
esp-rom-sys
esp-phy