Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

modbus rtu initialization error

Hello everyone

I'm trying to connect 2 board nRF52-DK (PCA10040) via modbus RTU using zephyr example (client and master in 2 different board).

I'm using visual studio code and SDK 2.2.0-rc1

The steps I took are:

1) create application from example starting from modbus rtu example (1 for client and 1 for master)

2)edit build application with nrf52dk_nrf52832

2.1) cross connected p0.06 and p0.08 the boards in order to have bus connection

3)build

4)debug

from client side i get

Connected via Serial Port with settings COM8 115200 8n1 rtscts:off

*** Booting Zephyr OS build v3.2.99-ncs1-rc1 ***
[00:00:00.389,526] <err> modbus_serial: Failed to configure UART
[00:00:00.389,556] <err> modbus: Failed to init MODBUS over serial line
[00:00:00.389,556] <err> mbc_sample: Modbus RTU client initialization failed

from master side i get

Connected via Serial Port with settings COM8 115200 8n1 rtscts:off

*** Booting Zephyr OS build v3.2.99-ncs1-rc1 ***
[00:00:00.392,517] <err> modbus_serial: Failed to configure UART
[00:00:00.392,517] <err> modbus: Failed to init MODBUS over serial line
[00:00:00.392,547] <err> mbs_sample: Modbus RTU server initialization failed
*** Booting Zephyr OS build v3.2.99-ncs1-rc1 ***

from both example documentation, non clear the meaning and how to find what i have to do. What is de-gpios? how can i define my value, and what is it?

This example uses DE signal, which is controlled by pin D9 on the JOY-IT shield. For other shields, de-gpios property must be adapted or removed in the application overlay file samples/subsys/modbus/rtu_server/app.overlay

best

Parents
  • Hi

    I think the problem here is that the UARTE interface in the nRF52832 does not support 2 stop bits, which is required by this example. 

    The example is tested with the nRF52840 device, which supports 2 stop bits as seen in the UARTE CONFIG register

    When trying to configure the UARTE with 2 stop bits in the nRF52832 the UART error will return an error, and you get the Failed to configure UART message from the modbus_serial driver. 

    from both example documentation, non clear the meaning and how to find what i have to do. What is de-gpios? how can i define my value, and what is it?

    The DE GPIO is used for direction control, allowing you to tell the RS485 shield whether or not you are in the transmission or reception state. 

    For more information about this pin you can also refer to the manual for the RS485 shield supported by this example. 

    If you look at the app.overlay file in the sample you can see that by default the de-gpios property is set up to use D9 on the Arduino headers, which is the pin used by the joy IT RS485 shield. 

    Best regards
    Torbjørn

Reply
  • Hi

    I think the problem here is that the UARTE interface in the nRF52832 does not support 2 stop bits, which is required by this example. 

    The example is tested with the nRF52840 device, which supports 2 stop bits as seen in the UARTE CONFIG register

    When trying to configure the UARTE with 2 stop bits in the nRF52832 the UART error will return an error, and you get the Failed to configure UART message from the modbus_serial driver. 

    from both example documentation, non clear the meaning and how to find what i have to do. What is de-gpios? how can i define my value, and what is it?

    The DE GPIO is used for direction control, allowing you to tell the RS485 shield whether or not you are in the transmission or reception state. 

    For more information about this pin you can also refer to the manual for the RS485 shield supported by this example. 

    If you look at the app.overlay file in the sample you can see that by default the de-gpios property is set up to use D9 on the Arduino headers, which is the pin used by the joy IT RS485 shield. 

    Best regards
    Torbjørn

Children
Related