zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.76k stars 6.56k forks source link

can_mcan: one shot mode support #79780

Open palisows opened 1 week ago

palisows commented 1 week ago

Is your enhancement proposal related to a problem? Please describe.

Currently can_mcan doesn't support CAN_MODE_ONE_SHOT. Adding support is quite easy and might be useful in some cases when frames repetition might be an issue. Proposed change was tested on stm32 micro-controller with positive results.

can_mcan_one_shot_mode.txt

Describe the solution you'd like

Proposed changes are included in PR https://github.com/zephyrproject-rtos/zephyr/pull/79995

Describe alternatives you've considered

Additional context

henrikbrixandersen commented 1 week ago

Please submit proposed changes as a PR, linking to this issue. Have you verified the behavior of the proposed changes? I seem to recall this flag needing more handling with regards to TX callbacks.

palisows commented 1 week ago

Please submit proposed changes as a PR, linking to this issue. Have you verified the behavior of the proposed changes? I seem to recall this flag needing more handling with regards to TX callbacks.

My testing was limited only to stm32 and in my case one shot mode worked fine. It was verified on very low level - CAN_H, CAN_L lines. I didn't notice also any problems with can_tx_callback_t

henrikbrixandersen commented 1 week ago

My testing was limited only to stm32 and in my case one shot mode worked fine.

It was verified on very low level - CAN_H, CAN_L lines. I didn't notice also any problems with can_tx_callback_t

Sounds good. I have a small board farm for validating it on non-STM32 boards, so please go ahead and submit a PR - I can perform additional testing.