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

Mesh serial example with a timeout event

Hi:

I am trying the "Mesh Serial" example on my nrf52840 boards. However, when the Echo command is used after the device is cold-started, a timeout event will occur. I have tried some existing methods in the forum, but none of them worked. The output are shown as below:

PS D:\DATA_SHARE\nrf5_SDK_for_Mesh_v4.2.0_src\scripts\interactive_pyaci> python .\interactive_pyaci.py -d COM10 --no-logfile

    To control your device, use d[x], where x is the device index.
    Devices are indexed based on the order of the COM ports specified by the -d option.
    The first device, d[0], can also be accessed using device.

    Type d[x]. and hit tab to see the available methods.

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: send(cmd.Echo("123"))

In [2]: 2020-09-20 16:27:17,843 - INFO - COM10: cmd Echo, timeout waiting for event

I may have found the reason, that is, there is a certain difference between my development board and the official development board. My board has a Jlink port for programming (buttom right of the board) and a seperate mini-usb port for serial output. (top left of the board). Similar things happened when I tried to run RIOT OS on my board. The Jlink port was recognized as ttyACM0 on Ubuntu and mini-usb port was recognized as ttyUSB0. In the RIOT tutorial, the Jlink port is used for both programming and serial output. But my board use Jlink only for programming and mini-usb for serial output

Latter, I find that if I plug in & plug out the Jlink after the cold start, the board can respond to the Echo command. The output and the COM port on Windows are shown as below:

PS D:\DATA_SHARE\nrf5_SDK_for_Mesh_v4.2.0_src\scripts\interactive_pyaci> python .\interactive_pyaci.py -d COM10 --no-logfile

    To control your device, use d[x], where x is the device index.
    Devices are indexed based on the order of the COM ports specified by the -d option.
    The first device, d[0], can also be accessed using device.

    Type d[x]. and hit tab to see the available methods.

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: send(cmd.Echo("123"))

In [2]: 2020-09-20 16:27:01,840 - INFO - COM10: {event: DeviceEchoRsp, data: {'data': '123'}}

Therefore, my initial guess is that there are related configurations in SoftDevice. After a cold start, it uses the Jlink interface as the default serial output interface, but my board lacks relevant hardware functions. When I plug in & plug out the Jlink port, it will detect a Jlink disconnection event and switch the current serial output interface to min-usb port.

So here comes my question: Is my guess correct? If so, can I redirect the default serial output to mini-usb port?

Thank you!

Parents
  • Hi,

    What port (on the PC) you get UART communication over is not something that the nRF can control. From what you describe, it sounds like both the J-Link programmer and the mini-usb with USB-to-serial are connected to the same UART pins of the nRF, and which one of those to use is controlled by logic on the board itself.

    If I understand correctly, there is a J-Link programmer on your board? Maybe it also controls (overrides) the USB-to-serial converter with the mini-USB port, and whether it is connected to the nRF UART pins? You need to consult the documentation for the board, in order to see how things are connected...

    Regards,
    Terje

  • Hi Terje:

    Many thanks for your reply! The Jlnik is outside of the board and connect to the board via a TTL port. The reason I attach the UART port on PC is just to show that I need two ports to finish the programming and serial output, respectivly. But in the RIOT tutorial, it seems that they only need one ttyACM port to finish both the programming and serial output.

    I'ii try to get a PCB desgn from the manufacturer.

    Thanks!

Reply
  • Hi Terje:

    Many thanks for your reply! The Jlnik is outside of the board and connect to the board via a TTL port. The reason I attach the UART port on PC is just to show that I need two ports to finish the programming and serial output, respectivly. But in the RIOT tutorial, it seems that they only need one ttyACM port to finish both the programming and serial output.

    I'ii try to get a PCB desgn from the manufacturer.

    Thanks!

Children
No Data
Related