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

Reset during UART send/receive

I wrote UART echo sample based on ble_app_uart_c for S140/nRF52840-DK.

When nRF52 receive one line on USB/UART, it send same line to USB/UART.

I also write Linux socket sample for keep send/receive one text line to /dev/ttyACM0.

On normal condition, both sample works fine. I can see echoed line on Linux terminal.

But when I press "IF BOOT/RESET" during USB/UART is busy. nRF52 goes unstable condition.

On next open /dev/ttyACM0 is success, but no echo back. 

This unstable condition continues until power cycle on nRF52.

Do you know how to prevent becoming unstable condition?

I use nRF52840-DK, PCA10056 1.1.0

Thanks,

Parents
  • It reproduced on ble_app_uart_c_pca10056_s140 sample.

    During writing to serial port, nRF52840-DK does not boot by Reset button. 

    Steps

    1) Build and run ble_app_uart_c_pca10056_s140 sample on nRF5_SDK_15.3.0_59ac345

    2) nRF52840-DK LED1 blinks every 5sec.

    3) Run python script to keep writing to Serial port

    4) Press "IF BOOT/RESET" button on DK.

    5) Boot failed, LED1 does not blink.

    If I remove uart_init() and printf() on sample main function. That test case is success, I can see LED1 blinks on step 5.

    I run this python script on iMac for step3.

    import serial
    
    def testSerial(tty):
      ser = serial.Serial(tty, 115200, timeout = 1)
      while True:
        ser.write(b'hello\r')
        print("w");
    
    testSerial('/dev/cu.usbmodem0006833998061')
    

  • Hi,

    I've reproduce the issue and see that a APP_UART_COMMUNICATION_ERROR is raised, more specifically an OVERRUN error due to the CPU not being able to process what's in the buffer before new data is sent during a reset.This causes the application to hard fault. You could try enabling Hardware Flow Control and see if the issue persists.

    Jared 

Reply Children
No Data
Related