Author Topic: Is Atmel-START for real?  (Read 2775 times)

0 Members and 1 Guest are viewing this topic.

Offline uncle bitTopic starter

  • Contributor
  • Posts: 11
  • Country: it
Is Atmel-START for real?
« on: September 30, 2018, 01:57:55 pm »
Hello,
I'm fighting against Atmel-START and ASF4, trying to setup a simple MSC USB host functionality on a SAMD51J19.
The official ASF4 documentation is, IMHO, almost useless, because it barely lists some defines, structures and functions, without clarifying what has to be manually typed in by the user, and what is already included by START.
There is some example code, but it seems to refer to the old ASF3 library, showing names and concepts that I don't recognize in any of the automatically generated files.
I would like to use ASF3 (totally visible code) instead of ASF4 (hidden code), but Microchip doesn't support it on the SAMx51 family.
Anyway, I successfully registered the handler and the callback functions, started the USB stack, and powered the bus, but when I plug a memory device, it doesn't trigger any response.
I hope that the USB circuit is alive and clocked, since START shows 48 MHz from one of the PLLs and doesn't report any configuration error.
Can anyone point me toward a working ASF4 example?

 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Is Atmel-START for real?
« Reply #1 on: September 30, 2018, 02:59:32 pm »
I am fighting a lot against usb host library for PIC32MK. the only example available for usb host (after two years and some months) is the MSD library.
I tried that and of course none of the memory devices work.
I then enabled the debug trace to one of the uarts (the USB stack will report its status on the debug trace, if enabled) and that, combined with usbslyzer on windows confirmed what others were telling me. The problem was in all the memory sticks i used, because none of them had a compatible descriptor. Apparently, MSD is really a mess because the devices have different descriptors for the same thing.. and you have to support all the possible variants.
One of the memory sticks i have reports several descriptors with all zeros, the last one having the meaningful data. And the embedded stack was programmed to be able to list only so many.
 

Offline uncle bitTopic starter

  • Contributor
  • Posts: 11
  • Country: it
Re: Is Atmel-START for real?
« Reply #2 on: October 01, 2018, 07:06:47 am »
I'm afraid I'm stuck at an early stage of the protocol: I don't get in touch with any device, or at least I don't receive a callback stating that a USB device is electrically plugged in and reachable.
AFAIK, the USB host circuit recognizes a connection when the USB device pulls or pushes one of the data lines to a certain logic level, different from the default idle condition.
After such a "first contact", the USB protocol goes ahead with some data exchange, where host and device must be in tune each other about what to ask and what to expect back as a suitable answer.
Am I the only unlucky guy who picked up a so messy and poorly supported combination?  :)
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3461
  • Country: it
Re: Is Atmel-START for real?
« Reply #3 on: October 01, 2018, 07:41:16 am »
Well i am, but for another target :D
I don't know, if i was not clear before i would suggest you look at the code to see if a software trace is implemented, enable it and see what happens..
Maybe try to contact user ataradov as he is the local ATSAM expert?
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Is Atmel-START for real?
« Reply #4 on: October 05, 2018, 02:39:49 am »
Why do I have the gut feeling that this might be a point people would start double thinking their choice of libraries...? I kind of hope the libusb_stm32 library can be ported to Atmel chips.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf