UC3 USB endpoint configuration problems

Go To Last Post
2 posts / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Freaks and USB specialists,

i'm coming to an dead end with my current USB project on AVR32.

I'm implementing a custom USB protocol and use the ASF vendor class example as a basis.
The example works pretty nice, unchanged...
First thing i have to adopt is the endpoint configuration. I need several bulk in and out endpoints on specific endpoint numbers. Here the problems start.
First i found out that the vendor driver always assumes that the in endpoint with address 0x8n will be configured to the usb endpoint register n. Since this was hardcoded i changed all the relevant code (mainly usbc_device.c) and now i can configure arbitrary endpoint addresses for my endpoints.
0x84 Bulk IN endpoint
0x04 Bulk OUT endpoint
0x87 Bulk IN endpoint
0x07 Bulk OUT endpoint
(no other endpoints except the standard control endpoint 0. example remains unchanged for that part).
This should work together with a PC software and driver that my company developed some years ago and the goal of my current AVR32 development is to duplicate this functionality 100%.

Now if i try to use the above mentioned configuration i cannot transfer any data via my PC USB test application anymore. I can open the device, set the configuration, see the endpoints etc. Then i send data to the OUT endpoint and nothing happens(should be mirrored back to the IN endpoint). If i debug this it seems the interrupt does not even get fired.

Right now there's only a very limited set of configurations that do work at all:
0x81 Bulk IN endpoint
0x02 Bulk OUT endpoint
- or -
0x81 interrupt IN endpoint
0x02 interrupt OUT endpoint
0x83 Bulk IN endpoint
0x04 Bulk OUT endpoint
With one of these configuration i can send data via the OUT endpoint from my PC software and it gets mirrored back to IN just like in the ASF vendor example.
If i remove the interrupt endpoints it stops to work:
0x83 Bulk IN endpoint
0x04 Bulk OUT endpoint
Of course i've tried various other configurations as well. They all did not work. I also cmpared the USB configuration registers for a working and a non-working setup i found absolutely no difference. So i don't hink it has anything to do with my changes to usbc_device.c mentioned above.

So for me it looks like the only way to get a working configuration seems to me to have each endpoint with an endpoint address that matches the endpoint number in a way(minus the 0x80 for the IN bit).

Does anyone knows if this is a limitation of the ASF vendor specific code or ASF USB stack in general?
Or more worse is it a hardware limitation of AVR32 USB (or USBC) hardware?
(Of course i searched datasheet and AVRfreaks forum but with no result so far.)

Since i'm totally stuck now i'm really open for any hint or idea anyone might come up with.

I work with UC3C0512, AS6 SP2 and ASF 3.5.1.


Here's a bit of the config files:

//! endpoints size for full speed
//! Note: Disable the endpoints of a type, if size equal 0
#define UDI_VENDOR_EPS_SIZE_INT_FS    0  //64
#define UDI_VENDOR_EPS_SIZE_ISO_FS    0  //256


//! Endpoint numbers used by vendor interface.
//! Note: The order of endpoint can depend on USB hardware capability
//! when a specific mapping is used on USB DPRAM.
#define  UDI_VENDOR_EP_BULK_IN       (1 | USB_EP_DIR_IN)


	.ep_bulk_in.bLength                = sizeof(usb_ep_desc_t),\
	.ep_bulk_in.bDescriptorType        = USB_DT_ENDPOINT,\
	.ep_bulk_in.bEndpointAddress       = UDI_VENDOR_EP_BULK_IN,\
	.ep_bulk_in.bmAttributes           = USB_EP_TYPE_BULK,\
	.ep_bulk_in.bInterval              = 0,\
	.ep_bulk_out.bLength               = sizeof(usb_ep_desc_t),\
	.ep_bulk_out.bDescriptorType       = USB_DT_ENDPOINT,\
	.ep_bulk_out.bEndpointAddress      = UDI_VENDOR_EP_BULK_OUT,\
	.ep_bulk_out.bmAttributes          = USB_EP_TYPE_BULK,\
	.ep_bulk_out.bInterval             = 0,
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, maybe it helps if shorten the long post to one question:

Does anyone know if there're any limitations in the assignment of endpoint addresses to endpoint registers in AVR32(UC3C)?

Many thanks for any hint.