USB device types
USB device types
Hi, I'm not sure if this is possible, but can I get the pyboard to press t as another type of USB device, or am I stuck with HID/Serial?
Re: USB device types
OK, looking a little deeper, it's totally possible. I'm a little rusty with C, but have been meaning to do some more. Any pointers as to where to start looking in the code?
Re: USB device types
Is it possible that the 'boot.py' script on your pyboard's is configured to boot up in CDC+HID mode? The default is to boot up in CDC+MSC mode (serial emulation plus mass storage) but you can make it boot into CDC+HID mode by uncommenting the line
in boot.py. Of course, if you aren't in CDC+MSC mode then you can't directly see boot.py on your filesystem.
Are you running code from an SD Card? If so, try removing it to see what that does. If not, I think that you can reset the boot.py script to its default setting by holding down the 'USR' button while pressing the reset button. (I know that this resets the main.py script, not sure about boot.py)
Hope this helps.
Bryan
Code: Select all
#pyb.usb_mode('CDC+HID') # act as a serial device and a mouse
Are you running code from an SD Card? If so, try removing it to see what that does. If not, I think that you can reset the boot.py script to its default setting by holding down the 'USR' button while pressing the reset button. (I know that this resets the main.py script, not sure about boot.py)
Hope this helps.
Bryan
Re: USB device types
Those two modes work fine. What I actually want is to present as a USB Audio Class device, set up isochronous endpoints and send the data to a DAC over I2S. The peripherals library for the STM32F4 has some useful code, but getting it working with python is the tricky part. I'll have to dig into the code when I have time to see how the pyb module sets the various USB device descriptors.
Re: USB device types
Sorry about that; I misinterpreted your comment about being stuck with HID/Serial.
As for being able to present as a USB Audio Class Device, sign me up as interested. I'm a hardware designer rather than software developer, but I have been running Micro Python on a board I had already developed, an audio amplifier with a built-in DSP codec controlled by an STM32F405RGT6, conveniently the same chip that Damien chose for the pyboard.
Before getting too involved in writing code to get the USB Audio Class to work, note that I2S is not yet supported in Micro Python, so the built-in 12-bit DACs are the only way to get audio out of the chip. I'm looking into supporting I2S, but as I noted I'm not a software developer so it might be more accurate to say that I'm trying to get others interested in supporting it. I'm happy to test it if someone gets there before me.
As for being able to present as a USB Audio Class Device, sign me up as interested. I'm a hardware designer rather than software developer, but I have been running Micro Python on a board I had already developed, an audio amplifier with a built-in DSP codec controlled by an STM32F405RGT6, conveniently the same chip that Damien chose for the pyboard.
Before getting too involved in writing code to get the USB Audio Class to work, note that I2S is not yet supported in Micro Python, so the built-in 12-bit DACs are the only way to get audio out of the chip. I'm looking into supporting I2S, but as I noted I'm not a software developer so it might be more accurate to say that I'm trying to get others interested in supporting it. I'm happy to test it if someone gets there before me.