Skip to content

Conversation

@JeremyBCD
Copy link
Contributor

Adds support for CAN/CANFD for the STM32H7 series. Tested working on NUCLEO-H753 and proprietary hardware.

Builds on the existing m_can driver, fixed some issues in the generic implementation.

@alexanderwachter
Copy link
Member

Looks good, but we need to find some more generic way to handle the msg_ram addressing. The Bosch m_can (i.e. used in Microchip SAM) addresses the msg_sram like it is in the current implementation.

@JeremyBCD JeremyBCD force-pushed the stm32h7-fdcan branch 2 times, most recently from 9fc3b26 to 49d188d Compare January 3, 2022 23:33
@JeremyBCD
Copy link
Contributor Author

Looks good, but we need to find some more generic way to handle the msg_ram addressing. The Bosch m_can (i.e. used in Microchip SAM) addresses the msg_sram like it is in the current implementation.

I've added options to choose between absolute (SAME-style) and relative (STM32H7 and NXP-style) addressing for Message RAM.

Based on what @henrikbrixandersen is doing in #35832, should be easy to slot in his #ifdef as well.

@henrikbrixandersen henrikbrixandersen self-requested a review January 3, 2022 23:38
@JeremyBCD JeremyBCD force-pushed the stm32h7-fdcan branch 2 times, most recently from 92bdf8c to ccd0196 Compare January 3, 2022 23:46
@JeremyBCD
Copy link
Contributor Author

I think that I've covered everything at this point, unless we're unhappy with the handling of message_ram addresses. Just finished adopting the clock_control API, believe that I've embraced that as much as is currently possible.

@erwango
Copy link
Member

erwango commented Jan 12, 2022

@henrikbrixandersen, @alexanderwachter, @gmarull can you have a new look ?

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

Only two minor issues:

@JeremyBCD
Copy link
Contributor Author

Thanks @gmarull for your review!

Copy link
Member

@henrikbrixandersen henrikbrixandersen left a comment

Choose a reason for hiding this comment

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

🥳

Copy link
Contributor

@mbolivar-nordic mbolivar-nordic left a comment

Choose a reason for hiding this comment

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

ACK on the binding

Copy link
Member

@alexanderwachter alexanderwachter left a comment

Choose a reason for hiding this comment

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

Sorry for being pedantic.
Otherwise LGTM!

* New m_can driver variant for STM32H7, as it uses the complete m_can
register set.
* Fix definitions for CAN_MCAN_RXF0S_F0FL, CAN_MCAN_TXEFC_EFSA_POS.

Signed-off-by: Jeremy Wood <[email protected]>
* Add can peripheral to stm32h7.dtsi.
* Add binding for m_can stm32h7 driver.

Signed-off-by: Jeremy Wood <[email protected]>
* Enable and configure can1 for nucleo_h743/753.
* Update documentation.

Signed-off-by: Jeremy Wood <[email protected]>
Copy link
Member

@alexanderwachter alexanderwachter left a comment

Choose a reason for hiding this comment

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

Thanks for this work!

@nashif nashif merged commit 9d346cc into zephyrproject-rtos:main Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants