nRF5340 Audio DK: Auto-Switch Input Between UART (USB) and BLE

Hi,

We are working on a project using the nRF5340 Audio DK. We want to take user input either from UART or BLE, and switch between them based on the connection status.

Here’s what we want to do:

  1. If the USB is connected to a PC, the device should automatically detect it and use UART for user input.

  2. If the USB is not connected (running on battery), it should automatically switch to BLE for user input.

How can we make this work?
Can we start with the USB CDC ACM example?
Also, how can we use USBREG on the nRF5340 Audio DK?

Thanks,
Aditya

Parents Reply
  • I tried using the usb_state.c example libraries and API to handle USB detection. It kind of works, the USB-C port is connected through J-Link, and I can detect the device. But the problem is that the connection isn't stable. It shows up for just a brief moment and then drops, so I can’t really make use of it in the code. Seems like the issue is coming from the J-Link interfering with the USB connection.

Children
Related