This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use pins occupied by Zephyr?

Hi,

I am using NRF5340DK, and I want to define P0.20 as my SPI MOSI pin.

However, this pin is pre-defined by Zephyr as uart0 tx pin, in zephyr.dts:

uart0: uart@8000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0x8000 0x1000 >;
				interrupts = < 0x8 0x1 >;
				status = "okay";
				label = "UART_0";
				current-speed = < 0x1c200 >;
				tx-pin = < 0x14 >;
				rx-pin = < 0x16 >;
				rts-pin = < 0x13 >;
				cts-pin = < 0x15 >;
			};

Everytime I reset the cpu, P0.20 pin will be low-level, after entered the main function, P0.20 changes to high-level,

Then the functions below have no effect on P0.20:

nrf_gpio_cfg_output(Pin20);
nrf_gpio_pin_clear(Pin20);

So, how can I use this pin as my wish?

Thanks a lot!

Parents Reply Children
Related