I'm testing a data collecting program which samples data every 2s and reports it through UART (printf("data=%d\r\n", data)
) on a PCA10001
board. I found this program may run into the error handler (FAILED) in some cases after running about 2 hours.
UART setting: 38400 Baudrate, hardware flow control
The pass/fail conditions are
-
PASSED: UART is enabled, USB is plugged into a computer, Terminal Emulator is running and receiving data from the COM port
-
PASSED: UART is disabled, USB is plugged into a battery pack
-
FAILED: UART is enabled, USB is plugged into a computer, no Terminal Emulator is running
-
FAILED: UART is enabled, USB is plugged into a battery pack
Particularly in the last case, even if I reset the chip, the program will run into the error handler directly after startup. The only solution is to plug it into a computer and reset again.
I guess there's a Tx/Rx queue in the Segger programmer chip. And when it's overflow, the Segger chip will block any further UART operation from nrf51822. Running a Terminal Emulator or reconnecting the USB cable can clear this queue.
I don't know whether this guess is correct. I write here to remind you, who are working on the evaluation kit, using UART for debug assertion and running long term program, to consider this potential issue.