nRF5340 USB CDC ACM fails to enumerate

Greetings,

I am bringing up the USB on our custom board with an nRF5340 SoC. As always I start with a sample, in this case usb cdc acm. 
This sample works as expected with my 5340DK and my 52840DK.  However, it fails to enumerate our custom board. 
The first indication that something is wrong is the chirp and speed detection as a low speed device (Beagle 480 Traces below). 

Setup is as follows: 
Windows 11
Zephyr version: 3.3.99 (C:/ncs/v2.4.0/zephyr)

Our custom board has to add the following to prj.conf 
# Internal LP OSC 
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=
CONFIG_TIMER_READS_ITS_FREQUENCY_AT_RUNTIME=y

# Note: The NFC pins are enabled by default. 
# NFC can be disabled and GPIOs enabled by setting 
# the CONFIG_NFCT_PINS_AS_GPIOS to y
CONFIG_NFCT_PINS_AS_GPIOS=

Custom board description
USB4085-GF-A connector: CC pins not setup, DP1 DP2 connected together, DN1 DN2 connected together
TS5USBC41: DP/DN routed here then to A11/A12 

5340DK Trace 
0,FS,2,0:10.513.323,,,,,,<Full-speed>,
0,FS,3,0:10.516.323,97.678.500 ms,,,,,<Suspend>,
0,FS,4,0:10.614.002,54.862.616 ms,,,,,<Reset> / <Chirp J> / <Tiny J>,
0,FS,5,0:10.668.864,,,,,,<Full-speed>,
0,FS,6,0:10.669.430,11.003.250 ms,,,,,[12 SOF],[Frames: 1280 - 1291]
0,FS,7,0:10.681.205,21.750 us,0 B,,00,00,Set Address,Address=04
1,FS,8,0:10.681.205,12.833 us,8 B,,00,00, SETUP txn,00 05 04 00 00 00 00 00
2,FS,9,0:10.681.205,2.083 us,3 B,,00,00, SETUP packet,2D 00 10
2,FS,10,0:10.681.209,7.416 us,11 B,,00,00, DATA0 packet,C3 00 05 04 00 00 00 00 00 EB 70
2,FS,11,0:10.681.217,750 ns,1 B,,00,00, ACK packet,D2
1,FS,12,0:10.681.219,7.500 us,0 B,,00,00, IN txn,
2,FS,13,0:10.681.219,2.083 us,3 B,,00,00, IN packet,69 00 10
2,FS,14,0:10.681.223,2.083 us,3 B,,00,00, DATA1 packet,4B 00 00
2,FS,15,0:10.681.226,750 ns,1 B,,00,00, ACK packet,D2
0,FS,16,0:10.681.431,3.002.416 ms,,,,,[4 SOF],[Frames: 1292 - 1295]
0,FS,17,0:10.684.435,148.416 us,8 B,,04,00,Get Device Descriptor,Index=0 Length=8

Custom Board Trace 
0,,2,0:00.000.000,15.892.469.383 s,,,,,<Reset> / <Chirp K> / <Tiny K>,
0,,3,0:15.892.469,163.850.616 ms,,T,,,<Reset> / <Target disconnected>,
0,LS,4,0:18.322.844,,,,,,<Low-speed>,
0,LS,5,0:18.325.844,98.225.333 ms,,,,,<Suspend>,
0,LS,6,0:18.424.069,54.862.550 ms,,,,,<Reset> / <Chirp K> / <Tiny K>,
0,LS,7,0:18.478.932,,,,,,<Low-speed>,
0,LS,8,0:18.479.885,11.002.483 ms,,,,,[12 KEEP-ALIVE],
0,LS,9,0:18.491.228,85.433 us,8 B,I,00,00,SETUP txn,00 05 0B 00 00 00 00 00
1,LS,10,0:18.491.228,16.483 us,3 B,,00,00, SETUP packet,2D 00 10
1,LS,11,0:18.491.254,59.433 us,11 B,,00,00, DATA0 packet,C3 00 05 0B 00 00 00 00 00 EB 8F
0,LS,12,0:18.491.353,85.116 us,8 B,I,00,00,SETUP txn,00 05 0B 00 00 00 00 00
1,LS,13,0:18.491.353,16.233 us,3 B,,00,00, SETUP packet,2D 00 10
1,LS,14,0:18.491.378,59.783 us,11 B,,00,00, DATA0 packet,C3 00 05 0B 00 00 00 00 00 EB 8F
0,LS,15,0:18.491.477,85.533 us,8 B,I,00,00,SETUP txn,00 05 0B 00 00 00 00 00
1,LS,16,0:18.491.477,16.583 us,3 B,,00,00, SETUP packet,2D 00 10
1,LS,17,0:18.491.503,59.533 us,11 B,,00,00, DATA0 packet,C3 00 05 0B 00 00 00 00 00 EB 8F
0,LS,18,0:18.494.563,246.548.216 ms,,T,,,<Suspend>,
0,LS,19,0:19.492.156,54.862.566 ms,,,,,<Reset> / <Chirp K> / <Tiny K>,
0,LS,20,0:19.547.019,,,,,,<Low-speed>,
0,LS,21,0:19.547.600,54.862.550 ms,,,,,<Reset> / <Chirp K> / <Tiny K>,
0,LS,22,0:19.602.462,,,,,,<Low-speed>,

  • Hi,

     

    The lack of ACK in this trace indicate that the nRF isn't responding:

    Custom Board Trace 
    0,,2,0:00.000.000,15.892.469.383 s,,,,,<Reset> / <Chirp K> / <Tiny K>,
    0,,3,0:15.892.469,163.850.616 ms,,T,,,<Reset> / <Target disconnected>,
    0,LS,4,0:18.322.844,,,,,,<Low-speed>,
    0,LS,5,0:18.325.844,98.225.333 ms,,,,,<Suspend>,
    0,LS,6,0:18.424.069,54.862.550 ms,,,,,<Reset> / <Chirp K> / <Tiny K>,
    0,LS,7,0:18.478.932,,,,,,<Low-speed>,
    0,LS,8,0:18.479.885,11.002.483 ms,,,,,[12 KEEP-ALIVE],
    0,LS,9,0:18.491.228,85.433 us,8 B,I,00,00,SETUP txn,00 05 0B 00 00 00 00 00
    1,LS,10,0:18.491.228,16.483 us,3 B,,00,00, SETUP packet,2D 00 10
    1,LS,11,0:18.491.254,59.433 us,11 B,,00,00, DATA0 packet,C3 00 05 0B 00 00 00 00 00 EB 8F
    0,LS,12,0:18.491.353,85.116 us,8 B,I,00,00,SETUP txn,00 05 0B 00 00 00 00 00
    1,LS,13,0:18.491.353,16.233 us,3 B,,00,00, SETUP packet,2D 00 10
    1,LS,14,0:18.491.378,59.783 us,11 B,,00,00, DATA0 packet,C3 00 05 0B 00 00 00 00 00 EB 8F
    0,LS,15,0:18.491.477,85.533 us,8 B,I,00,00,SETUP txn,00 05 0B 00 00 00 00 00
    1,LS,16,0:18.491.477,16.583 us,3 B,,00,00, SETUP packet,2D 00 10
    1,LS,17,0:18.491.503,59.533 us,11 B,,00,00, DATA0 packet,C3 00 05 0B 00 00 00 00 00 EB 8F
    0,LS,18,0:18.494.563,246.548.216 ms,,T,,,<Suspend>,
    0,LS,19,0:19.492.156,54.862.566 ms,,,,,<Reset> / <Chirp K> / <Tiny K>,
    0,LS,20,0:19.547.019,,,,,,<Low-speed>,
    0,LS,21,0:19.547.600,54.862.550 ms,,,,,<Reset> / <Chirp K> / <Tiny K>,
    0,LS,22,0:19.602.462,,,,,,<Low-speed>,

    Q1: Does your custom board run other samples, like hello_world, successfully?

    Q2: Does this happen on all custom boards, or only a few?

    Q3: Are the DCDC inductors in-place? If not, you should n-select these kconfig's: https://github.com/nrfconnect/sdk-zephyr/blob/v3.3.99-ncs1/boards/arm/nrf5340dk_nrf5340/Kconfig#L8-L21

     

    Kind regards,

    Håkon

  • A1: We've got the entire application running, got a late start on usb due to resources.
    A2: I've only tried two boards thus far
    Q3: This is something I will have to check on and get back to this. 

    Regards
    Mike

  • Hi Mike,

     

    If the application prints any debug info, you can disregard the DCDC question. If DCDC is enabled in firmware, and inductors not present on your hardware, it will effectively be in a reset loop (ie. VDD_NRF will drop, create a power-on-reset, before it starts up again) 

    How is the USB signalling path on your custom design? Note that there shall be no series resistors present on the D+/D- lines.

    The USB will try to start up the external crystal. Does any of the bluetooth samples run as expected?

    If not, then it could be a problem with the 32MHz xtal.

     

    Kind regards,

    Håkon

  • We are using logging via RTT backend. 

    The signal path has a TS5USBC41 dual switch between the connector and mcu D+/D- pins.  

    As stated above regarding the Crystal:
    Our custom board has to add the following to prj.conf 
    # Internal LP OSC 
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=

    Bluetooth is working just fine so I assumed it was not a clock issue.   

    The board should definitely not be getting a low speed report, which is why I suspect electrical.  

    Any other possible KConfigs?  I read about an internal resistor for USB but with Zephyr (and the other dev kits working) I assume that is all done under the covers for me? 

     

  • Hi Michael,

     

    Mike Pulice said:
    Bluetooth is working just fine so I assumed it was not a clock issue.   

    That is good to hear.

    Mike Pulice said:
    The signal path has a TS5USBC41 dual switch between the connector and mcu D+/D- pins.  

    Have you checked if the switch is in the correct position? The default seems to select D1 pair.

    Also check the level of the /OE signal, to ensure that the output is enabled.

     

    Mike Pulice said:
    The board should definitely not be getting a low speed report, which is why I suspect electrical.  

    Shall be reporting full speed. Note the lack of ACKs in the trace that you posted, ie. the nRF is not replying to anything.

    Mike Pulice said:
    Any other possible KConfigs?  I read about an internal resistor for USB but with Zephyr (and the other dev kits working) I assume that is all done under the covers for me? 

    There's internal series resistors on the D+/D- lines inside the pad, so you should just route directly from the nRF pins to the usb mux.

     

    Kind regards,

    Håkon

Related