Forum Rule: Always post complete source code & details to reproduce any issue!
Page 4 of 4 FirstFirst ... 2 3 4
Results 76 to 86 of 86

Thread: CircuitPython on Teensy 4!

  1. #76
    Hi all! I just wanted to drop by with a link to the circuitpython.org page for Teensy 4.0: https://circuitpython.org/board/teensy40/ Teensy 4.0 is included in the latest unstable release 5.0.0-beta.5. It will be included in the 5.0.0 stable release but the port will still be considered alpha.

    circuitpython.org includes links to the latest and greatest CircuitPython releases for Teensy 4.0 (and all other boards). If you'd like to add more info to the page, it is also open source here: https://github.com/adafruit/circuitp...rd/teensy40.md

    Thanks!

  2. #77
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,799
    @tannewt
    Very cool. Noticed that there is a link to UF2 on the Teensy 4 page. Can use just use the Hex or do we need to use UF2 now?

  3. #78
    @mjs513 Use the hex for now and make sure to back up your files since the TeensyLoader erases the whole flash. I'll follow up here once we have a UF2 bootloader to try. (I've still got to figure out if we can trigger it easily too.)

  4. #79
    Senior Member+ mjs513's Avatar
    Join Date
    Jul 2014
    Location
    New York
    Posts
    4,799
    @tannewt - thanks will do.

  5. #80
    Hi all! Just wanted to point out that CircuitPython 5.0.0 is out with Teensy 4.0 support. While the whole release is marked stable, I think the port is more in a beta state. What is there works pretty well but some APIs may not be implemented. Downloads are available here: https://circuitpython.org/board/teensy40/ Thanks!

  6. #81
    Senior Member
    Join Date
    May 2015
    Posts
    395
    I want to learn Python and Rust but I just keep putting it off. I hope this nudges me to give it a shot.

  7. #82
    Quote Originally Posted by DaQue View Post
    I want to learn Python and Rust but I just keep putting it off. I hope this nudges me to give it a shot.
    Great! I've been meaning to try Rust on embedded as well! Let me know if you find any good tutorials. I'm also happy to help with any Python questions you have.

  8. #83
    Junior Member
    Join Date
    Mar 2020
    Posts
    3
    I just tried out CircuitPython for the first time on a Teensy 4.0 board and it was super easy to load and it just works. And there is one interesting feature that I first noticed on the AdaFruit page. If you have an iOS device with iOS13 then you can plug this into an iPhone/iPad and see the CIRCUITPY drive in the Files application. This doesn't happen with a Micro:bit. What is the secret which allows this to work? Perhaps the USB descriptor for the Micro:bit is asking for too much current? Anyways this is a good feature to have.

  9. #84
    Junior Member
    Join Date
    Mar 2020
    Posts
    3
    Using*https://www.thesycon.de/eng/usb_descriptordumper.shtml on Windows 10 (instead of lsusb because I was sitting at a Windows 10 machine)

    Teensy - 0x32 bMaxPower * * *(100 mA)
    Micro:bit - 0xFA bMaxPower * * *(500 mA)

    On AdaFruit there is some text stating "Also, the device must have a USB descriptor that indicates it draws 100mA or less. Many USB descriptors say 500mA even if they don't use that much!"

    So that's probably it. Thesycon’s descriptor dumper complained about some of the CircuitPython descriptors. It's been so long since I've looked at this stuff I don't have a strong opinion. I'll try to paste the whole dump here so you can take a look.

    Code:
    Information for device Teensy 4.0 (VID=0x239A PID=0x8086):
    
    *** ERROR: Descriptor has errors! ***
    
    Connection Information:
    ------------------------------
    Device current bus speed: HighSpeed
    Device supports USB 1.1 specification
    Device supports USB 2.0 specification
    Device address: 0x001E
    Current configuration value: 0x00
    Number of open pipes: 0
    
    Device Descriptor:
    ------------------------------
    0x12	bLength
    0x01	bDescriptorType
    0x0200	bcdUSB
    0x00	bDeviceClass      
    0x00	bDeviceSubClass   
    0x00	bDeviceProtocol   
    0x40	bMaxPacketSize0   (64 bytes)
    0x239A	idVendor
    0x8086	idProduct
    0x0100	bcdDevice
    0x02	iManufacturer   "PJRC"
    0x03	iProduct   "Teensy 4.0"
    0x01	iSerialNumber   "D110F7762D1770F1AC00000520002400"
    0x01	bNumConfigurations
    
    Device Qualifier Descriptor is not available. Error code: 0x0000001F
    
    Configuration Descriptor:
    ------------------------------
    0x09	bLength
    0x02	bDescriptorType
    0x0082	wTotalLength   (130 bytes)
    0x04	bNumInterfaces
    0x01	bConfigurationValue
    0x00	iConfiguration
    0xA0	bmAttributes   (Bus-powered Device, Remote-Wakeup)
    0x32	bMaxPower      (100 mA)
    
    Interface Association Descriptor:
    ------------------------------
    0x08	bLength
    0x0B	bDescriptorType
    0x00	bFirstInterface
    0x02	bInterfaceCount
    0x02	bFunctionClass      (Communication Device Class)
    0x02	bFunctionSubClass   (Abstract Control Model - ACM)
    0x00	bFunctionProtocol   
    0x00	iFunction
    
    Interface Descriptor:
    ------------------------------
    0x09	bLength
    0x04	bDescriptorType
    0x00	bInterfaceNumber
    0x00	bAlternateSetting
    0x01	bNumEndPoints
    0x02	bInterfaceClass      (Communication Device Class)
    0x02	bInterfaceSubClass   (Abstract Control Model - ACM)
    0x00	bInterfaceProtocol   
    0x04	iInterface   "CircuitPython CDC control"
    
    CDC Header Functional Descriptor:
    ------------------------------
    0x05	bFunctionalLength
    0x24	bDescriptorType
    0x00	bDescriptorSubtype
    0x0110	bcdCDC
    
    CDC Call Management Functional Descriptor:
    ------------------------------
    0x05	bFunctionalLength
    0x24	bDescriptorType
    0x01	bDescriptorSubtype
    0x01	bmCapabilities
    0x01	bDataInterface
    
    CDC Abstract Control Management Functional Descriptor:
    ------------------------------
    0x04	bFunctionalLength
    0x24	bDescriptorType
    0x02	bDescriptorSubtype
    0x02	bmCapabilities
    
    CDC Union Functional Descriptor:
    ------------------------------
    0x05	bFunctionalLength
    0x24	bDescriptorType
    0x06	bDescriptorSubtype
    0x00	bControlInterface
    0x01	bSubordinateInterface(0)
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x81	bEndpointAddress  (IN endpoint 1)
    0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
    0x0040	wMaxPacketSize    (1 x 64 bytes)
    0x10	bInterval         (32768 microframes)
    
    Interface Descriptor:
    ------------------------------
    0x09	bLength
    0x04	bDescriptorType
    0x01	bInterfaceNumber
    0x00	bAlternateSetting
    0x02	bNumEndPoints
    0x0A	bInterfaceClass      (CDC Data)
    0x00	bInterfaceSubClass   
    0x00	bInterfaceProtocol   
    0x05	iInterface   "CircuitPython CDC data"
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x02	bEndpointAddress  (OUT endpoint 2)
    0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
    0x0040	wMaxPacketSize    (64 bytes)
    0x10	bInterval         
    *** ERROR: Invalid wMaxPacketSize. Must be 512 bytes in high speed mode.
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x82	bEndpointAddress  (IN endpoint 2)
    0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
    0x0040	wMaxPacketSize    (64 bytes)
    0x10	bInterval         
    *** ERROR: Invalid wMaxPacketSize. Must be 512 bytes in high speed mode.
    
    Interface Descriptor:
    ------------------------------
    0x09	bLength
    0x04	bDescriptorType
    0x02	bInterfaceNumber
    0x00	bAlternateSetting
    0x02	bNumEndPoints
    0x08	bInterfaceClass      (Mass Storage Device Class)
    0x06	bInterfaceSubClass   (Transparent SCSI subclass)
    0x50	bInterfaceProtocol   (Bulk only transport)
    0x06	iInterface   "CircuitPython Mass Storage"
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x83	bEndpointAddress  (IN endpoint 3)
    0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
    0x0200	wMaxPacketSize    (512 bytes)
    0x00	bInterval         
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x03	bEndpointAddress  (OUT endpoint 3)
    0x02	bmAttributes      (Transfer: Bulk / Synch: None / Usage: Data)
    0x0200	wMaxPacketSize    (512 bytes)
    0x00	bInterval         
    
    Interface Descriptor:
    ------------------------------
    0x09	bLength
    0x04	bDescriptorType
    0x03	bInterfaceNumber
    0x00	bAlternateSetting
    0x02	bNumEndPoints
    0x03	bInterfaceClass      (Human Interface Device Class)
    0x00	bInterfaceSubClass   
    0x00	bInterfaceProtocol   
    0x07	iInterface   "CircuitPython HID"
    
    HID Descriptor:
    ------------------------------
    0x09	bLength
    0x21	bDescriptorType
    0x0111	bcdHID
    0x00	bCountryCode
    0x01	bNumDescriptors
    0x22	bDescriptorType   (Report descriptor)
    0x00C3	bDescriptorLength
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x84	bEndpointAddress  (IN endpoint 4)
    0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
    0x0040	wMaxPacketSize    (1 x 64 bytes)
    0x08	bInterval         (128 microframes)
    
    Endpoint Descriptor:
    ------------------------------
    0x07	bLength
    0x05	bDescriptorType
    0x04	bEndpointAddress  (OUT endpoint 4)
    0x03	bmAttributes      (Transfer: Interrupt / Synch: None / Usage: Data)
    0x0040	wMaxPacketSize    (1 x 64 bytes)
    0x08	bInterval         (128 microframes)
    
    Microsoft OS Descriptor is not available. Error code: 0x0000001F
    
    String Descriptor Table
    --------------------------------
    Index  LANGID  String
    0x00   0x0000  0x0409 
    0x02   0x0409  "PJRC"
    0x03   0x0409  "Teensy 4.0"
    0x01   0x0409  "D110F7762D1770F1AC00000520002400"
    0x04   0x0409  "CircuitPython CDC control"
    0x05   0x0409  "CircuitPython CDC data"
    0x06   0x0409  "CircuitPython Mass Storage"
    0x07   0x0409  "CircuitPython HID"
    
    ------------------------------
    
    Connection path for device: 
    USB xHCI Compliant Host Controller
    Root Hub
    Teensy 4.0 (VID=0x239A PID=0x8086) Port: 2
    
    Running on: Windows 10 or greater (Build Version 18362)
    
    Brought to you by TDD v2.12.0, Aug  2 2019, 16:35:05
    Last edited by kevans; 03-13-2020 at 04:41 PM. Reason: Wrap description in CODE tags

  10. #85
    Quote Originally Posted by kevans View Post
    I just tried out CircuitPython for the first time on a Teensy 4.0 board and it was super easy to load and it just works. And there is one interesting feature that I first noticed on the AdaFruit page. If you have an iOS device with iOS13 then you can plug this into an iPhone/iPad and see the CIRCUITPY drive in the Files application. This doesn't happen with a Micro:bit. What is the secret which allows this to work? Perhaps the USB descriptor for the Micro:bit is asking for too much current? Anyways this is a good feature to have.
    Yay! I'm glad it was easy and worked.

    I'm not sure why the micro:bit doesn't appear as a drive. The max power could definitely be the issue. I'm not the one who looked into that.

  11. #86
    Junior Member
    Join Date
    Mar 2020
    Posts
    3
    Quote Originally Posted by tannewt View Post
    Yay! I'm glad it was easy and worked.

    I'm not sure why the micro:bit doesn't appear as a drive. The max power could definitely be the issue. I'm not the one who looked into that.
    I was able to hack a Micro:bit build to lower the power requirements to 100 ma, however that was not sufficient. So I will have to study this some more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •