Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: Teensy 4.0 USB serial with NXP SDK

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    4

    Teensy 4.0 USB serial with NXP SDK

    Hi,

    I want to send and receive data from my computer to the Teensy 4.0. If I create my project using arduino IDE it is not difficult.
    I am writing my project using NXP SDK, I need the benefits that the SDK gives me.
    How can I define the serial port via the micro USB so I can do this?

    TIA,

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,407
    Paul crafted working USB code for the ARM T_3.0 and has evovled it for all the newer Teensy products as well. That is the code working with Arduino installed with TeensyDuino.

    Hard to believe the SDK for those and many others as the family of microcontrollers evolved without example usable USB code as one of its benefits?

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    4
    The SDK does not support naturally the Teensy board, so i'm not sure what changes I need to do in order for it to work.

    Where can I get a hold of Pauls USB code for Teensy 4.0?

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,407
    Quote Originally Posted by bezalelk View Post
    The SDK does not support naturally the Teensy board, so i'm not sure what changes I need to do in order for it to work.

    Where can I get a hold of Pauls USB code for Teensy 4.0?
    All of the sources used for running code is installed with Teensy Installer in the indicated Arduino IDE folder.

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,681
    As @defragster mentioned, the Teensyduino installs it. The main sources are up on github. The main Cores code is at: https://github.com/PaulStoffregen/cores

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,757
    Quote Originally Posted by bezalelk View Post
    Where can I get a hold of Pauls USB code for Teensy 4.0?
    Assuming you've installed Arduino & Teensyduino, the code is already on your computer at {Arduino}/hardware/teensy/avr/cores/teensy4. Look at the files usb.c, usb_serial.c and usb_desc.c for the USB code. The usb_desc.h header file is also quite important for configuring which USB type the code will implement.

    If you are using Windows, the default Arduino location is C:\Program Files (x86)\Arduino. On Macintosh & Linux, or Windows if you used the non-admin ZIP file, it's wherever you extracted Arduino and selected when you run the Teensyduino installer.


    Quote Originally Posted by bezalelk View Post
    I am writing my project using NXP SDK, I need the benefits that the SDK gives me.
    I'm curious what benefits you're expecting from NXP's SDK. Can you explain?

Posting Permissions

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