boards/common/nucleo144: fix and complete Arduino configuration#21665
Conversation
|
@maribu I'm a little bit confused with the defines of From my understanding, these macros should define the mapping of the corresponding Arduino pins to the configured devices. Therefore I'm wondering whether the definitions shouldn't be #define ARDUINO_UART_D0D1 UART_DEV(1)
#define ARDUINO_I2C_UNO I2C_DEV(1)because the Arduino pins D0/D1 are connected to the GPIOs configured for |
|
Hmm, I actually testes this with the Peripheral Selftesting shield for some Nucleo 64 boards. It could be that the UART test is skipped, if the D0/D1 UART is also used for stdio, though. But at least I2C was definitely correct for the boards I ran the tests on at the time of the PR. Maybe the periph_conf has changed in the meantime without updating the I/O mapping? The mapping should definitely match the standard Arduin UNO position, otherwise making use of the same shield across boards with the same app will not work. |
|
@gschorcht I have not tested this yet. I couls do so tomorrow with the self-testing shield, but if you feel confident, feel free to just hit the green button. |
crasbe
left a comment
There was a problem hiding this comment.
I don't have any of the Nucleos in question for testing.
#define ARDUINO_I2C_UNO I2C_DEV(0)is correct, of course. But, GPIOs for D14 and D15 were definitely mixed up. Did you also test it with any Nucleo144 boards? |
Okay, I checked again: On all Nucleo-64 boards, #define ARDUINO_UART_D0D1 UART_DEV(0)is correct. But, for all Nucleo-144 boards Arduino pins D0 and D1 correspond to #define ARDUINO_UART_D0D1 UART_DEV(1) |
Oops, I forgot to remove the two spaces 😎 too bad. |
On Nucleo144 boards for L4, L5, U5 Arduino connector pins D0/D1 have a different configuration. According to the User manuals for - [L4 boards]( https://www.st.com/resource/en/user_manual/um2179-stm32-nucleo144-boards-mb1312-stmicroelectronics.pdf), D0/D1 are GPIOs PD9/PD8 - [L5 boards](https://www.st.com/resource/en/user_manual/um2581-stm32l5-nucleo144-board-mb1361-stmicroelectronics.pdf), D0/D1 are GPIOs PD9/PD8 - [U5 boards](https://www.st.com/resource/en/user_manual/um2861-stm32u5-nucleo144-board-mb1549-stmicroelectronics.pdf), D0/D1 are GPIOs PG8/PG7
According to user manuals the pin configuration for Arduino pins D14/D15 is PB9/PB8. The configuration was mixed up. Furthermore, I2C_DEV(1) is configured correclty with SDA=PB9 and SCL=PB8 that have to be mapped to Arduino pins D14=SDA and D15=SCL, respectively, to be compatibly with Arduino shields.
db002fe to
43cf29d
Compare
|
Thanks for reviewing and approving. |
Nucleo144 boards for L5 and U5 have a completely different analog pin configuration. It's a very small change, but due to style changes it seems like a big change. In fact, the configuration has been changed just by adding an #ifdef ... #else ... #end and the six analog pins for L5 and U5 boards.
43cf29d to
b889024
Compare
Contribution description
This PR includes some fixes of Arduino pin configurations for Nucleo144 boards with L4, L5 and U5 and completes the Arduino configuration for I2C, SPI, and UART devices of Nucleo144 boards.
In detail:
I2C_DEV(1)uses PB9 as SDA and PB8 as SCL signals that have to be mapped to Arduino pins D14=SDA and D15=SCL, respectively, to be compatibly with Arduino shields.ARDUINO_UART_D0D1,ARDUINO_SPI_D11D12D13and ARDUINO_I2C_UNO` as well as the corresponding features were added.Testing procedure
t.b.d
Issues/PRs references