David-OConnor / stm32-hal

This library provides access to STM32 peripherals in Rust.
MIT License
147 stars 44 forks source link

Add support for g4 can2 and can3 #101

Closed pietgeursen closed 2 months ago

pietgeursen commented 2 months ago

This PR adds CAN2 and CAN3 support for the G4 devices.

I have tested that FDCAN2 does actually send can frames. I haven't done more in-depth tests of FDCAN2 yet, or tested FDCAN3 but I feel like it's safe to assume that stuff will work.

The datasheet is a bit misleading. Table 3 would make you think the message ram is divided into 1K blocks.

image

But actually the blocks are smaller:

image
David-OConnor commented 2 months ago

Great stuff. Of note, I use G4 with CAN a lot, but I unfortunately, the transceiver is wired to CAN1 on all the boards, so can't help test.

David-OConnor commented 2 months ago

Is this now ready for review?

pietgeursen commented 2 months ago

Yep!

On Thu, 2 May 2024, 6:50 am David-OConnor, @.***> wrote:

Is this now ready for review?

— Reply to this email directly, view it on GitHub https://github.com/David-OConnor/stm32-hal/pull/101#issuecomment-2088916802, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQRI6WL2LQBFSDI23245TDZAE2P3AVCNFSM6AAAAABG5WHF7GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBYHEYTMOBQGI . You are receiving this because you authored the thread.Message ID: @.***>

David-OConnor commented 2 months ago

Great stuff; well-researched.