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

Get serial IO from evaluation kit nRF51422 via the Segger debug interface

Have you also wondered how to get serial IO (UART) with nRF51422-EK via the Segger debug interface?

[list=1] []Plug Eval kit in the USB port. []In Windows open "device manager" and read the port number from "Ports (COM & LPT)" under "JLInk CDC UART Port (COM16)". My system uses COM16 but this could be different in other setups. []Open a serial port terminal program or similar application on the PC and set the proper port nr, baud-rate, RTS/CTS, bits and parity which match the values in the target. (default in examples is 38400 baud, no RTS/CTS, no parity, 8bits). []Run the Target application on nRF51422-EK.

[/list] Note that the printf(), puts() functions are discarding return values from underlying uart I/O call's, so back-pressure is not working even if RTS/CTS is enabled. This can show up as garbled-up data. To avoid this, use the functions from the underlying app_uart.c and act according to the return values.

As I understand, it is possible with app_uart.c to have the nRF51x22 to power down and sleep-wait when CTS back pressure is signalling that the host is busy and can take no more data. I did not get this to work however. Setting APP_UART_FLOW_CONTROL_LOW_POWER in comm_params, then no data is sent from nRF51x22. This could have many reasons and I bailed out reviewing the app_uart_init() code as this is rather complicated. I know the serial adapter works with RTS/CTS in other applications (not using Segger debug port but one from FTDI). If others have had APP_UART_FLOW_CONTROL_LOW_POWER to work I would like to hear about it. The application is not using softdevice.

I wrote this note because the nRF51422-EK user manual, does not explain how to actually connect to the UART from the host, and a search in Keil documentation for "UART" or "Serial" gives an overwhelming number of hits. Surely one of them will be the right I just did not find it.

May I suggest that NS updates the nRF51422-EK user-manual with this vital piece of information or did I overlook something obvious?

Parents
  • I have not tested this aspect with Eclipse chain. I have installed the latest NS SDK and latest from Segger. I would think that the latter is the one which gives you the access to the serial port on the Eval kit. In any case you should be able to see the com port in device manager. If so, then Keil or Eclipse - it is all the same. Data passes besides the debug data - at least so I guess. If you cant get this to work I recommend to get hold of a serial to USB adapter. I like those with FTDI's chips on. They are very cheap and works well and finds it's driver on win7 automatically and 1Mb/s is no problem. I can give you a reference where to buy. Well - you need to make a small patch cable for this to work.

Reply
  • I have not tested this aspect with Eclipse chain. I have installed the latest NS SDK and latest from Segger. I would think that the latter is the one which gives you the access to the serial port on the Eval kit. In any case you should be able to see the com port in device manager. If so, then Keil or Eclipse - it is all the same. Data passes besides the debug data - at least so I guess. If you cant get this to work I recommend to get hold of a serial to USB adapter. I like those with FTDI's chips on. They are very cheap and works well and finds it's driver on win7 automatically and 1Mb/s is no problem. I can give you a reference where to buy. Well - you need to make a small patch cable for this to work.

Children
No Data
Related