Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RS485 使用RTS控制收发不成功一直高电平 #8

Open
zwjin1210 opened this issue Apr 22, 2024 · 5 comments
Open

RS485 使用RTS控制收发不成功一直高电平 #8

zwjin1210 opened this issue Apr 22, 2024 · 5 comments

Comments

@zwjin1210
Copy link

RS485 使用RTS控制收发不成功一直高电平

@mjchen1
Copy link
Contributor

mjchen1 commented Apr 24, 2024

請問,你是在linux底下使用嗎 ...??
device tree的pin設定是怎麼設定的 ..??

@zwjin1210
Copy link
Author

就是配置RTS引脚

@mjchen1
Copy link
Contributor

mjchen1 commented May 2, 2024

可以提供詳細的配置嗎 ...??

@zwjin1210
Copy link
Author

/*

/dts-v1/;

#include "ma35d1.dtsi"

/ {
model = "Nuvoton MA35D1-IoT";

chosen {
	bootargs = "root=/dev/mmcblk1p1 rootfstype=ext4 rw rootwait console=ttyS0,115200n8 rdinit=/sbin/init mem=512M";
};

};

&mem {
device_type = "memory";
reg = <0x00000000 0x80000000 0 0x20000000>; /* DRAM space - 1, size : 512MB DRAM */
};

&gmac1 {
status = "okay";
phy-mode = "rmii";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gmac1>;
};

&uart4 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart4>;
dmas = <&pdma2 2>,<&pdma2 3>;
dma-names = "tx", "rx";
pdma-enable = <1>; /* Enable PDMA */
};

&uart6 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart6>;
dmas = <&pdma2 4>,<&pdma2 5>;
dma-names = "tx", "rx";
pdma-enable = <1>; /* Enable PDMA */
};

&uart5 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_uart5>;
dmas = <&pdma2 6>,<&pdma2 7>;
dma-names = "tx", "rx";
pdma-enable = <1>; /* Enable PDMA */
};

&qspi0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_qspi0>;
};

&spi0 {
status = "okay";
pinctrl-names = "default";
spi-max-frequency = <30000000>;
pinctrl-0 = <&pinctrl_spi0>;

#address-cells = <1>;
#size-cells = <0>;

spidev0_0: spi@0 {
	compatible = "my_spidev";
	reg = <0>;
	spi-max-frequency = <12000000>;
};	

};

&spi1 {
status = "okay";
pinctrl-names = "default";
spi-max-frequency = <30000000>;
pinctrl-0 = <&pinctrl_spi1>;

#address-cells = <1>;
#size-cells = <0>;

spidev1_0: spi@0 {
	compatible = "my_spidev";
	reg = <0>;
	spi-max-frequency = <12000000>;
};

spidev1_1: spi@1 {
	compatible = "my_spidev";
	reg = <1>;
	spi-max-frequency = <12000000>;
};

};

&spi2 {
status = "okay";
pinctrl-names = "default";
spi-max-frequency = <30000000>;
pinctrl-0 = <&pinctrl_spi2>;

#address-cells = <1>;
#size-cells = <0>;

spidev2_0: spi@0 {
	compatible = "my_spidev";
	reg = <0>;
	spi-max-frequency = <12000000>;
};

spidev2_1: spi@1 {
	compatible = "my_spidev";
	reg = <1>;
	spi-max-frequency = <12000000>;
};

};

&spi3 {
status = "okay";
pinctrl-names = "default";
spi-max-frequency = <30000000>;
pinctrl-0 = <&pinctrl_spi3>;

#address-cells = <1>;
#size-cells = <0>;

spidev3_1: spi@1 {
	compatible = "my_spidev";
	reg = <1>;
	spi-max-frequency = <12000000>;
};	

};

&i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;

rtc@32 {
    compatible = "epson,rx8010";
    reg = <0x32>;
};  

};

&pinctrl {

gmac1 {
	pinctrl_gmac1: gmac1grp{
		nuvoton,pins =
			<SYS_GPF_MFPL_PF0MFP_RMII1_MDC		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF1MFP_RMII1_MDIO		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF2MFP_RMII1_TXEN		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF3MFP_RMII1_TXD0		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF4MFP_RMII1_TXD1		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF5MFP_RMII1_REFCLK	&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF6MFP_RMII1_CRSDV	&pcfg_emac_3_3V>,
			<SYS_GPF_MFPL_PF7MFP_RMII1_RXD0		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPH_PF8MFP_RMII1_RXD1		&pcfg_emac_3_3V>,
			<SYS_GPF_MFPH_PF9MFP_RMII1_RXERR	&pcfg_emac_3_3V>;
	};
};

i2c1 {
	pinctrl_i2c1: i2c1grp{
		nuvoton,pins =
			<SYS_GPN_MFPL_PN4MFP_I2C1_SDA	&pcfg_default>,
			<SYS_GPN_MFPL_PN5MFP_I2C1_SCL	&pcfg_default>;
	};
};

uart4 {
	pinctrl_uart4: uart4grp{
		nuvoton,pins =
			<SYS_GPI_MFPH_PI9MFP_UART4_nRTS	&pcfg_default>,
			<SYS_GPI_MFPH_PI10MFP_UART4_RXD	&pcfg_default>,
			<SYS_GPI_MFPH_PI11MFP_UART4_TXD	&pcfg_default>;
	};
};

uart5 {
	pinctrl_uart5: uart5grp{
		nuvoton,pins =
			<SYS_GPA_MFPH_PA10MFP_UART5_RXD	&pcfg_default>,
			<SYS_GPA_MFPH_PA11MFP_UART5_TXD	&pcfg_default>;
	};
};

uart6 {
	pinctrl_uart6: uart6grp{
		nuvoton,pins =
			<SYS_GPI_MFPH_PI13MFP_UART6_nRTS	&pcfg_default>,
			<SYS_GPI_MFPH_PI14MFP_UART6_RXD		&pcfg_default>,
			<SYS_GPI_MFPH_PI15MFP_UART6_TXD		&pcfg_default>;
	};
};

qspi0 {
	pinctrl_qspi0: qspi0grp{
		nuvoton,pins =
			<SYS_GPD_MFPL_PD0MFP_QSPI0_SS0		&pcfg_default>,
			<SYS_GPD_MFPL_PD1MFP_QSPI0_CLK		&pcfg_default>,
			<SYS_GPD_MFPL_PD2MFP_QSPI0_MOSI0	&pcfg_default>,
			<SYS_GPD_MFPL_PD3MFP_QSPI0_MISO0	&pcfg_default>,
			<SYS_GPD_MFPL_PD4MFP_QSPI0_MOSI1	&pcfg_default>,
			<SYS_GPD_MFPL_PD5MFP_QSPI0_MISO1	&pcfg_default>;
	};
};

spi0 {
	pinctrl_spi0: spi0grp{
		nuvoton,pins =
			<SYS_GPL_MFPH_PL12MFP_SPI0_SS0    &pcfg_default>,
			<SYS_GPB_MFPH_PB9MFP_SPI0_CLK    &pcfg_default>,
			<SYS_GPB_MFPH_PB10MFP_SPI0_MOSI    &pcfg_default>,
			<SYS_GPB_MFPH_PB11MFP_SPI0_MISO    &pcfg_default>;
	};
};

spi1 {
	pinctrl_spi1: spi1grp{
		nuvoton,pins =
			<SYS_GPE_MFPH_PE10MFP_SPI1_SS0    &pcfg_defaulthi>,
			<SYS_GPN_MFPH_PN15MFP_SPI1_SS1    &pcfg_defaulthi>,
			<SYS_GPE_MFPH_PE11MFP_SPI1_CLK    &pcfg_defaulthi>,
			<SYS_GPE_MFPH_PE12MFP_SPI1_MOSI    &pcfg_defaulthi>,
			<SYS_GPE_MFPH_PE13MFP_SPI1_MISO    &pcfg_defaulthi>;
	};
};

spi2 {
	pinctrl_spi2: spi2grp{
		nuvoton,pins =
			<SYS_GPG_MFPH_PG8MFP_SPI2_SS0    &pcfg_default>,
			<SYS_GPM_MFPH_PM11MFP_SPI2_SS1    &pcfg_default>,
			<SYS_GPG_MFPH_PG9MFP_SPI2_CLK    &pcfg_default>,
			<SYS_GPG_MFPH_PG10MFP_SPI2_MOSI    &pcfg_default>,
			<SYS_GPK_MFPL_PK4MFP_SPI2_MISO    &pcfg_default>;
	};
};

spi3 {
	pinctrl_spi3: spi3grp{
		nuvoton,pins =
			<SYS_GPD_MFPL_PD6MFP_SPI3_SS1    &pcfg_default>,
			<SYS_GPG_MFPL_PG5MFP_SPI3_CLK    &pcfg_default>,
			<SYS_GPG_MFPL_PG6MFP_SPI3_MOSI    &pcfg_default>,
			<SYS_GPG_MFPL_PG7MFP_SPI3_MISO    &pcfg_default>;
	};
};

};

@mjchen1
Copy link
Contributor

mjchen1 commented Dec 23, 2024

請問一下,你這個問題,和下面這個問題,是同一個嗎 ...??
如果是同一個,可以在下面這個問題討論就好
#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants