You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a Modbus implementation using USART1 on an STM32 Nucleo-G474 board. In the Device Tree, I’ve configured the usart1 node as well as the Modbus settings. Initially, I was controlling the DE (Driver Enable) pin via GPIO manually, and that worked correctly — the line toggled as expected.
However, I wanted to switch to using the native DE pin functionality provided by USART1 hardware. I enabled it accordingly, but now I'm facing a problem: the DE pin stays HIGH all the time. As a result, the board (configured as a Modbus server) can't receive any data, since the transceiver remains in transmit mode.
I’ve attached both of my .overlay files and the .conf file for reference. Has anyone encountered something similar or knows what might be wrong with the configuration?
For using the native DE pin functionality provided by USART1 hardware:
&usart1 {
status = "okay";
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10 &usart1_de_pa12>;
current-speed = <115200>;
pinctrl-names="default";
de-enable;
modbus0 {
compatible = "zephyr,modbus-serial";
status = "okay";
};
};
Controlling the DE (Driver Enable) pin via GPIO manually:
&usart1 {
status = "okay";
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
current-speed = <115200>;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm working on a Modbus implementation using USART1 on an STM32 Nucleo-G474 board. In the Device Tree, I’ve configured the usart1 node as well as the Modbus settings. Initially, I was controlling the DE (Driver Enable) pin via GPIO manually, and that worked correctly — the line toggled as expected.
However, I wanted to switch to using the native DE pin functionality provided by USART1 hardware. I enabled it accordingly, but now I'm facing a problem: the DE pin stays HIGH all the time. As a result, the board (configured as a Modbus server) can't receive any data, since the transceiver remains in transmit mode.
I’ve attached both of my .overlay files and the .conf file for reference. Has anyone encountered something similar or knows what might be wrong with the configuration?
For using the native DE pin functionality provided by USART1 hardware:
&usart1 {
status = "okay";
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10 &usart1_de_pa12>;
current-speed = <115200>;
pinctrl-names="default";
de-enable;
};
Controlling the DE (Driver Enable) pin via GPIO manually:
&usart1 {
status = "okay";
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
current-speed = <115200>;
};
prj.conf is:
CONFIG_MODBUS=y
CONFIG_MODBUS_BUFFER_SIZE=64
CONFIG_MODBUS_ROLE_SERVER=y
CONFIG_MODBUS_SERIAL=y
CONFIG_LOG=y
CONFIG_PRINTK=y
CONFIG_GPIO=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
Zephyr Version is 4.1
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions