Skip to content

Fdcan fixes #796

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Fdcan fixes #796

wants to merge 4 commits into from

Conversation

willcrozi
Copy link

Hi, this is my attempt at fixing some FDCAN related issues, primarily I was interested in H735 but as I worked on this I realised the fixes applied to multiple devices.

  • FDCAN: new base peripheral for non-TTCAN FDCAN peripherals
    This gets rid of the derived FDCAN2 (SVD has lots of TTCAN registers in FDCAN2 that don't exist in hardware). Instead it copies FDCAN1 and deletes the TTCAN registers. Due to the inconsistent naming for FDCAN1 (aka TT_CAN in some SVDs) and restrictions from the way YAML patches get applied, I've needed to change/add some files in common_patches/. Hopefully it makes sense.

  • H735: add missing FDCAN3 peripheral
    This derives from FDCAN2 to add a third FDCAN peripheral for H735

  • MP1: update reference manual URLs
    Thrown in here to avoid a separate pull request

  • H7B3: fix FDCAN CCU registers
    H7B3 SVD has loads of TTCAN registers instead of the correct CCU ones, so this just removes them all and adds the correct ones back. The patch is based on H735 patched SVD and checked against reference manual with a couple of errors fixed. It may be worth applying this to all devices with a CAN CCU (at least H7xx and MP1xx seem to have identical CCUs).

Feedback appreciated!

@github-actions
Copy link

Memory map comparison

@github-actions
Copy link

Memory map comparison

@burrbull
Copy link
Member

burrbull commented Jul 7, 2024

Please, rebase on master branch. Is this ready to review?

@willcrozi
Copy link
Author

Sure, I'll take some time to refamiliarise myself with the project and go over the conflicts with master. It's been a while!

Copy link

Memory map comparison

@willcrozi
Copy link
Author

I think this is ready to start reviewing. I'm thinking to do changelog once we know the final contents for merging.

A couple of points:

  • I've not been able to test on hardware, these changes are checked against hardware reference manuals
  • The CCU (Calibration configuration unit) changes are only applied to H7B3 but it might make sense to apply to other (all?) FDCAN devices. I can look into this when I can find time (hopefully soon).

Instead of deriving FDCAN2 from FDCAN1 (resulting in redundant
TTCAN registers), create a new base peripheral without TTCAN
registers.

Also fixes incorrect FDCAN interrupts on H72x/H73x
Copy link

Memory map comparison

@willcrozi
Copy link
Author

Looking through this some more I can see it still needs work, marking as draft for now

@willcrozi willcrozi marked this pull request as draft July 19, 2024 07:21
@burrbull
Copy link
Member

stm32h7 archive was updated to last version.
If you are still interested could you review and rebase your fixes?

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.

3 participants