Communication error "can't set config #1, error -32" (USB) when plugging in nrf52840 dongle (PCA10059) into nvidia xavier

Hi,

as stated in the title, we have a nrf52840 dongle (PCA10059) which does not come up normally on a Nvidia xavier devboard. Output of dmesg:

[  112.940331] usb 1-3.1: New USB device found, idVendor=1915, idProduct=c00a
[  112.940335] usb 1-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  112.940338] usb 1-3.1: Product: nRF52 Connectivity
[  112.940341] usb 1-3.1: Manufacturer: Nordic Semiconductor
[  112.940343] usb 1-3.1: SerialNumber: EE54BF5A789B
[ 112.948394] usb 1-3.1: can't set config #1, error -32

We tried different OS and SW (bootloader/softdevice/application) versions all with the same outcome.

After a lot of testing and tracing we found out, that when we pull out the usb-dongle ot of the usb-socket just that far that the power-pins are still connected and only the connection-pins are disconnected and then plug it back, the device will be detected just fine. Also when using a external usb-hub it will come up normally.

So it seems the problem comes from a timing issue between the xavier-usb (tegra-xusb) driver and the dongle. Probably the dongle delivers the usb-config too slow so that the kernel has no config to select the further loading of cdc_acm.

Is there anything we can do in the bootloader/softdevice/app to somehow fix this problem, so that no external usb-hub is needed?

  • For our own custom use-case we were able to fix this problem by first applying power to the board/chips, and then reset the chips after some delay with a GPIO.

    Nonetheless we finally got some time to start debugging.

    we've downloaded the latest SDK (17.1.0), put the switches into the expected positions (power source: VDD; sw6: DEFAULT; Power: ON) copied the cdc_acm example (nRF5_SDK_17.1.0_ddde560/examples/peripheral/usbd_cdc_acm/hex/usbd_cdc_acm_pca10056.hex) into the mounted nrf filesystem where the device resets automatically afterwards. Then we connected to /dev/ttyACM0 via minicom with the given terminal settings (115k, 8n1, ...) and also to /dev/ttyACM1 after plugging in the nrfUSB connection.

    on the ACM0 we get a uard_cli prompt:

    uart_cli:~$

    on the ACM1 we get some data when pressing button 1 and led 3 blinks when typing things in the host-minicom.

    How can we now see the debug log when plugging in the nrf-usb connection?

  • Hi 

    Do you not get log data in the ACM0 terminal?

    You should get something like this when running the example (in this case I first connect the USB, then send four characters through the USB CDC comport, and then I remove and reconnect the USB again):

    If you want you can also redirect logging to another interface, such as RTT. Then you will not depend on the UART console for logging information, but can use the debug interface instead. To view the RTT log you need to use the J-Link RTT Viewer application, and enable RTT logging by setting NRF_LOG_BACKEND_RTT_ENABLED 1 in sdk_config.h, while setting NRF_CLI_LOG_BACKEND 0. 

    Best regards
    Torbjørn

Related