-
Notifications
You must be signed in to change notification settings - Fork 1.3k
stm/boards: Add support for SparkFun STM32 MicroMod Processor board. #5060
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
stm/boards: Add support for SparkFun STM32 MicroMod Processor board. #5060
Conversation
@stonehippo and @nitz have added the other boards. I'd love to see consistent pin naming across the boards. |
PID request (not sure if there is a more "official" way to request these from SparkFun): |
86c5726
to
ef47b4c
Compare
I'm ok if you want to get them all consistently named. We can say it's something changing with 7. |
@tannewt sounds good, I'll work on some changes to the other MicroMod board definitions to get everything consistently named. Couple questions:
|
Here is fine.
No date specifically. |
b886f19
to
c2f8056
Compare
c2f8056
to
c0902da
Compare
@tannewt @stonehippo @nitz I updated this PR to include an attempt at consistent pin names for all the existing MicroMod board definitions. The table below shows the standard MicroMod primary and alternate pin names I'm using:
For the I2C, SPI, and UART peripherals, I wasn't sure if it was preferable to omit the peripheral type prefixes or leave them more consistent with the MicroMod spec (e.g. Also, since there are lots of existing CircuitPython tutorials that use the default peripheral pin names (e.g. One other thing worth noting: I updated the board names to include "Processor" (e.g. "SparkFun STM32 MicroMod Processor") and restricted the pin definitions to those specific to each processor module. Since we don't really know which "Carrier Board" a processor module could be plugged into, I'm not sure if it makes sense to define pin aliases for the carrier boards. I don't have access to all the MicroMod processor hardware modules, so if you have the hardware and can get a chance to do some sanity check testing on this PR, I'd appreciate it. |
Fantastic work, @cdwilson — I've got some stuff on my plate this week but if I can get some spare time I'll check vs the modules I have :) |
One area I'd like some closer review is the audio pin definitions. I haven't done anything with audio on any of these MCUs, so I'm not as familiar with these pins. I took a simple approach of defining the pins for each interface if all the pins for that interface were exposed on the M.2 edge connector. So, for example, on the STM32 processor, |
Another thing I wanted to mention: when I added the
The exception is the RP2040 boards, which all seem to use
I just wanted to confirm whether we wanted to leave the |
I totally agree that the board shouldn't know anything about the carrier board. Your pin naming makes sense to me. I wouldn't rename any of the existing board folders because we use it as a unique id. Renaming it could lead to multiple listings or missing older listing. So, I think it's simplest to leave the board name as-is. |
Definitely on this side as well. Might be a fun exercise at some point to do some sort of "overlays" that provide per-carrier symbols for the different "common" carriers, but I'd certainly rather the boards themselves know nothing of them 🙂 |
Yeah, it would be nice if Micro/CircuitPython eventually supported something like Zephyr Shields for carrier or add-on boards. |
@tannewt I don't know if it matters, but I think the |
We don't need to support this in the core. A library would be able to provide the carrier specific functionality.
Ok, let's ignore it. I'll merge it anyway. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
This is a work-in-progress PR for supporting the SparkFun STM32 MicroMod Processor board.
This is my first attempt at adding support for a new board in CircuitPython and there are a couple areas outlined below where I would appreciate some early feedback before this is finalized.
Peripheral numbering question
When I was reviewing the SparkFun MicroMod Tech Specs, I noticed that the MicroMod spec appears to use a zero-based peripheral numbering scheme. The 0th peripheral is the default and the "0" is omitted from the peripheral name. Some examples for different types of peripherals:
UART
,UART1
,UART2
I2C
,I2C1
SPI
,SPI1
CAN
SDIO
The Designing with MicroMod tutorial seems to confirm this assumption when it discusses the UART peripheral:
However, when I reviewed the existing MicroMod board definitions in CircuitPython (sparkfun_samd51_micromod and sparkfun_nrf52840_micromod), it looks like the pin name QSTR definitions do not always conform to the MicroMod spec (they are inconsistent across boards).
For example, looking at the pin definitions for the "0th" I2C peripheral, the
sparkfun_samd51_micromod
board aliases theSDA
andSDA1
pins to the same I2C bus, while thesparkfun_nrf52840_micromod
definesSDA
andSDA1
on separate I2C busses:vs.
In this PR, I have defined the pin names strictly according to the MicroMod spec, which is also consistent with the pin definitions for this same board in micropython. Since there is some inconsistency across MicroMod boards in CircuitPython, I just wanted to confirm that adhering to the MicroMod naming convention was the preferred approach moving forward for MicroMod boards in CircuitPython. If desired, I can submit a separate PR to fix the other MicroMod board definitions to be more consistent & compliant with the MicroMod spec.
Peripheral prefix question
The MicroMod spec prefixes the pin names with the peripheral type (
I2C_
,SPI_
, etc). For example, I2C pins are namedI2C_SDA1
&I2C_SCL1
instead ofSDA1
&SCL1
.In this PR, I have defined the pin names using these explicit prefixes, but it looks like many of the existing CircuitPython board definitions don't use these prefixes for the UART, I2C, and SPI peripherals (and maybe others?). For example, the feather_stm32f405_express pin definitions don't use a prefix for I2C pins
SDA
andSCL
, but it does for SDIO pins (SDIO_CLOCK
,SDIO_COMMAND
, etc). If there is an existing convention in the CircuitPython community for when a pin definition should be prefixed with the peripheral type, I'm happy to update this PR to follow any existing convention.