USB Class & missing application notes in asf.atmel.com

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

Dears, 

 

I am trying to implement an USB MIDI stack with a SAMD MCU, but it seems to be pretty difficult to me for a lack of experience/knowledge and missing documentation.

 

This post has two main scopes then:

1) to warn to whom may concern, that every application note in asf.atmel.com link is broken, a new page opens every time and a microchip.com refresh is applied.
So, no learn integration, sadly. Try this: http://asf.atmel.com/docs/latest...

2) to help this poor guy to find good material to better learn the USB stack implementation.

 

Point 2 expansion:

 

Right now I understood, in this specific case, the USB-MIDI protocol in some parts.

I learnt its relative USB Device descriptor structures, the config. desc. struts, and how the data packet is wrapped and the communication is done in the framework.

What I am not able to understand is how the ASF USB stack works, it is too complex for me and I have big difficulties to associate which function does what.

 

Opening up a typical SAMD AtmelStudio USB Project, I see the directory structure as:

 

(from \src\ASF\common\services)
└───usb
    │   usb_atmel.h
    │   usb_protocol.h
    │
    ├───class
    │   └───midi
    │       │   usb_protocol_midi.h (*renamed from* usb_protocol_cdc.c)
    │       │
    │       └───device
    │               udi_midi.c *renamed from*
    │               udi_midi.h *renamed from*
    │               udi_midi_conf.h *renamed from*
    │               udi_midi_desc.c *renamed from*
    │
    └───udc
            udc.c
            udc.h
            udc_desc.h
            udd.h
            udi.h

 

What I learnt from Dan's LUFA library and from midi.org documentation is that:

- I need to define the descriptor and config structures.
- I need to take care of the USB MIDI protocol wrapping

 

What I can't do, is to understand every USB layer functionalities. 

I know, I just need to study the code, but I hope some one of you can shed a light on this thing or give me some good literature to study.

 

Thank you!!

Daryl.

 

This topic has a solution.

The only way of discovering the limits of the possible is to venture a little way past them into the impossible - Arthur C. Clarke

Last Edited: Fri. Feb 9, 2018 - 06:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

daryldee wrote:
1) to warn to whom may concern, that every application note in asf.atmel.com link is broken

As far as I know, atmel.com is dead or nearly so.  I'd expect that you can find the corollary tree somewhere on Microchip's site.  I used your link and drilled down a bit but didn't really see an app notes section. 

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sry, I forgot to say to click on some of the examples.

Eg: USB Device HID generic

It will appear the Application notes section just under documentation.

 

Anyway, thank you for the info!

 

About the USB implementation, I made progresses, I understood this reading the code:

 

main() calls udc_start().

 

udc_start() calls udd_enable()

udd_enable(args) manages the hardware and in the end calls udd_attach()

udd_attach() sets sleep mode, executes usb_device_attach(&usb_device) sets HW register DEVICE.CTRLB, regiters callbacks and enables callbacks.

USB init completed.

 

Now I miss to know how to configure the USB Device interfaces, specifically how to pass the arguments and use the USB pipe.

The only way of discovering the limits of the possible is to venture a little way past them into the impossible - Arthur C. Clarke

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I still don't see app notes/links thereto.  What link in particular as an example?  If you take the app not number/title and use Google, does it find any hits?  I drilled down and found explanation and source code e.g.

http://asf.atmel.com/docs/latest...

http://asf.atmel.com/docs/latest...

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting... so looks like your page is loaded differently than mine. Uhm.

About the ASF documentation, this is well loaded and nothing misses for every file.

My problem is the integration with app notes, that would be great to read as an aid on the learning process.

Try with (eg) Atmel AVR4900: ASF - USB Device Stack, it is impossible to find. For luck I found AVR4907 in AvrFreaks :).

Some of those ANs are available in some parts in the web, but not entirely.

 

Anyway, just as a reference, below my screenshot of the webpage I posted early, just to be sure...

 

screenshot

 

 

The only way of discovering the limits of the possible is to venture a little way past them into the impossible - Arthur C. Clarke

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is this what you are looking for http://ww1.microchip.com/downloads/en/AppNotes/doc8360.pdf AVR4900: ASF - USB Device stack

 

EDIT: Use these search terms in your browser  site:microchip.com avr4900

 

EDIT2: Use my search solution in post #8 below.

 

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

"Make XMEGA Great Again!"  - Greg Muth

Last Edited: Mon. Feb 5, 2018 - 07:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

YEAH! Beautiful! 

 

Thank you larry, that's a nice hint.

 

If some one of you have also a good literature to suggest, it would be great.

The only way of discovering the limits of the possible is to venture a little way past them into the impossible - Arthur C. Clarke

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In addition to the above, go to http://www.microchip.com/ and type AVR4905 into the search field at the top right of the page and you will get a page full of links.

 

Moral of the story, go to http://www.microchip.com/ , AKA the new owners' web site.

 

EDIT: This is actually works much better than my suggestion in post #6 above.

 

NOTE: BTW, searching for Atmel documents this way was not working very well in the recent past but is much improved now, kudos to Microchip.

"void transmigratus(void) {transmigratus();} // recursio infinitus" - larryvc

"It's much more practical to rely on the processing powers of the real debugger, i.e. the one between the keyboard and chair." - JW wek3

"When you arise in the morning think of what a privilege it is to be alive: to breathe, to think, to enjoy, to love." -  Marcus Aurelius

"Make XMEGA Great Again!"  - Greg Muth

Last Edited: Mon. Feb 5, 2018 - 07:30 PM