Skip to content

Teensy 4.1 (kint41) QMK support #5

@stapelberg

Description

@stapelberg

Status

  • milestone: light up LED
  • milestone: print debug messages on the serial port
  • milestone: light up a LED from ChibiOS
  • milestone: print debug messages on the serial port from ChibiOS
  • ChibiOS tests are passing successfully!
  • milestone: USB stack used successfully from ChibiOS

USB

  • the Teensy 4.1 has two USB 2.0 OTG controllers
  • I’m trying to make controller USB1 (base address 0x402E0000) work (eval board: the USB port right next to the ethernet port, called “USB OTG” in the documentation, teensy 4.1: the main and only USB port)
  • There are 5 different USB implementations I know of:
    1. NXP SDK (usb_device_dci.c)
      • supports KHCI (USB Full Speed)
      • supports EHCI (USB High speed, what the Teensy 4.1 uses)
      • supports LPC USB IP3511 FS
      • supports LPC USB IP3511 HS
    2. Paul Stoffregen’s official Arduino Teensy 4 core (usb.c)
      • Uses the EHCI interface, but also uses the teensy register macros, not NXP’s CMSIS.
    3. ChibiOS-Contrib Kinetis (hal_usb_lld.c)
      • The KINETIS hal_usb_lld.c uses the KHCI interface, which is not available on the Teensy 4.1 anymore.
      • Maybe we need to create a hal_usb_lld.c that uses the EHCI interface.
    4. The stack in libgreat is more readable/descriptive, but not 100% sure about correctness—might be better to prefer the NXP stack for now.
    5. Tamago’s USB stack: https://github.com/f-secure-foundry/tamago/tree/master/soc/imx6/usb

Building

Wiring/testing

  1. Connect a USB-to-serial adapter to teensy 4.1 pins G (GND), 16 (RX) and 17 (TX).
  2. Build and flash the ChibiOS-Contrib teensy 4.1 demo:
    cd ChibiOS-Contrib/demos/MIMXRT1062/RT-TEENSY4_1
    make
    teensy-loader-cli -w -v --mcu=TEENSY40 build/ch.hex
    
  3. After turning on the teensy 4.1, you should see debug messages on the serial console, followed by the ChibiOS test suites.

Metadata

Metadata

Assignees

Labels

kint41kinT with the Teensy 4.1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions