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

How to Map UARTE to physical pins?

Hello,

I am a newby to the nRF5340 and Zephyr and I am stuck. I would like to know how to map physical pins to a particular UARTE.

I have read in the user manual OPS_v0.6.1 that this can be configured using these registers PSEL.RXD, PSEL.CTS, PSEL.RTS and PSEL.TXD but I am not sure how.

Is there a tutorial or a sample example where this is illustrated?

Thank you.

Parents
  • Hello!

    When mapping physical pins in Zephyr you can use overlay files. For example, if you want to map the UARTE of the application processor of the nRF5340 on the PDK do the following:
    - Make a file in your project directory called: nrf5340pdk_nrf5340_cpuapp.overlay
    - Fill it with the following code: 

    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	tx-pin = < 0x14 >;
    	rx-pin = < 0x16 >;
    	rts-pin = < 0x13 >;
    	cts-pin = < 0x15 >;
    };


    You can see how it's done for the nRF52840 DK here and you can read more about the Devicetree overlays here.

    Hope this helps!

    Best regards,
    Carl Richard

Reply
  • Hello!

    When mapping physical pins in Zephyr you can use overlay files. For example, if you want to map the UARTE of the application processor of the nRF5340 on the PDK do the following:
    - Make a file in your project directory called: nrf5340pdk_nrf5340_cpuapp.overlay
    - Fill it with the following code: 

    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	tx-pin = < 0x14 >;
    	rx-pin = < 0x16 >;
    	rts-pin = < 0x13 >;
    	cts-pin = < 0x15 >;
    };


    You can see how it's done for the nRF52840 DK here and you can read more about the Devicetree overlays here.

    Hope this helps!

    Best regards,
    Carl Richard

Children
No Data
Related