From 5c07c6121b50b84026c01d0f7e96bd8100547d11 Mon Sep 17 00:00:00 2001 From: kurte Date: Mon, 27 Jan 2025 10:27:37 -0800 Subject: [PATCH 1/2] Update arduino_nano_r3_connector.dtsi for pins 7,8,18,19,21 To match the pins as shown on the pinout page for the NANO 33 BLE SENSE Tested with simple Arduino sketch: ``` int blink_pin = 2; void setup() { pinMode(LED_BUILTIN, OUTPUT); for (uint8_t i=0; i < 4; i++) { digitalWrite(LED_BUILTIN, HIGH); delay(100); digitalWrite(LED_BUILTIN, LOW); delay(100); } pinMode(LED_BUILTIN, INPUT); Serial.begin(115200); while (!Serial) {} Serial.println("Quick blink pin test"); Serial.println (blink_pin); pinMode(blink_pin, OUTPUT); Serial.print("LED_BUILTIN: "); Serial.println(LED_BUILTIN); } void loop() { digitalWrite(blink_pin, HIGH); delay(250); digitalWrite(blink_pin, LOW); delay(250); if (Serial.available()) { int new_pin = Serial.parseInt(); while (Serial.read() != -1) { pinMode(blink_pin, INPUT); blink_pin = new_pin; pinMode(blink_pin, OUTPUT); Serial.print("New pin: "); Serial.println(blink_pin); } } } ``` Where you can type in a pin number and then jumper that pin to D13 and it should blink the LED. Fixed it for most of these pins, although 18 and 19 have issue with not blinking as zephyr has those pins in use. --- .../arduino/nano_33_ble/arduino_nano_r3_connector.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi b/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi index 21a98b50407bc..bf0ff0235a3d6 100644 --- a/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi +++ b/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi @@ -16,8 +16,8 @@ <4 0 &gpio1 15 0>, /* D4 */ <5 0 &gpio1 13 0>, /* D5 */ <6 0 &gpio1 14 0>, /* D6 */ - <7 0 &gpio0 9 0>, /* D7 */ - <8 0 &gpio0 10 0>, /* D8 */ + <7 0 &gpio0 23 0>, /* D7 */ + <8 0 &gpio0 21 0>, /* D8 */ <9 0 &gpio0 27 0>, /* D9 */ <10 0 &gpio1 2 0>, /* D10 */ <11 0 &gpio1 1 0>, /* D11 / SPI-MOSI */ @@ -27,10 +27,10 @@ <15 0 &gpio0 5 0>, /* D15 / A1 */ <16 0 &gpio0 30 0>, /* D16 / A2 */ <17 0 &gpio0 29 0>, /* D17 / A3 */ - <18 0 &gpio0 14 0>, /* D18 / A4 / I2C-SDA */ - <19 0 &gpio0 15 0>, /* D19 / A5 / I2C-SCL */ + <18 0 &gpio0 31 0>, /* D18 / A4 / I2C-SDA */ + <19 0 &gpio0 2 0>, /* D19 / A5 / I2C-SCL */ <20 0 &gpio0 28 0>, /* D20 / A6 */ - <21 0 &gpio1 3 0>; /* D21 / A7 */ + <21 0 &gpio0 3 0>; /* D21 / A7 */ }; }; From fc2bdf558c727fc96859b9aa0e13df9f126f5af5 Mon Sep 17 00:00:00 2001 From: kurte Date: Mon, 27 Jan 2025 10:30:48 -0800 Subject: [PATCH 2/2] nano_33_ble - Default the Power pin to on This matches the sate of the LED if you run it on MBED. Note: wondering if the led defines in some of the dtsi files should be renamed from user to PWR to match what is shown in the pinout for these boards. But maybe used elsewhere for USER, like maybe maybe python? --- boards/arduino/nano_33_ble/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/arduino/nano_33_ble/board.c b/boards/arduino/nano_33_ble/board.c index 10fd95e74cca6..5f6b14645f1cb 100644 --- a/boards/arduino/nano_33_ble/board.c +++ b/boards/arduino/nano_33_ble/board.c @@ -29,7 +29,7 @@ static int board_init(void) return res; } - return gpio_pin_configure_dt(&user_led, GPIO_OUTPUT_INACTIVE); + return gpio_pin_configure_dt(&user_led, GPIO_OUTPUT_HIGH); } SYS_INIT(board_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);