CC2340R5: UART2_write keeps returning UART2_STATUS_EINUSE

Part Number: CC2340R5

Tool/software:

My customer found an issue when using UART2_write to print the scan report in basic_ble. basic_ble was set as central role and UART2_write was called in Central_ScanEventHandler -> case BLEAPPUTIL_ADV_REPORT to print the device information when the scan report was updated. The UART was working fine in the first couple of minutes but got stuck afterwards, UART Tx no longer had output and UART2_write was returning -9(UART2_STATUS_EINUSE), the issue could not recover without a reset.


Please find a project to reproduce this issue as below. Run the project freely first, and after around 3 minutes the UART Tx will stop outputing. Then use the "connecting to a running target" method to connect the CC2340, UART2_STATUS_EINUSE will be observed as the output of UART2_write in Central_ScanEventHandler -> case BLEAPPUTIL_ADV_REPORT.

scan_uart_write.7z

Please help suggest why the UART could not recover from a UART2_STATUS_EINUSE situation, thanks.

Best regards,

Shuyang