-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
stm32/boards: Standardize pin names to always have P{PORT}{NUMBER} available #13664
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
base: master
Are you sure you want to change the base?
Conversation
I initially thought there were only 2 boards missing them, but then decided to check and... there's more. cd ports/stm32/boards
for board in $boards; do
grep -E "^(PA[0-9]+)*,PA[0-9]+" $board/pins.csv > /dev/null;
has_pa0=$?;
echo $has_pa0 $board | grep NUCLEO;
done Where |
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
But keep the CNX_Y notation to prevent breaking code. Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
But keep the CNX_Y notation to prevent breaking code. Signed-off-by: Asensio Lorenzo Sempere <asensio.aerospace@gmail.com>
fa107cc
to
613223d
Compare
The Pin name scheme is indeed not consistent across the STM32 boards. Some use e.g. PAxx, some use Axx, some use both. Taking the Pyboard devices as reference, it should be Axx, ..... But enforcing a common scheme may break existing code. So first a decision must be made about how to proceed. |
This is a known issue with the stm32 port, CPU pins names should match the datasheet, but in the stm32 port the "P" prefix was removed to save code space, so boards use a workaround by redefining |
I could be totally biased by only having used MicroPython on STM32 Nucleo boards, but, here was my thought: On many Nucleo 64 boards (see UM1724, starting page 28, but there's other with different layouts) there is an Arduino header on each side of the board, with pins named A0 to A5 (left) and D0 to D15 (right). I had previously only initialize pins using the However, I have also recently learned that I could access the CPU pins from TLDR; This change shouldn't break anyone's code, it just makes sure all STM32 Nucleo boards can have their pins consistently initialized using |
I understand this is a non-breaking change, and I also would like to keep |
I noticed that some STM32 Nucleo boards were missing the PA0 notation that is used by machine.Pin to control GPIO pins.
I have added those pins to the pins.csv of the boards that were missing them.
I have not checked that all of the pins are externally exposed, only that they were on the second column (and, of course, removed duplicates).