From e5701966274e4f0b0513a40211ea08fe89f6bb5f Mon Sep 17 00:00:00 2001 From: Thomas Stranger Date: Sat, 19 Jul 2025 13:22:59 +0200 Subject: [PATCH 1/2] boards: st: nucleo_c071rb: fix led and button gpio configuration - The user button does not have a dedicated pull-up resistor on the board, therefore activate the internal pull-up. - The pin for LD2 does not switch the via a transistor, but directly sinks the current of the LED, therefore we need to set it active low. Signed-off-by: Thomas Stranger --- boards/st/nucleo_c071rb/nucleo_c071rb.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/st/nucleo_c071rb/nucleo_c071rb.dts b/boards/st/nucleo_c071rb/nucleo_c071rb.dts index 53f72085ba59..d8f20423a428 100644 --- a/boards/st/nucleo_c071rb/nucleo_c071rb.dts +++ b/boards/st/nucleo_c071rb/nucleo_c071rb.dts @@ -30,7 +30,7 @@ }; blue_led: led_2 { - gpios = <&gpioc 9 GPIO_ACTIVE_HIGH>; + gpios = <&gpioc 9 GPIO_ACTIVE_LOW>; label = "User LD2"; }; }; @@ -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 = ; }; From 47a220ea493aadcde83ebac3fa01231bc5faee79 Mon Sep 17 00:00:00 2001 From: Thomas Stranger Date: Sat, 19 Jul 2025 13:36:02 +0200 Subject: [PATCH 2/2] boards: st: nucleo_c071rb: move spi pins to arduino header This commit changes the spi1 pins to pa15, pa5, pa6, pa7. The SPI instance has been declared as arduino_spi, but different pins have been used. As I2C2 was also using the pins pa6, pa7, I2C2 is remapped to pb13, pb14 - two pins next to each other on the st morpho connector CN10. Signed-off-by: Thomas Stranger --- boards/st/nucleo_c071rb/doc/index.rst | 5 +++-- boards/st/nucleo_c071rb/nucleo_c071rb.dts | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/boards/st/nucleo_c071rb/doc/index.rst b/boards/st/nucleo_c071rb/doc/index.rst index 4cbeeb2e2509..741349431b39 100644 --- a/boards/st/nucleo_c071rb/doc/index.rst +++ b/boards/st/nucleo_c071rb/doc/index.rst @@ -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 diff --git a/boards/st/nucleo_c071rb/nucleo_c071rb.dts b/boards/st/nucleo_c071rb/nucleo_c071rb.dts index d8f20423a428..80abcde773a6 100644 --- a/boards/st/nucleo_c071rb/nucleo_c071rb.dts +++ b/boards/st/nucleo_c071rb/nucleo_c071rb.dts @@ -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 = ; }; &spi1 { - pinctrl-0 = <&spi1_nss_pb0 &spi1_sck_pb3 - &spi1_miso_pb4 &spi1_mosi_pb5>; + /* Note: PA5 is shared with green led0 */ + pinctrl-0 = <&spi1_nss_pa15 &spi1_sck_pa5 + &spi1_miso_pa6 &spi1_mosi_pa7>; pinctrl-names = "default"; status = "okay"; };