Skip to content

boards: st nucleo c071rb fix LED, Button, SPI configuration #93351

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions boards/st/nucleo_c071rb/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ Default Zephyr Peripheral Mapping:
- I2C1 SCL/SDA : PB8/PB9 (Arduino I2C)
- LD1 : PA5
- LD2 : PC9
- SPI1 NSS/SCK/MISO/MOSI : PA4/PA5/PA11/PA12 (Arduino SPI)
- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual Port Com)
- SPI1 NSS/SCK/MISO/MOSI : PA15/PA5/PA6/PA7 (Arduino SPI)
- UART_1 TX/RX : PB6/PB7 (Arduino Serial)
- UART_2 TX/RX : PA2/PA3 (ST-Link Virtual COM Port)
- USER_PB : PC13


Expand Down
11 changes: 6 additions & 5 deletions boards/st/nucleo_c071rb/nucleo_c071rb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
};

blue_led: led_2 {
gpios = <&gpioc 9 GPIO_ACTIVE_HIGH>;
gpios = <&gpioc 9 GPIO_ACTIVE_LOW>;
label = "User LD2";
};
};
Expand All @@ -48,7 +48,7 @@

user_button: button {
label = "user button";
gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
gpios = <&gpioc 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
status = "okay";
zephyr,code = <INPUT_KEY_0>;
};
Expand Down Expand Up @@ -128,15 +128,16 @@
};

&i2c2 {
pinctrl-0 = <&i2c2_scl_pa7 &i2c2_sda_pa6>;
pinctrl-0 = <&i2c2_scl_pb13 &i2c2_sda_pb14>;
pinctrl-names = "default";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
};

&spi1 {
pinctrl-0 = <&spi1_nss_pb0 &spi1_sck_pb3
&spi1_miso_pb4 &spi1_mosi_pb5>;
/* Note: PA5 is shared with green led0 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test will fail when the SCK pin is connected to PA5 because it shares the pin with led0.

Besides PA6 and PA7 are also shared with I2C2 node.

I suggest keeping the current configuration and update documentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh thanks, I overlooked the i2c2, as I didn't add that to the nucleo_c091rc.
But I still think the SPI should be mapped to the arduino header, otherwise no arduino uno shield can be used with SPI(w/o manually wiring it up, which is not really practicalbe).
What do you think about the current proposal of moving the I2C2 to the morpho header. As such shields with SPI can be used as long as the button is not used at the same time?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I understand you thoughts ,

To align with your proposal, i suggest you please to create a new commits with the following changes :

These changes will help avoid regressions in the related tests.

pinctrl-0 = <&spi1_nss_pa15 &spi1_sck_pa5
&spi1_miso_pa6 &spi1_mosi_pa7>;
pinctrl-names = "default";
status = "okay";
};
Expand Down