Forum Rule: Always post complete source code & details to reproduce any issue!
-
How to add extra SerialUSB to Teensy4.1
Hi,
I have tried expanding on TRIPLE SERIAL in the hope of creating HEPTA_SERIAL, which will give me Serial, plus SerialUSB1..6.
I have editied and created in some cases:
yield.cpp
serialEventUSB3.cpp
serialEventUSB4.cpp
serialEventUSB5.cpp
serialEventUSB6.cpp
core_pins.h
usb.c
usb_serial.h
usb_inst.cpp
usb_desc.h
usb_desc.c
EventResponder.cpp
usb_serial4.cpp
usb_serial5.cpp
usb_serial6.cpp
usb_serial7.cpp
boards.txt
keywords.txt
There is a lot of stuff here, so I don't want to blindly post it.
It all compiles, but only SerialUSB1 works, the others do not. If I specify TRIPLE_SERIAL, then SerialUSB1 and 2 are OK. Just my implementation breaks things. I do get all of the ports enumerating on both a rasp pi, and a mac, just no data passes through. My simple test just sends a string every second to the SerialUSBn ports.
So first off, is what I am attempting OK?
If I'm on the right track, have I missed a file in the edits?
I can of course post all of my files if it's not really obvious where my issue lies.
Thanks,
Andy
-
Senior Member+
Sorry, this is probably a question that maybe only Paul can answer,
But my gut tells me that you may not be able to do this.
That is the IMXRT1060RM section 42.2.1 mentions: Up to 8 bidirectional endpoints per each of the two USB controllers.
And I believe each USB Serial requires 2 end points and there is 1 extra one used. Not sure if one could disable that other end point.
But if you look for example at the Triple Serial:
It is using up to ENDPOINT7...
So again I could be wrong, and maybe one could fudge a 4th Serial... But I don't think you could go beyond that.
-

Originally Posted by
KurtE
Sorry, this is probably a question that maybe only Paul can answer,
But my gut tells me that you may not be able to do this.
That is the IMXRT1060RM section 42.2.1 mentions: Up to 8 bidirectional endpoints per each of the two USB controllers.
And I believe each USB Serial requires 2 end points and there is 1 extra one used. Not sure if one could disable that other end point.
But if you look for example at the Triple Serial:
It is using up to ENDPOINT7...
So again I could be wrong, and maybe one could fudge a 4th Serial... But I don't think you could go beyond that.
Oh bugger. Looks like I need to come up with another plan. Lets see what Paul can add. Thanks.
-
Senior Member
Kurt is right. The Teensy 4.x hardware simply does not support enough endpoints to add a 4th CDC serial.
But it could be done on Teensy 3.x. Each CDC serial needs 2 endpoints (1 bidirectional data, 1 unidirectional status). The USB device hardware on Teensy 3.x can implement up to 16 endpoints and only endpoint 0 is reserved.
-
Senior Member+
Well one off the wall thought is to add a UART to USB converter and use one of the hardware serial ports. In theory, something like:
Note, I haven't used these boards. The low end boards don't have flow control options.
-

Originally Posted by
PaulStoffregen
Kurt is right. The Teensy 4.x hardware simply does not support enough endpoints to add a 4th CDC serial.
But it could be done on Teensy 3.x. Each CDC serial needs 2 endpoints (1 bidirectional data, 1 unidirectional status). The USB device hardware on Teensy 3.x can implement up to 16 endpoints and only endpoint 0 is reserved.
Thanks Paul. Since it's clear my initial plan won't work, I can look at alternatives. Combining the 4 serial port data streams on the USB host and using one SerialUSB on the teensy and demuxing them is an option.
Thanks again.
...Andy
-

Originally Posted by
MichaelMeissner
Well one off the wall thought is to add a UART to USB converter and use one of the hardware serial ports. In theory, something like:
Note, I haven't used these boards. The low end boards don't have flow control options.
Thanks for the suggestion, but in this case I only have on e USB port and don't want to add a hub into the design. The data is packeted, so I can implement a mux/demux to combine the data into one USB stream.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules