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

Portenta H7: extended pin list, pinNames, SPI, WIre, PWM, ADC #87

Open
wants to merge 11 commits into
base: arduino
Choose a base branch
from

Conversation

KurtE
Copy link

@KurtE KurtE commented Mar 27, 2025

This is a replacement for PR: #71 and #82.

All of the earlier commits were squashed into one. Then this was converted a few times during the #85 pr time
frame as things kept changing and moving around. It has now been updated to the released .3 version.

I started off adding in the whole pin table as defined by the MBED version, which actually contained duplicate defines. I later reduced this set such that it now longer matches the MBED version, but does still include all of the pins that have external pins on some of the breakout boards. As for compatibility, most of the documentation for these show the PIN names and not numbers, so I imported the MBED Pin name table and have the start of allowing several different operations to be done, like pinMode, digitalWrite.

We defined the additional SPI ports and Wire ports.

We defined an initial setup for Analog pins. Have similar hack to GIGA version for pure Analog. Added additional hacks for duplicated pins. That is two of the analog Pins are the exact same pin as some other digital pins...

Added some PWM support.

Also added WIP: camera support.

pillo79 and others added 5 commits April 8, 2025 15:20
Collect all warning messages from the build run and add them to the
CI run summary.
Upload the built core archive to an S3 bucket when updating branches in
the main repository.
Github Actions: build and release workflow
pillo79 and others added 5 commits April 8, 2025 17:33
Required by configure-aws-credentials to login to AWS.
'aws s3 sync' expects directories as arguments, but we are uploading a
single file. Use 'aws s3 cp' instead.
This is a replacement for PR: arduino#71 and arduino#82.

All of the earlier commits were squashed into one.  Then this was converted a few times during the arduino#85 pr time
frame as things kept changing and moving around.   It has now been updated to the released .3 version.

I started off adding in the whole pin table as defined by the MBED version, which actually contained duplicate defines.  I later reduced
this set such that it now longer matches the MBED version, but does still include all of the pins that have external pins on some of the
breakout boards. As for compatibility, most of the documentation for these show the PIN names and not numbers, so I imported the
MBED Pin name table and have the start of allowing several different operations to be done, like pinMode, digitalWrite.

We defined the additional SPI ports and Wire ports.

We defined an initial setup for Analog pins.  Have similar hack to GIGA version for pure Analog.  Added additional hacks for duplicated
pins.  That is two of the analog Pins are the exact same pin as some other digital pins...

Added some PWM support.

Also added WIP: camera support.

Co-Authored-By: Mike S <[email protected]>
@KurtE KurtE force-pushed the Portenta_h7_spi_wire_pins_plus_updated branch from f74016f to c47ea7b Compare April 8, 2025 19:15
Add PinNames for Giga as well, as I see some of the libraries like touch library
uses them with MBED to map Pin names to their actual pin
@facchinm
Copy link
Member

👋 me and @pillo79 finally had the time to check the PR and discuss about the possible problems.
To sum up, you are trying to solve the fact that mbed core and one's pin numbering is different and prevents "macros" like PinNameToIndex and digitalPinToPinName from working.
The proposal we came out with, to avoid dts pollution, would be:

  • fix the libraries we can fix, also because the PinName was often used in sync with mbed specific APIs
  • for the libraries that we can't fix, provide an external "mbed compatibility" library which would hardcode the map between mbed pin number, zephyr pin number and pin names for the supported boards, and provide the missing APIs
  • provide much better defines (like we already do for the C33) for the pins meant to be access "by functionality" (UART1_TX and so on)

About the other changes, we are going to merge them today, thank you so much!

@KurtE
Copy link
Author

KurtE commented Apr 11, 2025

👋 me and @pillo79 finally had the time to check the PR and discuss about the possible problems.
To sum up, you are trying to solve the fact that mbed core and one's pin numbering is different and prevents "macros" like PinNameToIndex and digitalPinToPinName from working.
The proposal we came out with, to avoid dts pollution, would be:
I understand. My main premise for using the pin names is, so much of your documentation and code is geared around it.

For example:
image

@facchinm
Copy link
Member

Yup, the plan is to only have the symbolic name (eg SERIAL0_RTS) by default so cross-boards compatibility will be assured

@KurtE
Copy link
Author

KurtE commented Apr 11, 2025

Understood, but at least for me, I would in probably 99% of the time not use this pin for that, more likely I would use
it as pinMode(, OUTPUT); ... in fact I am not sure that pin even has that functionality?

Looking at my Excel document for MUX for that pin, for example I don't even think it has that actual usage.
So I would prefer either the names like you show in the documents and/or pin numbers, but that is just me.

My guess is maybe do both. Can easily do it without additional stuff added to the device tree.
That is once the H7 pin table in the device tree is agreed on, then simply update the PinName table to use those numbers...

Will be great to see what you decide on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants