Getting access to more uart in ZephyrOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting access to more uart in ZephyrOS

Jump to solution
1,560 Views
Gigate
Contributor II

 

Greetings everyone,

I'm currently working on a demo application using ZephyrOS and the mimxrt1064_evk board. In my application, I need to utilize multiple UART-based sensors. However, I'm encountering an issue with accessing additional UART interfaces. I'm particularly interested in having multiple UART TX/RX pins available on the Arduino header of the board. Is it possible to achieve this configuration? I have attempted to use a DTS overlay, but unfortunately, it fails to compile due to the following code snippet:

 

 

&pinctrl {
pinmux_lpuart4: pinmux_lpuart4 {
    group0 {
        pinmux = <&iomuxc_gpio_ad_b1_04_lpuart4_tx>,
		 <&iomuxc_gpio_ad_b1_05_lpuart4_rx>;
	drive-strength = "r0-6";
	slew-rate = "slow";
	nxp,speed = "100-mhz";
    };
};
pinmux_lpuart4_sleep: pinmux_lpuart4_sleep {
    group0 {
        pinmux = <&iomuxc_gpio_ad_b1_04_gpio1_io20>;
        drive-strength = "r0";
        bias-pull-up;
        bias-pull-up-value = "100k";
        slew-rate = "slow";
        nxp,speed = "100-mhz";
    };
    group1 {
        pinmux = <&iomuxc_gpio_ad_b1_05_lpuart4_rx>;
        drive-strength = "r0-6";
        slew-rate = "slow";
        nxp,speed = "100-mhz";
    };
};
};

 

 

Please advise on how I can resolve this compilation issue and successfully access multiple UART interfaces. Thank you for your assistance!

0 Kudos
Reply
1 Solution
1,471 Views
Gigate
Contributor II

Thanks for your help!
I now figured out how to configure the different lpuart to get them on the arduino header. I'd like to share my newfound knowledge if somebody stumbles over the same questions I had:

iomuxc_gpio_ad_b1_02_lpuart2_tx -> J22 7
iomuxc_gpio_ad_b1_03_lpuart2_rx -> J22 8
iomuxc_gpio_ad_b0_02_lpuart6_tx -> J24 2
iomuxc_gpio_ad_b0_03_lpuart6_rx -> J24 1
iomuxc_gpio_ad_b1_10_lpuart8_tx -> J23 1
iomuxc_gpio_ad_b1_11_lpuart8_rx -> J23 2

And here is an example overlay file that works:

&pinctrl {
      pinmux_lpuart2: pinmux_lpuart2 {
		group0 {
			pinmux = <&iomuxc_gpio_ad_b1_02_lpuart2_tx>,
				<&iomuxc_gpio_ad_b1_03_lpuart2_rx>;
			drive-strength = "r0-6";
			slew-rate = "slow";
			nxp,speed = "100-mhz";
		};
	};

	pinmux_lpuart2_sleep: pinmux_lpuart2_sleep {
		group0 {
			pinmux = <&iomuxc_gpio_ad_b1_03_gpio1_io19>;
			drive-strength = "r0";
			bias-pull-up;
			bias-pull-up-value = "100k";
			slew-rate = "slow";
			nxp,speed = "100-mhz";
		};
		group1 {
			pinmux = <&iomuxc_gpio_ad_b1_03_lpuart2_rx>;
			drive-strength = "r0-6";
			slew-rate = "slow";
			nxp,speed = "100-mhz";
		};
	};
};

 

I hope this Info can help somebody!

 

Thanks again for the help

Tim

View solution in original post

5 Replies
1,472 Views
Gigate
Contributor II

Thanks for your help!
I now figured out how to configure the different lpuart to get them on the arduino header. I'd like to share my newfound knowledge if somebody stumbles over the same questions I had:

iomuxc_gpio_ad_b1_02_lpuart2_tx -> J22 7
iomuxc_gpio_ad_b1_03_lpuart2_rx -> J22 8
iomuxc_gpio_ad_b0_02_lpuart6_tx -> J24 2
iomuxc_gpio_ad_b0_03_lpuart6_rx -> J24 1
iomuxc_gpio_ad_b1_10_lpuart8_tx -> J23 1
iomuxc_gpio_ad_b1_11_lpuart8_rx -> J23 2

And here is an example overlay file that works:

&pinctrl {
      pinmux_lpuart2: pinmux_lpuart2 {
		group0 {
			pinmux = <&iomuxc_gpio_ad_b1_02_lpuart2_tx>,
				<&iomuxc_gpio_ad_b1_03_lpuart2_rx>;
			drive-strength = "r0-6";
			slew-rate = "slow";
			nxp,speed = "100-mhz";
		};
	};

	pinmux_lpuart2_sleep: pinmux_lpuart2_sleep {
		group0 {
			pinmux = <&iomuxc_gpio_ad_b1_03_gpio1_io19>;
			drive-strength = "r0";
			bias-pull-up;
			bias-pull-up-value = "100k";
			slew-rate = "slow";
			nxp,speed = "100-mhz";
		};
		group1 {
			pinmux = <&iomuxc_gpio_ad_b1_03_lpuart2_rx>;
			drive-strength = "r0-6";
			slew-rate = "slow";
			nxp,speed = "100-mhz";
		};
	};
};

 

I hope this Info can help somebody!

 

Thanks again for the help

Tim

1,468 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Gigate ,

   Thanks so much for your kindness!

   We really appreciated your contribution!

   If your question is solved, please help to mark the correct answer, just to close this case.

  Any new issues, welcome to create the new question post in the future, you are always welcome!

 

Best Regards,

kerry

0 Kudos
Reply
1,528 Views
Gigate
Contributor II

Hi @kerryzhou ,

thanks for the reply. I just figured out what the problem is:

I didn't understand what iomuxc is. I thought that it is generated, but actually they are all defined in nxp/nxp_imx/rt/mimxrt1064dvl6a-pinctrl.dtsi.

For lpuart4 for example one of the defined iomuxc is iomuxc_gpio_b1_00_lpuart4_tx. With this the dts compiles. The problem now is, that I don't understand the naming scheme. What for example is the difference between gpio_b1_00 and gpio_ad_b1_00?

How can I map Pins from the Arduino header to uart? Or perhaps is gpio_b1_00 already a pin on the header and if so which one?

Kind Regards

Tim

0 Kudos
Reply
1,515 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Gigate ,

  Thanks so much for your updated information, and I glad to hear you make progress.

   About the GPIO name for: gpio_b1_00 and gpio_ad_b1_00, these two pins are totally not the same pin. You can consider it is two pins, to the different GPIO, also 

kerryzhou_0-1688091597084.png

kerryzhou_1-1688091626032.png

kerryzhou_2-1688091797873.png

 

GPIO_B1_00 is the LPUART4_TXD, but GPIO_AD_B1_00 is just the LPUART2_CST_B, not the TX or RX pin.

So, if you want to use the LPUART4, then you need to use the GPIO_B1_00.

I check the GPIO_b1_00 is the LCDIF_D12, which is not map to the Arduino header, if you want to use it, you need to use the wire to connect to the ardunio header.

More details, please check the MIMXRT1064-EVK board schematic.

 

Wish it helps you!

Best Regards,

Kerry

 

 

 

0 Kudos
Reply
1,537 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @Gigate ,

  Please also share your compile issue pictures, I also need to check it with our internal expert, thanks.

 

Best Regards,

Kerry

0 Kudos
Reply