Configure Uart serial for a custom board

I am trying to develop a project using a custom nrf52 board. The goal is to use the uart serial communication to receive and send the data via bluetooth. 

To do so I developed a sotfware and I tested on the nrf52-dk and it working well.

Now I want to port the soft to my custom bord. and to do so I need to descripe the uart pin. and I still didn't figure out how to do so.

Parents
  • Check out the documentation on Custom boards, including the Board Porting Guide.

    If you navigate to the folder (...)\zephyr\boards\arm\nrf52dk_nrf52832 you will find the board files for nRF52 DK. The file nrf52dk_nrf52832-pinctrl.dtsi defines the pins used for the UART. The first number is the port, the second is the pin number of that port:

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

    Please let me know if you have any further questions.

Reply
  • Check out the documentation on Custom boards, including the Board Porting Guide.

    If you navigate to the folder (...)\zephyr\boards\arm\nrf52dk_nrf52832 you will find the board files for nRF52 DK. The file nrf52dk_nrf52832-pinctrl.dtsi defines the pins used for the UART. The first number is the port, the second is the pin number of that port:

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

    Please let me know if you have any further questions.

Children
Related