Author Topic: Best Microcontroller family for USB Documentation/Tutorial  (Read 5732 times)

0 Members and 1 Guest are viewing this topic.

Offline MattHollandsTopic starter

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
    • Matt's Projects
Best Microcontroller family for USB Documentation/Tutorial
« on: April 15, 2019, 01:09:33 am »
Hey! I have a project in mind that will need to be a usb mass storage device. I have a book on the usb MSD protocol but it’s a bit old so the hardware is out dated. Can anyone suggest a good 32-bit arm Microcontroller family for writing your own USB device firmware? I’ve tried NXP before but I found their UsB documentation was pretty poor.

To be clear, I want don’t want a pre-written MSD driver (although it doesn’t hurt). A) I want to learn more about UsB by writing my own, and B) I have some specific requirements about how SCSI requests are handled.

I’m looking for a well documented USB peripheral basically with some good tutorials. Thanks!!
Read about my stuff at: projects.matthollands.com
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4676
  • Country: us
Re: Best Microcontroller family for USB Documentation/Tutorial
« Reply #1 on: April 16, 2019, 08:59:02 am »
The silence is deafening...

FTDI has a nice tutorial on USB (https://www.ftdichip.com/Support/Documents/TechnicalPublications/USBDesignByExample.htm) for their VNC2 chips, but (last I checked) they don't actually document their chip peripheral (or CPU!), so the "bottom level" of the tutorial code is proprietary FTDI libraries.  So that's probably not what you want.

The NXP USB code is supposed to be more-or-less based on the LUFA code that Dean Camera wrote for the 8bit AVRs (Dean wrote the NXP libraries too, I think?), so I would have thought that that would be better documented than most.  But again, I guess it's more about providing an abstraction on top of the particular hardware than extensively explaining the hardware.
(http://www.fourwalledcubicle.com/LUFA.php)

But perhaps that sort of abstraction is where you want to operate.  You don't "implement mass storage for an STM32Fxxx USB peripheral", you implement USB Mass Storage based on Jan Axelson's books, using some USB primitives that you implement separately for each piece of actual hardware...  (http://janaxelson.com/usbc.htm)
(so... I have read "some" of each of the above references, but I've only gotten to the point where I go "eww!  How big was the committee that came up with THIS?  Maybe I'll just use the XXX library that's already written that mostly, even though most of their code sucks.")
 
The following users thanked this post: newbrain

Offline josip

  • Regular Contributor
  • *
  • Posts: 178
  • Country: hr
Re: Best Microcontroller family for USB Documentation/Tutorial
« Reply #2 on: April 16, 2019, 09:41:33 am »
I’m looking for a well documented USB peripheral basically with some good tutorials. Thanks!!

You can find explained upper USB layer (functions) for any device, but not explained source code examples on lower level (for example like this).

I didn't know anything about USB, and books only confuse me more, so I take source code of MSP430 USB stack, and inserted (UART) logs everywhere. At the end I wrote my own USB stack from zero in assembler. I am using CDC.

Later I switched to Kinetis devices, and done it again, for CM0+ from zero in assembler. MSP430 USB experience help me, but every USB hardware module is different animal, so it was far from copy/paste. I selected Kinetis because I need dual supply (USB module 3.3V supply is different from VDD) and some other things, but identical USB hardware module can be found in Microchip/Atmel devices.

Original USB stack source code (for every vendor I know) is bloated and hard to read. And AFAIK, you can find in USB stack from any vendor, USB mass storage device class open source example.
« Last Edit: April 16, 2019, 09:44:25 am by josip »
 

Offline colorado.rob

  • Frequent Contributor
  • **
  • Posts: 426
  • Country: us
Re: Best Microcontroller family for USB Documentation/Tutorial
« Reply #3 on: April 16, 2019, 02:44:13 pm »
There are lots of example code for USB mass storage on STM32 devices, along with projects and code for many of their Nucleo and Discovery boards.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17863
  • Country: fr
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30436
  • Country: nl
    • NCT Developments
Re: Best Microcontroller family for USB Documentation/Tutorial
« Reply #5 on: April 16, 2019, 03:22:18 pm »
Hey! I have a project in mind that will need to be a usb mass storage device. I have a book on the usb MSD protocol but it’s a bit old so the hardware is out dated. Can anyone suggest a good 32-bit arm Microcontroller family for writing your own USB device firmware? I’ve tried NXP before but I found their UsB documentation was pretty poor.

To be clear, I want don’t want a pre-written MSD driver (although it doesn’t hurt). A) I want to learn more about UsB by writing my own, and B) I have some specific requirements about how SCSI requests are handled.
IMHO the NXP Lufa stack is a good place to start. I have used it in a couple of projects as a host. Sure the documentation isn't much to write home about but the structure of the library isn't bad and takes a lot of the low-level USB stuff away. There is plenty left to sink your teeth in. IIRC there is an example of a mass storage driver together with the NXP Lufa stack.

Edit: some NXP devices have a USB library in their ROM. It seems NXP's approach is not to let people write their own low-level USB stuff but concentrate on the high level only.
« Last Edit: April 16, 2019, 08:22:39 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 6200
  • Country: us
  • Eternally curious
    • Vbe - vídeo blog eletrônico
Re: Best Microcontroller family for USB Documentation/Tutorial
« Reply #6 on: April 16, 2019, 03:43:40 pm »
I am familiar with the TM4C devices and their USB implementation. They have a very long user's guide about it and, although it talks about their software implementation, IMO it goes into a decent level of functional detail.
http://www.ti.com/lit/ug/spmu297d/spmu297d.pdf

If you are also interested in the signaling itself, another device (OMAPL138) has some documents that talk about the compliance checks ad measurements:
http://www.ti.com/lit/an/sprab17/sprab17.pdf
http://www.ti.com/lit/an/sprab50/sprab50.pdf
http://www.ti.com/lit/an/sprab51/sprab51.pdf
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline badman

  • Newbie
  • Posts: 3
  • Country: us
Re: Best Microcontroller family for USB Documentation/Tutorial
« Reply #7 on: April 25, 2019, 06:40:00 pm »
I also have a MSD project with a unique SCSI requirement. I'm currently porting https://github.com/hathach/tinyusb to WCH CH568. I'm just now seeing you said ARM, but this chip is based on the less known NDS32 architecture. I got an evaluation board for free from them but it cost a ton to ship to the US. I've found porting the tinyUSB project to this new chip has helped me learn the USB protocol pretty well. I'd love to hear what your unique SCSI requirement is, PM me.  ;)
« Last Edit: April 25, 2019, 06:44:34 pm by badman »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->