Migration to CONFIG_PINCTRL=y UART Console problem

Hi 

I wanted to migrate to use of CONFIG_PINCTRL=y. I use UART0 as my console for log messages which works fine with the old pin definition methods. I've made the following changes and whilst it compiles I don't get any messages on the log. I can switch back and forth between the two configs and the old version works but not the new.

The changes i've made seem to match up with standard boards so i'm not sure what's going wrong?


_____________

prj.conf: only change is addition of "CONFIG_PINCTRL=y"

CONFIG_PINCTRL=y

# Enable uart driver
CONFIG_SERIAL=y

# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_LOG=y
CONFIG_PRINTK=y
CONFIG_DEBUG_THREAD_INFO=y
CONFIG_DEBUG_OPTIMIZATIONS=y

# BT
CONFIG_BT=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DIS=y
CONFIG_BT_DIS_PNP=n

CONFIG_BT_MAX_CONN=1
CONFIG_BT_L2CAP_TX_BUF_COUNT=5

CONFIG_BT_DEVICE_NAME="nRF"
CONFIG_BT_DEVICE_APPEARANCE=962

CONFIG_BT_DIS_MODEL="Zephyr Model"
CONFIG_BT_DIS_MANUF="Zephyr"
CONFIG_BT_DIS_SERIAL_NUMBER=y
CONFIG_BT_DIS_FW_REV=y
CONFIG_BT_DIS_HW_REV=y
CONFIG_BT_DIS_SW_REV=y
CONFIG_BT_DIS_SERIAL_NUMBER_STR="Zephyr Serial"
CONFIG_BT_DIS_FW_REV_STR="Zephyr Firmware"
CONFIG_BT_DIS_HW_REV_STR="Zephyr Hardware"
CONFIG_BT_DIS_SW_REV_STR="Zephyr Software"

#CONFIG_BT_CTLR_TX_PWR_MINUS_40=y

CONFIG_PM=y
CONFIG_PM_DEVICE=y
CONFIG_PM_DEVICE_RUNTIME=y

# Stack and Heap
CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

# Peripheral
CONFIG_GPIO=y

CONFIG_COUNTER=y
CONFIG_COUNTER_RTC2=y

CONFIG_I2C=y

CONFIG_PWM=y
#CONFIG_LED=y
#CONFIG_LED_PWM=y

# Date Time library
#CONFIG_DATE_TIME=y

# Enable nordic security backend and PSA APIs
CONFIG_NRF_SECURITY=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192
CONFIG_PSA_CRYPTO_DRIVER_OBERON=n
CONFIG_PSA_CRYPTO_DRIVER_CC3XX=y


CONFIG_WATCHDOG=y
CONFIG_EVENTS=y

CONFIG_HWINFO=y
CONFIG_HWINFO_NRF=y

CONFIG_FLASH=y
CONFIG_SPI=y
CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096

relevant section of board dts file old:

// Copyright (c) 2023 Nordic Semiconductor ASA
// SPDX-License-Identifier: Apache-2.0

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>

/ {
	model = "nep";
	compatible = "pc,nep";

	chosen {
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zephyr,code-partition = &slot0_partition;
	};

	switches {
		compatible = "gpio-keys";
		switch0: switch_0 {
			gpios = <&gpio0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
			label = "User Button";
		};

		switch1: switch_1 {
			gpios = <&gpio0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
			label = "Tamper Switch";
		};


	};

	powercontrol {
		compatible = "gpio-keys";
		powercontrol0: powercontrol_0 {
			gpios = < &gpio1 6 GPIO_ACTIVE_HIGH >;
			label = "VLoad Enable";
		};
	};

	motorcontrol {
		compatible = "gpio-keys";
		motorin1: motorin_1 {
			gpios = < &gpio1 3 GPIO_ACTIVE_HIGH >;
			label = "Motor Control Positive";
		};
		motorin2: motorin_2 {
			gpios = < &gpio1 4 GPIO_ACTIVE_HIGH >;
			label = "Motor Control Negative";
		};

		motorcontrolfault: motorcontrol_fault {
			gpios = <&gpio0 16 (GPIO_ACTIVE_LOW)>;
			label = "Motor Fault Detected";
		};
	};

	infraredsensor {
		compatible = "gpio-keys";
		irsensorA: irsensor_A {
			gpios = < &gpio1 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP) >;
			label = "Infrared Sensor A";
		};
		irsensorB: irsensor_B {
			gpios = < &gpio1 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP) >;
			label = "Infrared Sensor B";
		};
		
	};


	pwmleds {
		compatible = "pwm-leds";
		pwm_ledA: pwm_led_A {
			pwms = <&pwm0 0 PWM_HZ(38000) PWM_POLARITY_NORMAL>;
			label = "PWM LED A";
		};
		pwm_ledB: pwm_led_B {
			pwms = <&pwm0 1 PWM_HZ(38000) PWM_POLARITY_NORMAL>;
			label = "PWM LED B";
		};
	};

	aliases {
		// Switches
		userbutton = &switch0;
		tamperswitch = &switch1;

		// Motor Control
		motorin1 = &motorin1;
		motorin2 = &motorin2;
		motorfault = &motorcontrolfault;

		// Lightgate
		irledpwma = &pwm_ledA;
		irledpwmb = &pwm_ledB;
		irsensa = &irsensorA;
		irsensb = &irsensorB;

		// Power Control
		vloadenable = &powercontrol0;

		i2c0 = &i2c0;
		i2c1 = &i2c1;

		spi-flash0 = &w25q16;

	};
};

&pwm0 {
	status = "okay";
	ch0-pin = <13>; /* P0.13 = 13 */
	ch1-pin = <14>; /* P0.14 = 14 */
};

&i2c0 {
	compatible="nordic,nrf-twim";
	status = "okay";
	//For pins P1.0 through P1.31, add 32 to the pin number. For
	//example, to use P1.1,2 for TX, set:
	scl-pin = <33>;
	sda-pin = <34>;
};

&i2c1 {
	compatible="nordic,nrf-twim";
	status = "okay";
	//For pins P1.0 through P1.31, add 32 to the pin number. For
	//example, to use P1.1,2 for TX, set:
	scl-pin = <24>;
	sda-pin = <25>;
};

&qspi {/* dedicated MX25L */
	status = "okay";
	sck-pin = <19>;
	io-pins = <20>, <21>, <22>, <23>;
	csn-pins = <17>;
	// mx25r08: mx25r0835f@0 {
	// 	compatible = "nordic,qspi-nor";
	// 	reg = <0>;
	// 	writeoc = "pp4io";
	// 	readoc = "read4io";
	// 	sck-frequency = <8000000>;
	// 	jedec-id = [ c2 28 14  ];
	// 	size = <0x0800000>; /* flash capacity in bits */
	// 	has-dpd;
	// 	t-enter-dpd = <10000>;
	// 	t-exit-dpd = <35000>;
	// };

	w25q16: w25q16@0 {
		compatible = "nordic,qspi-nor";
		reg = <0>;
		writeoc = "pp4io";
		readoc = "read4io";
		sck-frequency = <8000000>;
		jedec-id = [ ef 40 15  ];
		size = <16777216>; /* flash capacity in bits */
		has-dpd;
		t-enter-dpd = <10000>;
		t-exit-dpd = <35000>;
	};
};


&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
current-speed = < 115200 >;
tx-pin = < 6 >;
rx-pin = < 8 >;
rts-pin = < 5 >;
cts-pin = < 7 >;
};

&gpio0 {
status = "okay";
};


&gpio1 {
	status = "okay";
	};

&rtc2 {
	 status = "okay";
};


&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x0 0xc000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0xc000 0x72000>;
		};
		slot1_partition: partition@7e000 {
			label = "image-1";
			reg = <0x7e000 0x72000>;
		};
		scratch_partition: partition@f0000 {
			label = "image-scratch";
			reg = <0xf0000 0xa000>;
		};
		storage_partition: partition@fa000 {
			label = "storage";
			reg = <0xfa000 0x6000>;
		};
	};
};


Board dts file new:
// Copyright (c) 2023 Nordic Semiconductor ASA
// SPDX-License-Identifier: Apache-2.0

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "nep-pinctrl.dtsi"

/ {
	model = "nep";
	compatible = "pc,nep";

	chosen {
		zephyr,console = &uart0;
		zephyr,shell-uart = &uart0;
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zephyr,code-partition = &slot0_partition;
	};

	switches {
		compatible = "gpio-keys";
		switch0: switch_0 {
			gpios = <&gpio0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
			label = "User Button";
		};

		switch1: switch_1 {
			gpios = <&gpio0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
			label = "Tamper Switch";
		};


	};

	powercontrol {
		compatible = "gpio-keys";
		powercontrol0: powercontrol_0 {
			gpios = < &gpio1 6 GPIO_ACTIVE_HIGH >;
			label = "VLoad Enable";
		};
	};

	motorcontrol {
		compatible = "gpio-keys";
		motorin1: motorin_1 {
			gpios = < &gpio1 3 GPIO_ACTIVE_HIGH >;
			label = "Motor Control Positive";
		};
		motorin2: motorin_2 {
			gpios = < &gpio1 4 GPIO_ACTIVE_HIGH >;
			label = "Motor Control Negative";
		};

		motorcontrolfault: motorcontrol_fault {
			gpios = <&gpio0 16 (GPIO_ACTIVE_LOW)>;
			label = "Motor Fault Detected";
		};
	};

	infraredsensor {
		compatible = "gpio-keys";
		irsensorA: irsensor_A {
			gpios = < &gpio1 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP) >;
			label = "Infrared Sensor A";
		};
		irsensorB: irsensor_B {
			gpios = < &gpio1 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP) >;
			label = "Infrared Sensor B";
		};
		
	};


	pwmleds {
		compatible = "pwm-leds";
		pwm_ledA: pwm_led_A {
			pwms = <&pwm0 0 PWM_HZ(38000) PWM_POLARITY_NORMAL>;
			label = "PWM LED A";
		};
		pwm_ledB: pwm_led_B {
			pwms = <&pwm0 1 PWM_HZ(38000) PWM_POLARITY_NORMAL>;
			label = "PWM LED B";
		};
	};

	aliases {
		// Switches
		userbutton = &switch0;
		tamperswitch = &switch1;

		// Motor Control
		motorin1 = &motorin1;
		motorin2 = &motorin2;
		motorfault = &motorcontrolfault;

		// Lightgate
		irledpwma = &pwm_ledA;
		irledpwmb = &pwm_ledB;
		irsensa = &irsensorA;
		irsensb = &irsensorB;

		// Power Control
		vloadenable = &powercontrol0;

		i2c0 = &i2c0;
		i2c1 = &i2c1;

		spi-flash0 = &w25q16;

	};
};

&pwm0 {
	status = "okay";
	pinctrl-0 = <&pwm0_default>;
	pinctrl-1 = <&pwm0_sleep>;
	pinctrl-names = "default", "sleep";
};

&i2c0 {
	compatible="nordic,nrf-twim";
	status = "okay";
	pinctrl-0 = <&i2c0_default>;
	pinctrl-1 = <&i2c0_sleep>;
	pinctrl-names = "default", "sleep";
};

&i2c1 {
	compatible="nordic,nrf-twim";
	status = "okay";
	pinctrl-0 = <&i2c1_default>;
	pinctrl-1 = <&i2c1_sleep>;
	pinctrl-names = "default", "sleep";
};

&qspi {/* dedicated MX25L */
	status = "okay";
	pinctrl-0 = <&qspi_default>;
	pinctrl-1 = <&qspi_sleep>;
	pinctrl-names = "default", "sleep";
	// mx25r08: mx25r0835f@0 {
	// 	compatible = "nordic,qspi-nor";
	// 	reg = <0>;
	// 	writeoc = "pp4io";
	// 	readoc = "read4io";
	// 	sck-frequency = <8000000>;
	// 	jedec-id = [ c2 28 14  ];
	// 	size = <0x0800000>; /* flash capacity in bits */
	// 	has-dpd;
	// 	t-enter-dpd = <10000>;
	// 	t-exit-dpd = <35000>;
	// };

	w25q16: w25q16@0 {
		compatible = "nordic,qspi-nor";
		reg = <0>;
		writeoc = "pp4io";
		readoc = "read4io";
		sck-frequency = <8000000>;
		jedec-id = [ ef 40 15  ];
		size = <16777216>; /* flash capacity in bits */
		has-dpd;
		t-enter-dpd = <10000>;
		t-exit-dpd = <35000>;
	};
};

&uart0 {
compatible = "nordic,nrf-uarte";
current-speed = < 115200 >;
status = "okay";
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};

&gpio0 {
status = "okay";
};


&gpio1 {
	status = "okay";
	};

&rtc2 {
	 status = "okay";
};


&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x0 0xc000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0xc000 0x72000>;
		};
		slot1_partition: partition@7e000 {
			label = "image-1";
			reg = <0x7e000 0x72000>;
		};
		scratch_partition: partition@f0000 {
			label = "image-scratch";
			reg = <0xf0000 0xa000>;
		};
		storage_partition: partition@fa000 {
			label = "storage";
			reg = <0xfa000 0x6000>;
		};
	};
};
DTSI file
 &pinctrl {

    pwm0_default: pwm0_default {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 13)>,
                <NRF_PSEL(PWM_OUT1, 0, 14)>;
        };
    };

    pwm0_sleep: pwm0_sleep {
        group1 {
            psels = <NRF_PSEL(PWM_OUT0, 0, 13)>,
            <NRF_PSEL(PWM_OUT1, 0, 14)>;
        };
    };


	i2c0_default: i2c0_default {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
				<NRF_PSEL(TWIM_SCL, 1, 1)>;
		};
	};

	i2c0_sleep: i2c0_sleep {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
				<NRF_PSEL(TWIM_SCL, 1, 1)>;
			low-power-enable;
		};
	};

    
	i2c1_default: i2c1_default {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 0, 25)>,
				<NRF_PSEL(TWIM_SCL, 0, 24)>;
		};
	};

	i2c1_sleep: i2c1_sleep {
		group1 {
			psels = <NRF_PSEL(TWIM_SDA, 0, 25)>,
				<NRF_PSEL(TWIM_SCL, 0, 24)>;
			low-power-enable;
		};
	};
    
	qspi_default: qspi_default {
		group1 {
			psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
                <NRF_PSEL(QSPI_IO0, 0, 20)>,
                <NRF_PSEL(QSPI_IO1, 0, 21)>,
                <NRF_PSEL(QSPI_IO2, 0, 22)>,
                <NRF_PSEL(QSPI_IO3, 0, 23)>,
                <NRF_PSEL(QSPI_CSN, 0, 17)>;
		};
	};

	qspi_sleep: qspi_sleep {
		group1 {
			psels = <NRF_PSEL(QSPI_SCK, 0, 19)>,
				<NRF_PSEL(QSPI_IO0, 0, 20)>,
				<NRF_PSEL(QSPI_IO1, 0, 21)>,
				<NRF_PSEL(QSPI_IO2, 0, 22)>,
				<NRF_PSEL(QSPI_IO3, 0, 23)>,
				<NRF_PSEL(QSPI_CSN, 0, 17)>;
			low-power-enable;
		};
	};

    uart0_default: uart0_default {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 6)>,
				<NRF_PSEL(UART_RX, 0, 8)>,
                <NRF_PSEL(UART_CTS,0,7)>,
                <NRF_PSEL(UART_RTS,0,5)>;
		};
	};

	uart0_sleep: uart0_sleep {
		group1 {
			psels = <NRF_PSEL(UART_TX, 0, 6)>,
            <NRF_PSEL(UART_RX, 0, 8)>,
            <NRF_PSEL(UART_CTS,0,7)>,
            <NRF_PSEL(UART_RTS,0,5)>;
			low-power-enable;
		};
	};

};

Parents Reply Children
No Data
Related