-
Notifications
You must be signed in to change notification settings - Fork 203
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
Add BSP for Adafruit Feather M4 CAN Express #658
base: master
Are you sure you want to change the base?
Conversation
@jboynes, using a different chip/BSP is definitely a stronger reason to have a different BSP. But it's also not a total dealbreaker to reuse the existing BSP. Other than CAN, are there any other major differences between the E51J and D51J chips? And what about the boards themselves? Are the pinouts and peripherals essentially identical between the two boards? Or is there variation there as well? We might be able to get away with some hacking in |
To my knowledge, the only difference between the D51J and E51J is the presence of the CAN module. The chip identifies differently which could affect debugging (e.g. the "chip" value in [metadata]). By default though, flashing is done using Differences on the board compared to the M4 are:
The on-board CAN transceiver uses the following pins which are unused on the basic M4:
Another advantage of having this as a separate BSP crate is that it can version separately from the feather_m4 one, especially as the |
I'm quite curious how this BSP will develop. My understanding is that you want to implement |
I don't have many opinions here 🤷. My thought was that Having more boards supported would allow more testing of the HAL and its abstractions. This PR adds a SAM E51-based board, and I've proposed adding a SAM C21 (Cortex-M0) board as well for some diversity in Microchip/Atmel devices. And of course, there are other devices using Bosch's M_CAN IP as well (e.g. the STM32G4 (cf. fdcan) and LPC5516 MCUs, or the TCAN4550 external controller). |
@jboynes, I think this case is right on the deciding line. The small board differences could be handled with I think I'll leave it up to you (and possibly anyone else who wants to weigh in). Would you prefer this as a separate BSP? If so, we can merge it. |
I think it would be preferable for now, because:
There's not a lot of production code to maintain in the BSP itself. I think most of the maintenance work would be in tracking dependencies. Ideally, the BSP would only define devices on the board and the pin mappings that connect to them; things that are board specific, and only things that are board specific. I will explore if there's a way to refactor this to reduce the duplication. I'll take a look at unifying with the |
Summary
Adds a BSP for the Adafruit Feather M4 CAN Express board.
Blinky, Neopixel and USB examples have been tested on actual hardware.
There was some discussion in #622 about using features for CAN support rather than adding a new BSP. However, as this board uses a SAME51 part (rather than the SAMD on the M4 Express) I thought it made sense to keep it separate as it would have dependencies on a different PAC.
The CAN module is not yet exposed in the BSP. My intention would be to support the
embedded_can
HAL using themcan
crate (cf. #654).Checklist
CHANGELOG.md
for the BSP or HAL updatedIf Adding a new Board
crates.json