Skip to content
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

Microchip vendor files migration process #20457

Open
dylad opened this issue Mar 12, 2024 · 0 comments
Open

Microchip vendor files migration process #20457

dylad opened this issue Mar 12, 2024 · 0 comments
Labels
Community: help wanted The contributors require help from other members of the community

Comments

@dylad
Copy link
Member

dylad commented Mar 12, 2024

It is time again to upgrade our Microchip vendor files for our supported SAM0 devices. Unfortunately this time, things will be a little bit more trickier than before as Microchip decided to rework their vendor files:

  • Support for structures bitfields dropped.
  • Peripheral structures now utilize u8, u16, u32 registers instead of individual register structures (due to the drop of bitfields support).
  • Peripherals structure were also renamed (At least they are no longer in camel case so they fit our coding convention yay!)
  • Numerous small changes that will require tedious adjustments.

So why should we do it ?
Because bug fixes, new silicon version added, but above all, to be able to add support for new families of microcontrollers from Microchip.

Migration plan:

  • Option 1
    Create a dedicated branch on RIOT-OS/RIOT repo, push all changes there kindly, and create a gigantic PR that will be painful funny to review.
    Obviously, this is something I'd like to avoid.
  • Option 2:
    Proceed by smaller steps across several releases even if it will increase the overall amount of work.
    To do so, I propose the following steps:
    • Eliminate all usage of bitfields in our codebase.
    • Develop wrappers/macros to maintain backward compatibility for register access in all board and peripheral drivers (although this is not enjoyable).
    • Introduce new vendor headers into cpu/sam0_common/include/vendor_ng (these will NOT be included in compilation yet).
    • Gradually migrate each family to observe issues and address them diligently.
    • Remove old vendor headers.
    • Undo all changes related to register access modifications.

I am well aware, this will add significant amount of work but IMO, this is the price to pay to keep PR size reasonable. This will also prevent issue for people maintaining boards outside of the tree through EXTERNAL_BOARD_DIRS

For those curious about the changes, you will find all Microchip atpack here

Download the archive of any supported family, and compare the content of the include/ folder against cpu/sam0_common/include/vendor/XXXX

Obviously, all of this is debatable, and I'll take all ideas to reduce this burden.

@dylad dylad added the Community: help wanted The contributors require help from other members of the community label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: help wanted The contributors require help from other members of the community
Projects
None yet
Development

No branches or pull requests

1 participant