From 839e9dd5abb2f7aca05212c47f82f662ebb48087 Mon Sep 17 00:00:00 2001 From: Kurt Eckhardt Date: Sun, 30 Mar 2025 13:48:33 -0700 Subject: [PATCH 1/3] WIP - Add pins to pintable, matches docs and MBED, Trying to add Serials... Added most if not all of the lower level pins to the variant That matches the MBED version up till part that says internal only... Added some Serial defines, but so far none of them appear to work --- ...arduino_portenta_c33_r7fa6m5bh3cfc.overlay | 130 +++++++++++++++++- 1 file changed, 128 insertions(+), 2 deletions(-) diff --git a/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay b/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay index 277229f7..acb9d52f 100644 --- a/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay +++ b/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay @@ -22,6 +22,61 @@ }; }; +&pinctrl { + sci7_default: sci7_default { + group1 { + /* tx rx */ + psels = , + , + , + ; + }; + }; + sci6_default: sci6_default { + group1 { + /* tx rx */ + psels = , + , + , + ; + }; + }; + +}; + + +&sci7 { + pinctrl-0 = <&sci7_default>; + pinctrl-names = "default"; + status = "okay"; + + uart7: uart { + status = "okay"; + current-speed = <115200>; + }; +}; + +&sci6 { + status = "okay"; + pinctrl-0 = <&sci6_default>; + pinctrl-names = "default"; + + uart6: uart { + status = "okay"; + current-speed = <115200>; + }; +}; + +&sci5 { + status = "okay"; + + uart5: uart { + status = "okay"; + current-speed = <115200>; + }; +}; + + / { zephyr,user { digital-pin-gpios = <&ioport1 5 GPIO_ACTIVE_HIGH>, @@ -64,7 +119,78 @@ <&ioport1 7 GPIO_ACTIVE_HIGH>, // LEDR <&ioport4 0 GPIO_ACTIVE_HIGH>, - <&ioport8 0 GPIO_ACTIVE_HIGH>; + <&ioport8 0 GPIO_ACTIVE_HIGH>, + + // I2C pins + <&ioport5 11 GPIO_ACTIVE_HIGH>, /* D37 | SDA1 */ + <&ioport5 12 GPIO_ACTIVE_HIGH>, /* D38 | SCL1 */ + <&ioport3 2 GPIO_ACTIVE_HIGH>, /* D39 | SDA2 */ + <&ioport3 1 GPIO_ACTIVE_HIGH>, /* D40 | SCL2 */ + + // CAN pins + <&ioport2 2 GPIO_ACTIVE_HIGH>, /* D41 | CAN RX */ + <&ioport2 3 GPIO_ACTIVE_HIGH>, /* D42 | CAN TX */ + <&ioport6 10 GPIO_ACTIVE_HIGH>, /* D43 | CAN1 RX */ + <&ioport6 9 GPIO_ACTIVE_HIGH>, /* D44 | CAN1 TX */ + + // SPI pins + <&ioport1 0 GPIO_ACTIVE_HIGH>, /* D45 | MISO1 */ + <&ioport1 1 GPIO_ACTIVE_HIGH>, /* D46 | MOSI1 */ + <&ioport1 2 GPIO_ACTIVE_HIGH>, /* D47 | SCLK1 */ + <&ioport1 3 GPIO_ACTIVE_HIGH>, /* D48 | CS1 */ + + // UART pins + <&ioport6 13 GPIO_ACTIVE_HIGH>, /* D49 | TX2 */ + <&ioport6 14 GPIO_ACTIVE_HIGH>, /* D50 | RX2 */ + <&ioport6 11 GPIO_ACTIVE_HIGH>, /* D51 | RTS2 */ + <&ioport4 4 GPIO_ACTIVE_HIGH>, /* D52 | CTS2 */ + <&ioport5 6 GPIO_ACTIVE_HIGH>, /* D53 | TX3 */ + <&ioport3 4 GPIO_ACTIVE_HIGH>, /* D54 | RX3 */ + <&ioport5 3 GPIO_ACTIVE_HIGH>, /* D55 | RTS3 */ + <&ioport5 2 GPIO_ACTIVE_HIGH>, /* D56 | CTS3 */ + <&ioport8 5 GPIO_ACTIVE_HIGH>, /* D57 | TX4 */ + <&ioport5 13 GPIO_ACTIVE_HIGH>, /* D58 | RX4 */ + <&ioport5 8 GPIO_ACTIVE_HIGH>, /* D59 | RTS4 */ + <&ioport5 5 GPIO_ACTIVE_HIGH>, /* D60 | CTS4 */ + <&ioport6 3 GPIO_ACTIVE_HIGH>, /* D61 | RTS0 */ + <&ioport6 4 GPIO_ACTIVE_HIGH>, /* D62 | CTS0 */ + + // SSI (Audio) + <&ioport1 12 GPIO_ACTIVE_HIGH>, /* D63 | SSI CK */ + <&ioport1 13 GPIO_ACTIVE_HIGH>, /* D64 | SSI WS */ + <&ioport1 14 GPIO_ACTIVE_HIGH>, /* D65 | SSI SDI */ + <&ioport1 15 GPIO_ACTIVE_HIGH>, /* D66 | SSI SDO */ + + // Generic GPIO pins + <&ioport9 8 GPIO_ACTIVE_HIGH>, /* D67 | */ + <&ioport4 3 GPIO_ACTIVE_HIGH>, /* D68 | */ + <&ioport9 1 GPIO_ACTIVE_HIGH>, /* D69 | */ + <&ioport6 12 GPIO_ACTIVE_HIGH>, /* D70 | */ + <&ioport3 12 GPIO_ACTIVE_HIGH>, /* D71 | */ + <&ioport3 13 GPIO_ACTIVE_HIGH>, /* D72 | */ + <&ioport3 14 GPIO_ACTIVE_HIGH>, /* D73 | */ + <&ioporta 1 GPIO_ACTIVE_HIGH>, /* D74 | */ + <&ioporta 8 GPIO_ACTIVE_HIGH>, /* D75 | */ + <&ioporta 9 GPIO_ACTIVE_HIGH>, /* D76 | */ + <&ioporta 10 GPIO_ACTIVE_HIGH>, /* D77 | */ + <&ioport5 7 GPIO_ACTIVE_HIGH>, /* D78 | */ + <&ioportb 0 GPIO_ACTIVE_HIGH>, /* D79 | */ + <&ioport6 15 GPIO_ACTIVE_HIGH>, /* D80 | */ + <&ioport0 3 GPIO_ACTIVE_HIGH>, /* D81 | */ + <&ioport0 7 GPIO_ACTIVE_HIGH>, /* D82 | */ + <&ioport0 8 GPIO_ACTIVE_HIGH>, /* D83 | */ + + // SDCARD + <&ioport4 13 GPIO_ACTIVE_HIGH>, /* D84 | SDHI CLK */ + <&ioport4 12 GPIO_ACTIVE_HIGH>, /* D85 | SDHI CMD */ + <&ioport4 11 GPIO_ACTIVE_HIGH>, /* D86 | SDHI D0 */ + <&ioport4 10 GPIO_ACTIVE_HIGH>, /* D87 | SDHI D1 */ + <&ioport2 6 GPIO_ACTIVE_HIGH>, /* D88 | SDHI D2 */ + <&ioport2 5 GPIO_ACTIVE_HIGH>, /* D89 | SDHI D3 */ + <&ioport4 15 GPIO_ACTIVE_HIGH>, /* D90 | SDHI CD */ + <&ioport4 14 GPIO_ACTIVE_HIGH>; /* D91 | SDHI WP */ + + builtin-led-gpios = <&ioport1 7 GPIO_ACTIVE_LOW>, <&ioport4 0 GPIO_ACTIVE_LOW>, @@ -72,7 +198,7 @@ pwm-pin-gpios = <&ioport6 0 0>; - serials = <&board_cdc_acm_uart>, <&uart9>; + serials = <&board_cdc_acm_uart>, <&uart9>, <&uart7>, <&uart6>, <&uart5>; cdc-acm = <&board_cdc_acm_uart>; i2cs = <&iic1>; spis = <&spi1>; From 400c3b884d7625483b018c55cb9639d7fe820c66 Mon Sep 17 00:00:00 2001 From: Kurt Eckhardt Date: Sun, 6 Apr 2025 13:41:33 -0700 Subject: [PATCH 2/3] Update arduino_portenta_c33_r7fa6m5bh3cfc.overlay Remove the pinctrls from SCI7 and 6. 7 is correct in zephyr, 6 needs PR to be applied. --- ...arduino_portenta_c33_r7fa6m5bh3cfc.overlay | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay b/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay index acb9d52f..62e5ae62 100644 --- a/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay +++ b/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay @@ -22,28 +22,6 @@ }; }; -&pinctrl { - sci7_default: sci7_default { - group1 { - /* tx rx */ - psels = , - , - , - ; - }; - }; - sci6_default: sci6_default { - group1 { - /* tx rx */ - psels = , - , - , - ; - }; - }; - -}; - &sci7 { pinctrl-0 = <&sci7_default>; @@ -69,6 +47,8 @@ &sci5 { status = "okay"; + pinctrl-0 = <&sci5_default>; + pinctrl-names = "default"; uart5: uart { status = "okay"; From 8692476ef62276998f69524d751954fa1108aeac Mon Sep 17 00:00:00 2001 From: Kurt Eckhardt Date: Mon, 7 Apr 2025 11:38:04 -0700 Subject: [PATCH 3/3] Update arduino_portenta_c33_r7fa6m5bh3cfc.overlay Add Wire (iic0 )object to overlay --- ...arduino_portenta_c33_r7fa6m5bh3cfc.overlay | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay b/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay index 62e5ae62..ebf65a91 100644 --- a/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay +++ b/variants/arduino_portenta_c33_r7fa6m5bh3cfc/arduino_portenta_c33_r7fa6m5bh3cfc.overlay @@ -56,6 +56,29 @@ }; }; +&pinctrl { + iic0_default: iic0_default { + group1 { + /* SCL0 SDA0 */ + psels = , + ; + drive-strength = "medium"; + }; + }; +}; + +&iic0 { + status = "okay"; + #address-cells = <1>; + #size-cells = <0>; + interrupts = <87 1>, <88 1>, <89 1>, <90 1>; + interrupt-names = "rxi", "txi", "tei", "eri"; + clock-frequency = ; + pinctrl-0 = <&iic0_default>; + pinctrl-names = "default"; +}; + + / { zephyr,user { @@ -180,7 +203,7 @@ serials = <&board_cdc_acm_uart>, <&uart9>, <&uart7>, <&uart6>, <&uart5>; cdc-acm = <&board_cdc_acm_uart>; - i2cs = <&iic1>; + i2cs = <&iic0>, <&iic1>; spis = <&spi1>; pwms = <&pwm6 1 PWM_HZ(25000000) PWM_POLARITY_NORMAL>; };