USB CDC freeze on SAM3X4C

Discussion around product based on ARM Cortex M3 core.

Moderators: nferre, ncollot

Posts: 4
Joined: Tue Jan 07, 2014 4:58 pm

USB CDC freeze on SAM3X4C

Wed Jan 14, 2015 7:27 pm

Hi all, I have a strange issue using ASF CDC example of Atmel Studio on a custom a board equipped with a SAM3X4C microcontroller.
I modified the CDC example making the board led flashing each 500 milliseconds and removing the sleep manager in this way: 

Code: Select all

int main(void)

	// Initialize the sleep manager

#if !SAMD21 && !SAMR21

	 // Configure the on-board led
	gpio_configure_pin(PIO_PB7_IDX, LED0_FLAGS);

	// Start USB stack to authorize VBus monitoring

	// The main loop manages only the power mode
	// because the USB management is done by interrupt
	while (true)
		// Toggle on-board led and wait 500ms
		// sleep manager not needed for this test
	return 0;
We did not modify any other part of the example code. More than 50 boards were assembled, all works fine but 5. Only on this 5 boards, we encounter the problem described below.

The on-board led stops flashing when the USB cable is not plugged. If the USB cable is connected before turning on the board, all works fine and the USB is properly recognized by the PC as an USB CDC device. 
Moreover, if the cable is removed, the board continues to properly run for some minutes and then freezes again. The freeze happens early if we short on purpose the USB 5V pin with the USB ground using a resistor. 
Let me remark that the board works fine if VBUS is high, even if it is simply connected to a 5V power supply.

We made these two tests:
1. Removing the udc_start() call, the board does not freeze anymore.
2. We run some tests using a debugger. Using the defective boards, it seems that ISR ISR(UDD_USB_INT_FUN) of uotghs_device.c file is called even when the cable is unplugged. On the contrary, using a working board, this ISR is called only when 5V are readed by VUSB monitoring pin; the ISR is not called anymore when the cable is unplugged. In fact, there is a different behaviour between the two boards. I this this could be important to understand the problem.
Indeed, it seems that in the defective board some USB interrupts are continuously invoked when USB cable is unplugged at all. 

We also double-checked the SAM3X EK schematic and the checklist to develop our board. This is the USB section of the boards: ... ematic.jpg
Our board is self-powered and cannot be used as OTG, so it doesn't need SP2525-2 component, as reported in SAM3X EK schematic.

Did you ever encountered a similar issue? Is there a specific component in our schematic that could cause this problem, if wrong or not accurate? 
Moreover, how could the freeze issue be related to the 5V input of USB connector? 

Thanks to all,
Posts: 6
Joined: Wed Sep 24, 2014 11:23 am

Re: USB CDC freeze on SAM3X4C

Thu Jan 15, 2015 5:01 pm

The ESD protection diodes, IC1: PRTR5V0U2X, isn’t a good part for self-powered USB device.
Passing through the high-side diode in this chip, D+ pull-up voltage appears at VBUS line, while the USB connector is unplugged. This voltage disturbs detection of unplug at VBUS line.

Using the defective boards, measure the voltage of VBUS line, while the device is unplugged. You’ll see intermediate voltage near the threshold.
Solder off IC1 from the board. And then, the problem wouldn’t occur any more.

PRTR5V0U2X is good for USB host ports, but it doesn’t fit to device port.
For device port, diode array with just low-side diodes should be applied.

For example,

ST ESDAULC6-3BP6 ... 165276.pdf

ON Semi NUP4060AXV6 (for full-/low-speed) ... AXV6-D.PDF


Posts: 4
Joined: Tue Jan 07, 2014 4:58 pm

Re: USB CDC freeze on SAM3X4C

Thu Jan 15, 2015 6:33 pm

Hi Tsuneo,

thanks so much for your reply.

We soldered off the IC1 component. Unfortunately, the problem still occurs.
We are going to measure the voltage of VBUS line on the defective board with and without IC1; I'll keep you updated. 
In the meanwhile, please let me know if you have any other suggestion to fix this issue.

Posts: 4
Joined: Tue Jan 07, 2014 4:58 pm

Re: USB CDC freeze on SAM3X4C

Fri Jan 16, 2015 9:19 pm

I have some news:

1) Defective boards with IC1: VBUS goes to almost 2.64V with USB unplugged
2) Defective boards without IC1: VBUS goes to 0V with USB unplugged
3) Working board with IC1: VBUS goes to 0V with USB unplugged

Points 1 and 2 confirm what you said about the voltage, anyway the problem still occurs. 
Moreover, the freeze appears when VBUS goes to 0V, not when it is 2.64V. It sounds very strange.

Thanks again,
Posts: 4
Joined: Tue Jan 07, 2014 4:58 pm

Re: USB CDC freeze on SAM3X4C

Tue Jan 20, 2015 5:51 pm

Posts: 1
Joined: Thu Feb 12, 2015 10:15 am

Re: USB CDC freeze on SAM3X4C

Thu Feb 12, 2015 10:24 am

Hello together,

i have the same problem with usb and mC freezing.
Has someone solved this problem?
Or an idea of what this might be?

thanks a lot.

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 6 guests