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!