Sharing the changes required to get RADIO_TEST to work over USB on nrf52

This is not a support request. 

I just want to share some code that others might find useful. If I post it here then they might find it.

The current RADIO_TEST example has support for remote USB CDC ADM but only for the nrf5340.

Here's how to get it to work on nrf52

Start with the nrf/samples/peripheral/radio_test example from NCS 2.9.0

My custom PCB uses an nrf52840, so I added a build configuration with "nrf52840dk/nrf52840"

Add this to the prj.conf

CONFIG_STDOUT_CONSOLE=y
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Radio Test"
CONFIG_USB_DEVICE_PID=0x0001
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_UART_LINE_CTRL=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y

Add this overlay file

1462.nrf52840dk_nrf52840.overlay

When you connect the PCB to your computer by USB it should appear in device manager under Ports as a "USB Serial Device" with a COM number 

You can connect to it using Putty with 115200 baud rate.

And that's it. Hopefully it saves someone a few hours/days to figure this out :)

It would be great if the example could be updated to do this using a CONFIG variable (in the same way as it does for nrf5340)

-Jason

Parents Reply Children
No Data
Related