[HN Gopher] An Embedded USB Device Stack in Ada
       ___________________________________________________________________
        
       An Embedded USB Device Stack in Ada
        
       Author : todsacerdoti
       Score  : 57 points
       Date   : 2021-11-04 18:03 UTC (4 hours ago)
        
 (HTM) web link (blog.adacore.com)
 (TXT) w3m dump (blog.adacore.com)
        
       | SavantIdiot wrote:
       | This is a big step forward. And it took him 4+ years, clearly a
       | labor of love.
       | 
       | There is a large gap between Ada applications and BSPs. For
       | example, you need bindings to the underlying hardware which are
       | part of the vendor BSP: CubeMX from STM, SimplicityStudio from
       | SiLabs, SmartSnippets from Dialog. Having to do that on your own
       | is painful, it's a little better than an FFI, but you still need
       | to prototype the object files you are binding to in Ada. This is
       | what often stalls me. Fortunately TinyUSB is supported on all the
       | major STM Lx parts.
       | 
       | I'm seeing bits and pieces of Ada on Arm showing up on the web,
       | but without BSP support it isn't going to go very far. It will be
       | a while before Ada can become a first-class embedded language on
       | commodity parts, but this is a big step.
        
       | amelius wrote:
       | > I had a first working version of the USB stack for the
       | STM32F405 micro-controller about four years ago, but I couldn't
       | find the time to make this implementation clean and micro-
       | controller agnostic until last year.
       | 
       | How can you make the implementation micro-controller agnostic if
       | the microcontroller itself implements the USB protocol as well to
       | a great extent, and you don't want to waste that part of the
       | silicon?
        
         | synack wrote:
         | The USB stack communicates with the device controller using a
         | well defined interface. As long as a driver implements all of
         | the methods in this interface, the USB stack doesn't need to
         | know anything about the hardware.
         | 
         | Interface: https://github.com/Fabien-
         | Chouteau/usb_embedded/blob/main/sr...
         | 
         | Implementation:
         | https://github.com/JeremyGrosser/rp2040_hal/blob/master/src/...
        
       | ajxs wrote:
       | Fabien doing amazing work as always!
        
       ___________________________________________________________________
       (page generated 2021-11-04 23:01 UTC)