Teensy 4.0 First Beta Test

Status
Not open for further replies.
FYI - I ordered one of the Logitech keyboard/trackpad units you mentioned... But see you have it basically working...

Will talk more about USBHost and Bluetooth soon... Wondering if to continue to talk about it on this thread and/or on separate thread as not specific to just T4 beta?

As I mentioned I was also thinking of hacking up a carrier board, that allowed me access to the bottom pins, plus a second set of pins more like the Talldog breakout boards, like his T3.2 one (https://www.tindie.com/products/loglow/teensy-32-breakout-revision-d/), with maybe USB like adapter like he has for the T3.6...

But not sure it is worth it yet, until we have a better understanding of what the actual final board be like. Will it have the same form factor? Will the locations of the bottom pins stay at the same spots, including the USB host pads?

And as some of you have already mentioned, it usually takes more more than one attempt to get a somewhat working board... And only have one T4 beta board, so would not want to ruin it with bad stuff!...
 
FYI - I ordered one of the Logitech keyboard/trackpad units you mentioned... But see you have it basically working...

Will talk more about USBHost and Bluetooth soon... Wondering if to continue to talk about it on this thread and/or on separate thread as not specific to just T4 beta?
Not sure if you would have the same problem. I couldn't find the receiver that came with the keyboard so I had to use the Unifying Receiver. Will be interesting to see if it works out of the box.

May be worth to start a separate thread on USBHost and Bluetooth. Getting really hard to find anything that I remember seeing :)

As I mentioned I was also thinking of hacking up a carrier board, that allowed me access to the bottom pins, plus a second set of pins more like the Talldog breakout boards, like his T3.2 one (https://www.tindie.com/products/loglow/teensy-32-breakout-revision-d/), with maybe USB like adapter like he has for the T3.6...

But not sure it is worth it yet, until we have a better understanding of what the actual final board be like. Will it have the same form factor? Will the locations of the bottom pins stay at the same spots, including the USB host pads?

And as some of you have already mentioned, it usually takes more more than one attempt to get a somewhat working board... And only have one T4 beta board, so would not want to ruin it with bad stuff!...
I probably jumped the gun on this but figured it would be a good start with getting the layout correct - deciding if I want to keep audio board pins, etc. Will be easier later to rearrange things later on. I didn't do anything with the underside pins yet - figure future rev. After this probably won't redesign until the final T4 design.
 
KurtE - what Bluetooth USB dongle hardware are you 'working' with/toward working? With my T4 I also got some USB_Host cables for T_3.6 {so I know where they are :)} … having a thread for "T_3.6 Host++" could keep clutter down if Paul Okay with that - might let others with T_3.6 play along.

The T4 will change shape at some point - hopefully dropping the 0.2" width works out for a usable bottom array - and Paul might have another cool breakout already at hand for that? Some of his prior OSH boards have come in handy over time - one to make full use of the T4 for test and day 1 usage would be way cool.
 
@KurtE/@defragster

Just for info, I have a bunch of these adapters from amazon that work well for me: https://www.amazon.com/gp/product/B007Q45EF4/ref=oh_aui_search_asin_title?ie=UTF8&psc=1. Just received my USB_Host cable for the T3.6 today - still in the box so I can't loose it - yet.

I have several ones I purchased over the years (mostly to do with Odroids and RPIs and ...)

I think the last one I purchased was this one: https://smile.amazon.com/gp/product/B076FP4KQD
Some of the others I have are: https://ameridroid.com/products/usb-bluetooth-module-2

And when I was playing with them, I think all of them (or these simple dongles) are the same thing...

I will check to see what changes Paul made to make it work on T4 and add that to my Bluetooth branch.

One of these days I will figure out best way with github to say please sink my branch up and then reapply all of my changes to this state...
 
I have several ones I purchased over the years (mostly to do with Odroids and RPIs and ...)

I think the last one I purchased was this one: https://smile.amazon.com/gp/product/B076FP4KQD
Some of the others I have are: https://ameridroid.com/products/usb-bluetooth-module-2

And when I was playing with them, I think all of them (or these simple dongles) are the same thing...

I will check to see what changes Paul made to make it work on T4 and add that to my Bluetooth branch.

One of these days I will figure out best way with github to say please sink my branch up and then reapply all of my changes to this state...

Kurt
If you want a good laugh I was just working on that. I used CodeCompare against your WIP2 and copied over the differences associated with BT. Got one error on your mouse compile - all in the keyboard.cpp file:
Code:
error: 'btdevice' was not declared in this scope

If you want to start fresh or want my copy with the changes I incorporated let me know.

EDIT: File was small. This is what I have:
 

Attachments

  • USBHost_t36.zip
    131.4 KB · Views: 84
USBHost_t36 - Bluetooth

@KurtE.
Got most of it sorted out except for this one:
Code:
In file included from F:\arduino-1.8.8-t4\hardware\teensy\avr\libraries\USBHost_t36\keyboard.cpp:25:0:
F:\arduino-1.8.8-t4\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:1609:14: note: candidate: static void BluetoothController::driver_ready_for_bluetooth(BTHIDInput*)

  static void driver_ready_for_bluetooth(BTHIDInput *driver);
              ^
F:\arduino-1.8.8-t4\hardware\teensy\avr\libraries\USBHost_t36\USBHost_t36.h:1609:14: note:   no known conversion for argument 1 from 'KeyboardController*' to 'BTHIDInput*'
which comes from init calling this function:
Code:
	BluetoothController::driver_ready_for_bluetooth(this);

EDIT: Do you have a keyboard example that works with your Bluetooth mods?
 
Last edited:
OK, this is done: Got SDHC working both on T3.6 and T4.
(had two silly errors)

Tomorrow will clean-up code and will submit tomorrow PR to Paul's repository (stay tuned).

PR submitted

Comment:
As before, in the actual implementation data are read and written block-wise (512 byte at the time) and therefore limited in speed.
Multi-block read/write is not supported.
Also, as before, clock speed is limited to 25 MHz.
 
2019-02-08 11_05_14-Start.png
There seems to be a new update FEB/2019 ..not sure, the PDF shows the Date 12/2018, and this change summary:
Appendix B
Change summary from rev0 to rev1
B.1 Change summary for this latest revision
Major changes in this revision are as follows:
• ADC channel number fixed in the Introduction chapter: "Block Diagram" and
"Features" sections
• Some update in the System Boot chapter: table "ROM Bootloader Peripheral
PinMux"
• Minor fix in the System Boot chapter: table "LUT sequence definition for Serial
NOR"
• Some update in the External Signals and Pin Multiplexing chapter: table "Muxing
Options", GPT rows
• Note updated in the Clock and Power Management chapter: section "Crystal
Oscillator (XTALOSC)"
• Minor fix in the CCM chapter: removed the redundant table “System Clocks, Gating,
and Override” in the section "System Clocks"
• Some update in the CCM chapter: section "PLL reference clock"
• Minor fix in the SNVS chapter: section "SNVS Structure"
• Minor update in the Fusemap chapter: table "Fusemap Descriptions"
• Note added in the SEMC chapter: section "Chip-specific SEMC information"
• Some updates in the SEMC chapter: "Features", "Signals" and "Pin Mux in SEMC"
sections
• Minor update in the CSI chapter, “connect with two 8-bit sensors” not supported
• Minor fix in the USB Command Register (USB_nUSBCMD): bit14 ATDTW
• Some update in the FlexCAN register part: DBG registers added
• Minor fix in the LPUART register part: base address
 
This shows an error:
Code:
PROGMEM volatile int foo;
PROGMEM void setup() {}
void loop() {foo = 1;}

Code:
...
sketch_feb08b: In function 'void loop()':
sketch_feb08b:1: [B][COLOR=#ff0000]error: foo causes a section type conflict with void setup()[/COLOR][/B]
 PROGMEM volatile int foo;

                      ^

C:\Users\Frank\Documents\Arduino\sketch_feb08b\sketch_feb08b.ino:2:14: note: 'void setup()' was declared here

 PROGMEM void setup() {}

              ^

foo causes a section type conflict with void setup()

Edit: using "const" for "foo" does not change anything.
 
Last edited:
@KurtE

I uploaded an updated copy of the T4 USBhost with your changes for BT. I finally got it to compile and upload, but as soon as it uploads it looses USB connection to the PC, "USB malfunction, not recognized etc etc etc".

I put the combined copy on my WIP page on GitHub: https://github.com/mjs513/WIP/tree/master/USBHost_t36_BT

Thanks, yesterday I also had Git try to do the merge. (Merge master into branch). It errored on two files, which I think I resolved, I then tried to build and found some other issues, which I fixed...

I have also run into the issue that it kills the USB. One interesting thing is that the BT dongle does show some blinking, Maybe need to see if debug crash somewhere...
 
…...
I have also run into the issue that it kills the USB. One interesting thing is that the BT dongle does show some blinking, Maybe need to see if debug crash somewhere...
In my case as soon as I hit the sermon button it crashes so I don't see the lights on the hub or the dongle.

EDIT: As a test I commented out anything to do with joystick or mouse in the sketch and just left HID in for a driver. It compiled and uploaded and ran. I also plugged the usb dongle directly into the USB port on the shield. Unfortunately it stopped at some point and T4 started blinking rapidly:
Code:
USB Host Testing


USB Host Testing
960
                
              5
                      0
                         20008000
                20008000
             10001803
           
             
             10001005

Device Descriptor:
  12 01 00 02 FF 01 01 40 5C 0A E8 21 12 01 01 02 03 01 
    VendorID = 0A5C, ProductID = 21E8, Version = 0112
    Class/Subclass/Protocol = 255 / 1 / 1
    Number of Configurations = 1
            
            
Broadcom Corp
            
BCM20702A0
            
5CF3707A1CC9
            
                     218
            
Configuration Descriptor:
  09 02 DA 00 04 01 00 E0 00 
    NumInterfaces = 4
    ConfigurationValue = 1
  09 04 00 00 03 FF 01 01 00 
    Interface = 0
    Number of endpoints = 3
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 81 03 10 00 01 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 16
    Polling Interval = 1
  07 05 82 02 40 00 01 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 1
  07 05 02 02 40 00 01 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 1
  09 04 01 00 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 00 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 0
    Polling Interval = 1
  07 05 03 01 00 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 0
    Polling Interval = 1
  09 04 01 01 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 09 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 9
    Polling Interval = 1
  07 05 03 01 09 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 9
    Polling Interval = 1
  09 04 01 02 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 11 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 17
    Polling Interval = 1
  07 05 03 01 11 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 17
    Polling Interval = 1
  09 04 01 03 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 19 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 25
    Polling Interval = 1
  07 05 03 01 19 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 25
    Polling Interval = 1
  09 04 01 04 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 21 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 33
    Polling Interval = 1
  07 05 03 01 21 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 33
    Polling Interval = 1
  09 04 01 05 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 31 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 49
    Polling Interval = 1
  07 05 03 01 31 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 49
    Polling Interval = 1
  09 04 02 00 02 FF FF FF 00 
    Interface = 2
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 255 / 255
  07 05 84 02 20 00 01 
    Endpoint = 4 IN
    Type = Bulk
    Max Size = 32
    Polling Interval = 1
  07 05 04 02 20 00 01 
    Endpoint = 4 OUT
    Type = Bulk
    Max Size = 32
    Polling Interval = 1
  09 04 03 00 00 FE 01 01 00 
    Interface = 3
    Number of endpoints = 0
    Class/Subclass/Protocol = 254 / 1 / 1
  09 21 05 88 13 40 00 10 01 
    HID, 64 report descriptors

EDIT2: Made 1 change - used the pairing version for constructor and got farther, assuming joystick and mouse not defined. The dongle does not work with the hub though.
Code:
USB Host Testing
960
USB2 PLL running
 reset waited 5
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20008000
periodictable = 20008000
port change: 10001803
    connect
  begin reset
port change: 10001005
  port enabled
  end recovery
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 FF 01 01 40 5C 0A E8 21 12 01 01 02 03 01 
    VendorID = 0A5C, ProductID = 21E8, Version = 0112
    Class/Subclass/Protocol = 255 / 1 / 1
    Number of Configurations = 1
enumeration:
enumeration:
Manufacturer: Broadcom Corp
enumeration:
Product: BCM20702A0
enumeration:
Serial Number: 5CF3707A1CC9
enumeration:
Config data length = 218
enumeration:
Configuration Descriptor:
  09 02 DA 00 04 01 00 E0 00 
    NumInterfaces = 4
    ConfigurationValue = 1
  09 04 00 00 03 FF 01 01 00 
    Interface = 0
    Number of endpoints = 3
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 81 03 10 00 01 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 16
    Polling Interval = 1
  07 05 82 02 40 00 01 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 1
  07 05 02 02 40 00 01 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 1
  09 04 01 00 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 00 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 0
    Polling Interval = 1
  07 05 03 01 00 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 0
    Polling Interval = 1
  09 04 01 01 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 09 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 9
    Polling Interval = 1
  07 05 03 01 09 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 9
    Polling Interval = 1
  09 04 01 02 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 11 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 17
    Polling Interval = 1
  07 05 03 01 11 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 17
    Polling Interval = 1
  09 04 01 03 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 19 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 25
    Polling Interval = 1
  07 05 03 01 19 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 25
    Polling Interval = 1
  09 04 01 04 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 21 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 33
    Polling Interval = 1
  07 05 03 01 21 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 33
    Polling Interval = 1
  09 04 01 05 02 FF 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 1 / 1
  07 05 83 01 31 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 49
    Polling Interval = 1
  07 05 03 01 31 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 49
    Polling Interval = 1
  09 04 02 00 02 FF FF FF 00 
    Interface = 2
    Number of endpoints = 2
    Class/Subclass/Protocol = 255 / 255 / 255
  07 05 84 02 20 00 01 
    Endpoint = 4 IN
    Type = Bulk
    Max Size = 32
    Polling Interval = 1
  07 05 04 02 20 00 01 
    Endpoint = 4 OUT
    Type = Bulk
    Max Size = 32
    Polling Interval = 1
  09 04 03 00 00 FE 01 01 00 
    Interface = 3
    Number of endpoints = 0
    Class/Subclass/Protocol = 254 / 1 / 1
  09 21 05 88 13 40 00 10 01 
    HID, 64 report descriptors
enumeration:
USBHub memory usage = 960
USBHub claim_device this=20004D60
USBHub memory usage = 960
USBHub claim_device this=200049A0
KeyboardController claim this=200044A0
KeyboardController claim this=20004720
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 00 00 03 FF 01 01 00 07 05 81 03 10 00 01 07 05 82 02 40 00 01 07 05 02 02 40 00 01 09 04 01 00 02 FF 01 01 00 07 05 83 01 00 00 01 07 05 03 01 00 00 01 09 04 01 01 02 FF 01 01 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 00 00 03 FF 01 01 00 07 05 81 03 10 00 01 07 05 82 02 40 00 01 07 05 02 02 40 00 01 09 04 01 00 02 FF 01 01 00 07 05 83 01 00 00 01 07 05 03 01 00 00 01 09 04 01 01 02 FF 01 01 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 01 00 02 FF 01 01 00 07 05 83 01 00 00 01 07 05 03 01 00 00 01 09 04 01 01 02 FF 01 01 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 01 00 02 FF 01 01 00 07 05 83 01 00 00 01 07 05 03 01 00 00 01 09 04 01 01 02 FF 01 01 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 01 01 02 FF 01 01 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 01 01 02 FF 01 01 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 01 02 02 FF 01 01 00 07 05 83 01 11 00 01 07 05 03 01 11 00 01 09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 01 03 02 FF 01 01 00 07 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 01 04 02 FF 01 01 00 07 05 83 01 21 00 01 07 05 03 01 21 00 01 09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 01 05 02 FF 01 01 00 07 05 83 01 31 00 01 07 05 03 01 31 00 01 09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
KeyboardController claim this=20004720
09 04 02 00 02 FF FF FF 00 07 05 84 02 20 00 01 07 05 04 02 20 00 01 09 04 03 00 00 FE 01 01 00 09 21 05 88 13 40 00 10 01 
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 5 = ENDPOINT
Descriptor 5 = ENDPOINT
Descriptor 4 = INTERFACE
KeyboardController claim this=200044A0
KeyboardController claim this=20004720
HIDParser claim this=20005120
HIDParser claim this=20005620
HIDParser claim this=20006BA0
HIDParser claim this=20005B20
HIDParser claim this=20006020
BluetoothController claim this=20006520
Descriptor 33 = HID

Don't have a usb keyboard to test with though.
Code:
// Simple test of USB Host Mouse/Keyboard
//
// This example is in the public domain

#include "USBHost_t36.h"

USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
KeyboardController keyboard1(myusb);
KeyboardController keyboard2(myusb);
USBHIDParser hid1(myusb);
USBHIDParser hid2(myusb);
USBHIDParser hid3(myusb);
USBHIDParser hid4(myusb);
USBHIDParser hid5(myusb);
//MouseController mouse1(myusb);
//oystickController joystick1(myusb);
BluetoothController bluet(myusb, true, "0000");   // Version does pairing to device
//BluetoothController bluet(myusb);   // version assumes it already was paired
int user_axis[64];
uint32_t buttons_prev = 0;
RawHIDController rawhid1(myusb);
//RawHIDController rawhid2(myusb, 0xffc90004);

//USBDriver *drivers[] = {&hub1, &hub2,&keyboard1, &keyboard2, &joystick1, &bluet, &hid1, &hid2, &hid3, &hid4, &hid5};
USBDriver *drivers[] = {&hub1, &hub2,&keyboard1, &keyboard2, &bluet, &hid1, &hid2, &hid3, &hid4, &hid5};

#define CNT_DEVICES (sizeof(drivers)/sizeof(drivers[0]))
//const char * driver_names[CNT_DEVICES] = {"Hub1","Hub2", "KB1", "KB2", "JOY1D", "Bluet", "HID1" , "HID2", "HID3", "HID4", "HID5"};
const char * driver_names[CNT_DEVICES] = {"Hub1","Hub2", "KB1", "KB2", "Bluet", "HID1" , "HID2", "HID3", "HID4", "HID5"};

bool driver_active[CNT_DEVICES] = {false, false, false, false};

// Lets also look at HID Input devices
//USBHIDInput *hiddrivers[] = {&mouse1, &joystick1, &rawhid1, &rawhid2};
USBHIDInput *hiddrivers[] = {&rawhid1};

#define CNT_HIDDEVICES (sizeof(hiddrivers)/sizeof(hiddrivers[0]))
//const char * hid_driver_names[CNT_DEVICES] = {"Mouse1","Joystick1", "RawHid1", "RawHid2"};
const char * hid_driver_names[CNT_DEVICES] = {"RawHid1"};

bool hid_driver_active[CNT_DEVICES] = {false, false};
bool show_changed_only = false; 

uint8_t joystick_left_trigger_value = 0;
uint8_t joystick_right_trigger_value = 0;
uint64_t joystick_full_notify_mask = (uint64_t)-1;

void setup()
{
  while (!Serial) ; // wait for Arduino Serial Monitor
  Serial.println("\n\nUSB Host Testing");
  Serial.println(sizeof(USBHub), DEC);
  myusb.begin();
  keyboard1.attachPress(OnPress);
  keyboard2.attachPress(OnPress);
  keyboard1.attachExtrasPress(OnHIDExtrasPress);
  keyboard1.attachExtrasRelease(OnHIDExtrasRelease);
  keyboard2.attachExtrasPress(OnHIDExtrasPress);
  keyboard2.attachExtrasRelease(OnHIDExtrasRelease);

  rawhid1.attachReceive(OnReceiveHidData);
  //rawhid2.attachReceive(OnReceiveHidData);
}


void loop()
{
  myusb.Task();
/*
  if (Serial.available()) {
    int ch = Serial.read(); // get the first char. 
    while (Serial.read() != -1) ; 
    if ((ch == 'b') || (ch == 'B')) {
      Serial.println("Only notify on Basic Axis changes");
      joystick1.axisChangeNotifyMask(0x3ff);
    } else if ((ch == 'f') || (ch == 'F')) {
      Serial.println("Only notify on Full Axis changes");
      joystick1.axisChangeNotifyMask(joystick_full_notify_mask);

    } else {
      if (show_changed_only) {
        show_changed_only = false;
        Serial.println("\n*** Show All fields mode ***");
      } else {
        show_changed_only = true;
        Serial.println("\n*** Show only changed fields mode ***");
      }
    }
 }

  for (uint8_t i = 0; i < CNT_DEVICES; i++) {
    if (*drivers[i] != driver_active[i]) {
      if (driver_active[i]) {
        Serial.printf("*** Device %s - disconnected ***\n", driver_names[i]);
        driver_active[i] = false;
      } else {
        Serial.printf("*** Device %s %x:%x - connected ***\n", driver_names[i], drivers[i]->idVendor(), drivers[i]->idProduct());
        driver_active[i] = true;

        const uint8_t *psz = drivers[i]->manufacturer();
        if (psz && *psz) Serial.printf("  manufacturer: %s\n", psz);
        psz = drivers[i]->product();
        if (psz && *psz) Serial.printf("  product: %s\n", psz);
        psz = drivers[i]->serialNumber();
        if (psz && *psz) Serial.printf("  Serial: %s\n", psz);
      }
    }
  }
*/
  for (uint8_t i = 0; i < CNT_HIDDEVICES; i++) {
    if (*hiddrivers[i] != hid_driver_active[i]) {
      if (hid_driver_active[i]) {
        Serial.printf("*** HID Device %s - disconnected ***\n", hid_driver_names[i]);
        hid_driver_active[i] = false;
      } else {
        Serial.printf("*** HID Device %s %x:%x - connected ***\n", hid_driver_names[i], hiddrivers[i]->idVendor(), hiddrivers[i]->idProduct());
        hid_driver_active[i] = true;

        const uint8_t *psz = hiddrivers[i]->manufacturer();
        if (psz && *psz) Serial.printf("  manufacturer: %s\n", psz);
        psz = hiddrivers[i]->product();
        if (psz && *psz) Serial.printf("  product: %s\n", psz);
        psz = hiddrivers[i]->serialNumber();
        if (psz && *psz) Serial.printf("  Serial: %s\n", psz);
      }
    }
  }


/*
  if(mouse1.available()) {
    Serial.print("Mouse: buttons = ");
    Serial.print(mouse1.getButtons());
    Serial.print(",  mouseX = ");
    Serial.print(mouse1.getMouseX());
    Serial.print(",  mouseY = ");
    Serial.print(mouse1.getMouseY());
    Serial.print(",  wheel = ");
    Serial.print(mouse1.getWheel());
    Serial.print(",  wheelH = ");
    Serial.print(mouse1.getWheelH());
    Serial.println();
    mouse1.mouseDataClear();
  }
  if (joystick1.available()) {
    uint64_t axis_mask = joystick1.axisMask();
    uint64_t axis_changed_mask = joystick1.axisChangedMask();
    Serial.print("Joystick: buttons = ");
    uint32_t buttons = joystick1.getButtons();
    Serial.print(buttons, HEX);
    //Serial.printf(" AMasks: %x %x:%x", axis_mask, (uint32_t)(user_axis_mask >> 32), (uint32_t)(user_axis_mask & 0xffffffff));
    //Serial.printf(" M: %lx %lx", axis_mask, joystick1.axisChangedMask());
    if (show_changed_only) {
      for (uint8_t i = 0; axis_changed_mask != 0; i++, axis_changed_mask >>= 1) {
        if (axis_changed_mask & 1) {
          Serial.printf(" %d:%d", i, joystick1.getAxis(i));
        }
      }

    } else {
      for (uint8_t i = 0; axis_mask != 0; i++, axis_mask >>= 1) {
        if (axis_mask & 1) {
          Serial.printf(" %d:%d", i, joystick1.getAxis(i));
        }
      }
    }
    uint8_t ltv;
    uint8_t rtv;
    switch (joystick1.joystickType) {
      default:
        break;
      case JoystickController::PS4:
        ltv = joystick1.getAxis(3);
        rtv = joystick1.getAxis(4);
        if ((ltv != joystick_left_trigger_value) || (rtv != joystick_right_trigger_value)) {
          joystick_left_trigger_value = ltv;
          joystick_right_trigger_value = rtv;
          joystick1.setRumble(ltv, rtv);
        } 
        break;

      case JoystickController::PS3:
        ltv = joystick1.getAxis(18);
        rtv = joystick1.getAxis(19);
        if ((ltv != joystick_left_trigger_value) || (rtv != joystick_right_trigger_value)) {
          joystick_left_trigger_value = ltv;
          joystick_right_trigger_value = rtv;
          joystick1.setRumble(ltv, rtv, 50);
        } 
        break;

      case JoystickController::XBOXONE:   
      case JoystickController::XBOX360:   
        ltv = joystick1.getAxis(4);
        rtv = joystick1.getAxis(5);
        if ((ltv != joystick_left_trigger_value) || (rtv != joystick_right_trigger_value)) {
          joystick_left_trigger_value = ltv;
          joystick_right_trigger_value = rtv;
          joystick1.setRumble(ltv, rtv);
          Serial.printf(" Set Rumble %d %d", ltv, rtv);
        } 
        break;
    }
    if (buttons != buttons_prev) {
      if (joystick1.joystickType == JoystickController::PS3) {
        joystick1.setLEDs((buttons>>12) & 0xf); //  try to get to TRI/CIR/X/SQuare
      } else {
        uint8_t lr = (buttons & 1)? 0xff : 0;
        uint8_t lg = (buttons & 2)? 0xff : 0;
        uint8_t lb = (buttons & 4)? 0xff : 0;
        joystick1.setLEDs(lr, lg, lb);
      }
      buttons_prev = buttons;
    }

    Serial.println();
    joystick1.joystickDataClear();
  }
*/
  // See if we have some RAW data
  if (rawhid1) {
    int ch;
    uint8_t buffer[64];
    uint8_t count_chars = 0; 
    memset(buffer, 0, sizeof(buffer));
    if (Serial.available()) {
      while (((ch = Serial.read()) != -1) && (count_chars < sizeof(buffer))) {
        buffer[count_chars++] = ch;
      }
      rawhid1.sendPacket(buffer);
    }
  }
}



void OnPress(int key)
{
  Serial.print("key '");
  switch (key) {
    case KEYD_UP       : Serial.print("UP"); break;
    case KEYD_DOWN    : Serial.print("DN"); break;
    case KEYD_LEFT     : Serial.print("LEFT"); break;
    case KEYD_RIGHT   : Serial.print("RIGHT"); break;
    case KEYD_INSERT   : Serial.print("Ins"); break;
    case KEYD_DELETE   : Serial.print("Del"); break;
    case KEYD_PAGE_UP  : Serial.print("PUP"); break;
    case KEYD_PAGE_DOWN: Serial.print("PDN"); break;
    case KEYD_HOME     : Serial.print("HOME"); break;
    case KEYD_END      : Serial.print("END"); break;
    case KEYD_F1       : Serial.print("F1"); break;
    case KEYD_F2       : Serial.print("F2"); break;
    case KEYD_F3       : Serial.print("F3"); break;
    case KEYD_F4       : Serial.print("F4"); break;
    case KEYD_F5       : Serial.print("F5"); break;
    case KEYD_F6       : Serial.print("F6"); break;
    case KEYD_F7       : Serial.print("F7"); break;
    case KEYD_F8       : Serial.print("F8"); break;
    case KEYD_F9       : Serial.print("F9"); break;
    case KEYD_F10      : Serial.print("F10"); break;
    case KEYD_F11      : Serial.print("F11"); break;
    case KEYD_F12      : Serial.print("F12"); break;
    default: Serial.print((char)key); break;
  }
  Serial.print("'  ");
  Serial.print(key);
  Serial.print(" MOD: ");
  if (keyboard1) {
    Serial.print(keyboard1.getModifiers(), HEX);
    Serial.print(" OEM: ");
    Serial.print(keyboard1.getOemKey(), HEX);
    Serial.print(" LEDS: ");
    Serial.println(keyboard1.LEDS(), HEX);
  } else {
    Serial.print(keyboard2.getModifiers(), HEX);
    Serial.print(" OEM: ");
    Serial.print(keyboard2.getOemKey(), HEX);
    Serial.print(" LEDS: ");
    Serial.println(keyboard2.LEDS(), HEX);
  }

  //Serial.print("key ");
  //Serial.print((char)keyboard1.getKey());
  //Serial.print("  ");
  //Serial.print((char)keyboard2.getKey());
  //Serial.println();
}
void OnHIDExtrasPress(uint32_t top, uint16_t key) 
{
  Serial.print("HID (");
  Serial.print(top, HEX);
  Serial.print(") key press:");
  Serial.print(key, HEX);
  if (top == 0xc0000) {
    switch (key) {
      case  0x20 : Serial.print(" - +10"); break;
      case  0x21 : Serial.print(" - +100"); break;
      case  0x22 : Serial.print(" - AM/PM"); break;
      case  0x30 : Serial.print(" - Power"); break;
      case  0x31 : Serial.print(" - Reset"); break;
      case  0x32 : Serial.print(" - Sleep"); break;
      case  0x33 : Serial.print(" - Sleep After"); break;
      case  0x34 : Serial.print(" - Sleep Mode"); break;
      case  0x35 : Serial.print(" - Illumination"); break;
      case  0x36 : Serial.print(" - Function Buttons"); break;
      case  0x40 : Serial.print(" - Menu"); break;
      case  0x41 : Serial.print(" - Menu  Pick"); break;
      case  0x42 : Serial.print(" - Menu Up"); break;
      case  0x43 : Serial.print(" - Menu Down"); break;
      case  0x44 : Serial.print(" - Menu Left"); break;
      case  0x45 : Serial.print(" - Menu Right"); break;
      case  0x46 : Serial.print(" - Menu Escape"); break;
      case  0x47 : Serial.print(" - Menu Value Increase"); break;
      case  0x48 : Serial.print(" - Menu Value Decrease"); break;
      case  0x60 : Serial.print(" - Data On Screen"); break;
      case  0x61 : Serial.print(" - Closed Caption"); break;
      case  0x62 : Serial.print(" - Closed Caption Select"); break;
      case  0x63 : Serial.print(" - VCR/TV"); break;
      case  0x64 : Serial.print(" - Broadcast Mode"); break;
      case  0x65 : Serial.print(" - Snapshot"); break;
      case  0x66 : Serial.print(" - Still"); break;
      case  0x80 : Serial.print(" - Selection"); break;
      case  0x81 : Serial.print(" - Assign Selection"); break;
      case  0x82 : Serial.print(" - Mode Step"); break;
      case  0x83 : Serial.print(" - Recall Last"); break;
      case  0x84 : Serial.print(" - Enter Channel"); break;
      case  0x85 : Serial.print(" - Order Movie"); break;
      case  0x86 : Serial.print(" - Channel"); break;
      case  0x87 : Serial.print(" - Media Selection"); break;
      case  0x88 : Serial.print(" - Media Select Computer"); break;
      case  0x89 : Serial.print(" - Media Select TV"); break;
      case  0x8A : Serial.print(" - Media Select WWW"); break;
      case  0x8B : Serial.print(" - Media Select DVD"); break;
      case  0x8C : Serial.print(" - Media Select Telephone"); break;
      case  0x8D : Serial.print(" - Media Select Program Guide"); break;
      case  0x8E : Serial.print(" - Media Select Video Phone"); break;
      case  0x8F : Serial.print(" - Media Select Games"); break;
      case  0x90 : Serial.print(" - Media Select Messages"); break;
      case  0x91 : Serial.print(" - Media Select CD"); break;
      case  0x92 : Serial.print(" - Media Select VCR"); break;
      case  0x93 : Serial.print(" - Media Select Tuner"); break;
      case  0x94 : Serial.print(" - Quit"); break;
      case  0x95 : Serial.print(" - Help"); break;
      case  0x96 : Serial.print(" - Media Select Tape"); break;
      case  0x97 : Serial.print(" - Media Select Cable"); break;
      case  0x98 : Serial.print(" - Media Select Satellite"); break;
      case  0x99 : Serial.print(" - Media Select Security"); break;
      case  0x9A : Serial.print(" - Media Select Home"); break;
      case  0x9B : Serial.print(" - Media Select Call"); break;
      case  0x9C : Serial.print(" - Channel Increment"); break;
      case  0x9D : Serial.print(" - Channel Decrement"); break;
      case  0x9E : Serial.print(" - Media Select SAP"); break;
      case  0xA0 : Serial.print(" - VCR Plus"); break;
      case  0xA1 : Serial.print(" - Once"); break;
      case  0xA2 : Serial.print(" - Daily"); break;
      case  0xA3 : Serial.print(" - Weekly"); break;
      case  0xA4 : Serial.print(" - Monthly"); break;
      case  0xB0 : Serial.print(" - Play"); break;
      case  0xB1 : Serial.print(" - Pause"); break;
      case  0xB2 : Serial.print(" - Record"); break;
      case  0xB3 : Serial.print(" - Fast Forward"); break;
      case  0xB4 : Serial.print(" - Rewind"); break;
      case  0xB5 : Serial.print(" - Scan Next Track"); break;
      case  0xB6 : Serial.print(" - Scan Previous Track"); break;
      case  0xB7 : Serial.print(" - Stop"); break;
      case  0xB8 : Serial.print(" - Eject"); break;
      case  0xB9 : Serial.print(" - Random Play"); break;
      case  0xBA : Serial.print(" - Select DisC"); break;
      case  0xBB : Serial.print(" - Enter Disc"); break;
      case  0xBC : Serial.print(" - Repeat"); break;
      case  0xBD : Serial.print(" - Tracking"); break;
      case  0xBE : Serial.print(" - Track Normal"); break;
      case  0xBF : Serial.print(" - Slow Tracking"); break;
      case  0xC0 : Serial.print(" - Frame Forward"); break;
      case  0xC1 : Serial.print(" - Frame Back"); break;
      case  0xC2 : Serial.print(" - Mark"); break;
      case  0xC3 : Serial.print(" - Clear Mark"); break;
      case  0xC4 : Serial.print(" - Repeat From Mark"); break;
      case  0xC5 : Serial.print(" - Return To Mark"); break;
      case  0xC6 : Serial.print(" - Search Mark Forward"); break;
      case  0xC7 : Serial.print(" - Search Mark Backwards"); break;
      case  0xC8 : Serial.print(" - Counter Reset"); break;
      case  0xC9 : Serial.print(" - Show Counter"); break;
      case  0xCA : Serial.print(" - Tracking Increment"); break;
      case  0xCB : Serial.print(" - Tracking Decrement"); break;
      case  0xCD : Serial.print(" - Pause/Continue"); break;
      case  0xE0 : Serial.print(" - Volume"); break;
      case  0xE1 : Serial.print(" - Balance"); break;
      case  0xE2 : Serial.print(" - Mute"); break;
      case  0xE3 : Serial.print(" - Bass"); break;
      case  0xE4 : Serial.print(" - Treble"); break;
      case  0xE5 : Serial.print(" - Bass Boost"); break;
      case  0xE6 : Serial.print(" - Surround Mode"); break;
      case  0xE7 : Serial.print(" - Loudness"); break;
      case  0xE8 : Serial.print(" - MPX"); break;
      case  0xE9 : Serial.print(" - Volume Up"); break;
      case  0xEA : Serial.print(" - Volume Down"); break;
      case  0xF0 : Serial.print(" - Speed Select"); break;
      case  0xF1 : Serial.print(" - Playback Speed"); break;
      case  0xF2 : Serial.print(" - Standard Play"); break;
      case  0xF3 : Serial.print(" - Long Play"); break;
      case  0xF4 : Serial.print(" - Extended Play"); break;
      case  0xF5 : Serial.print(" - Slow"); break;
      case  0x100: Serial.print(" - Fan Enable"); break;
      case  0x101: Serial.print(" - Fan Speed"); break;
      case  0x102: Serial.print(" - Light"); break;
      case  0x103: Serial.print(" - Light Illumination Level"); break;
      case  0x104: Serial.print(" - Climate Control Enable"); break;
      case  0x105: Serial.print(" - Room Temperature"); break;
      case  0x106: Serial.print(" - Security Enable"); break;
      case  0x107: Serial.print(" - Fire Alarm"); break;
      case  0x108: Serial.print(" - Police Alarm"); break;
      case  0x150: Serial.print(" - Balance Right"); break;
      case  0x151: Serial.print(" - Balance Left"); break;
      case  0x152: Serial.print(" - Bass Increment"); break;
      case  0x153: Serial.print(" - Bass Decrement"); break;
      case  0x154: Serial.print(" - Treble Increment"); break;
      case  0x155: Serial.print(" - Treble Decrement"); break;
      case  0x160: Serial.print(" - Speaker System"); break;
      case  0x161: Serial.print(" - Channel Left"); break;
      case  0x162: Serial.print(" - Channel Right"); break;
      case  0x163: Serial.print(" - Channel Center"); break;
      case  0x164: Serial.print(" - Channel Front"); break;
      case  0x165: Serial.print(" - Channel Center Front"); break;
      case  0x166: Serial.print(" - Channel Side"); break;
      case  0x167: Serial.print(" - Channel Surround"); break;
      case  0x168: Serial.print(" - Channel Low Frequency Enhancement"); break;
      case  0x169: Serial.print(" - Channel Top"); break;
      case  0x16A: Serial.print(" - Channel Unknown"); break;
      case  0x170: Serial.print(" - Sub-channel"); break;
      case  0x171: Serial.print(" - Sub-channel Increment"); break;
      case  0x172: Serial.print(" - Sub-channel Decrement"); break;
      case  0x173: Serial.print(" - Alternate Audio Increment"); break;
      case  0x174: Serial.print(" - Alternate Audio Decrement"); break;
      case  0x180: Serial.print(" - Application Launch Buttons"); break;
      case  0x181: Serial.print(" - AL Launch Button Configuration Tool"); break;
      case  0x182: Serial.print(" - AL Programmable Button Configuration"); break;
      case  0x183: Serial.print(" - AL Consumer Control Configuration"); break;
      case  0x184: Serial.print(" - AL Word Processor"); break;
      case  0x185: Serial.print(" - AL Text Editor"); break;
      case  0x186: Serial.print(" - AL Spreadsheet"); break;
      case  0x187: Serial.print(" - AL Graphics Editor"); break;
      case  0x188: Serial.print(" - AL Presentation App"); break;
      case  0x189: Serial.print(" - AL Database App"); break;
      case  0x18A: Serial.print(" - AL Email Reader"); break;
      case  0x18B: Serial.print(" - AL Newsreader"); break;
      case  0x18C: Serial.print(" - AL Voicemail"); break;
      case  0x18D: Serial.print(" - AL Contacts/Address Book"); break;
      case  0x18E: Serial.print(" - AL Calendar/Schedule"); break;
      case  0x18F: Serial.print(" - AL Task/Project Manager"); break;
      case  0x190: Serial.print(" - AL Log/Journal/Timecard"); break;
      case  0x191: Serial.print(" - AL Checkbook/Finance"); break;
      case  0x192: Serial.print(" - AL Calculator"); break;
      case  0x193: Serial.print(" - AL A/V Capture/Playback"); break;
      case  0x194: Serial.print(" - AL Local Machine Browser"); break;
      case  0x195: Serial.print(" - AL LAN/WAN Browser"); break;
      case  0x196: Serial.print(" - AL Internet Browser"); break;
      case  0x197: Serial.print(" - AL Remote Networking/ISP Connect"); break;
      case  0x198: Serial.print(" - AL Network Conference"); break;
      case  0x199: Serial.print(" - AL Network Chat"); break;
      case  0x19A: Serial.print(" - AL Telephony/Dialer"); break;
      case  0x19B: Serial.print(" - AL Logon"); break;
      case  0x19C: Serial.print(" - AL Logoff"); break;
      case  0x19D: Serial.print(" - AL Logon/Logoff"); break;
      case  0x19E: Serial.print(" - AL Terminal Lock/Screensaver"); break;
      case  0x19F: Serial.print(" - AL Control Panel"); break;
      case  0x1A0: Serial.print(" - AL Command Line Processor/Run"); break;
      case  0x1A1: Serial.print(" - AL Process/Task Manager"); break;
      case  0x1A2: Serial.print(" - AL Select Tast/Application"); break;
      case  0x1A3: Serial.print(" - AL Next Task/Application"); break;
      case  0x1A4: Serial.print(" - AL Previous Task/Application"); break;
      case  0x1A5: Serial.print(" - AL Preemptive Halt Task/Application"); break;
      case  0x200: Serial.print(" - Generic GUI Application Controls"); break;
      case  0x201: Serial.print(" - AC New"); break;
      case  0x202: Serial.print(" - AC Open"); break;
      case  0x203: Serial.print(" - AC Close"); break;
      case  0x204: Serial.print(" - AC Exit"); break;
      case  0x205: Serial.print(" - AC Maximize"); break;
      case  0x206: Serial.print(" - AC Minimize"); break;
      case  0x207: Serial.print(" - AC Save"); break;
      case  0x208: Serial.print(" - AC Print"); break;
      case  0x209: Serial.print(" - AC Properties"); break;
      case  0x21A: Serial.print(" - AC Undo"); break;
      case  0x21B: Serial.print(" - AC Copy"); break;
      case  0x21C: Serial.print(" - AC Cut"); break;
      case  0x21D: Serial.print(" - AC Paste"); break;
      case  0x21E: Serial.print(" - AC Select All"); break;
      case  0x21F: Serial.print(" - AC Find"); break;
      case  0x220: Serial.print(" - AC Find and Replace"); break;
      case  0x221: Serial.print(" - AC Search"); break;
      case  0x222: Serial.print(" - AC Go To"); break;
      case  0x223: Serial.print(" - AC Home"); break;
      case  0x224: Serial.print(" - AC Back"); break;
      case  0x225: Serial.print(" - AC Forward"); break;
      case  0x226: Serial.print(" - AC Stop"); break;
      case  0x227: Serial.print(" - AC Refresh"); break;
      case  0x228: Serial.print(" - AC Previous Link"); break;
      case  0x229: Serial.print(" - AC Next Link"); break;
      case  0x22A: Serial.print(" - AC Bookmarks"); break;
      case  0x22B: Serial.print(" - AC History"); break;
      case  0x22C: Serial.print(" - AC Subscriptions"); break;
      case  0x22D: Serial.print(" - AC Zoom In"); break;
      case  0x22E: Serial.print(" - AC Zoom Out"); break;
      case  0x22F: Serial.print(" - AC Zoom"); break;
      case  0x230: Serial.print(" - AC Full Screen View"); break;
      case  0x231: Serial.print(" - AC Normal View"); break;
      case  0x232: Serial.print(" - AC View Toggle"); break;
      case  0x233: Serial.print(" - AC Scroll Up"); break;
      case  0x234: Serial.print(" - AC Scroll Down"); break;
      case  0x235: Serial.print(" - AC Scroll"); break;
      case  0x236: Serial.print(" - AC Pan Left"); break;
      case  0x237: Serial.print(" - AC Pan Right"); break;
      case  0x238: Serial.print(" - AC Pan"); break;
      case  0x239: Serial.print(" - AC New Window"); break;
      case  0x23A: Serial.print(" - AC Tile Horizontally"); break;
      case  0x23B: Serial.print(" - AC Tile Vertically"); break;
      case  0x23C: Serial.print(" - AC Format"); break;

    }
  }
  Serial.println();
}

void OnHIDExtrasRelease(uint32_t top, uint16_t key) 
{
  Serial.print("HID (");
  Serial.print(top, HEX);
  Serial.print(") key release:");
  Serial.println(key, HEX);
}

bool OnReceiveHidData(uint32_t usage, const uint8_t *data, uint32_t len) {
  // Called for maybe both HIDS for rawhid basic test.  One is for the Teensy
  // to output to Serial. while still having Raw Hid... 
  if (usage == 0xffc90004) {
    // Lets trim off trailing null characters.
    while ((len > 0) && (data[len-1] == 0)) {
      len--;
    }
    if (len) {
      Serial.print("RawHid Serial: ");
      Serial.write(data, len);
    }
  } else {
    Serial.print("RawHID data: ");
    Serial.println(usage, HEX);
    while (len) {
      uint8_t cb = (len > 16)? 16 : len;
      const uint8_t *p = data;
      uint8_t i;
      for (i = 0; i < cb; i++) {
        Serial.printf("%02x ", *p++);
      }
      Serial.print(": ");
      for (i = 0; i < cb; i++) {
        Serial.write(((*data >= ' ')&&(*data <= '~'))? *data : '.');
        data++;
      }
      len -= cb;
      Serial.println();
    }
  }

  return true;
}
 
Last edited:
This shows an error:
Code:
PROGMEM volatile int foo;
PROGMEM void setup() {}
void loop() {foo = 1;}
Typically PROGMEM is only used for data, and not for functions.

What the compiler is telling you is there was a previous declaration of setup without specifying a section, and you are redefining it. I believe Teensy 3.x/LC just defined PROGMEM as nothing, so the compiler proper didn't see it after the preprocessor handled the #define. I believe Teensy 4.x defines PROGMEM to be an __attribute__ putting the data into a special section.

Due to the way C/C++ type descriptors work, if you declare a function as:
Code:
const void foo (void) { ... }

The const binds to the type being returned by the function and not to the function body. But the function returns void (i.e. nothing). If the function returned a pointer, then the const would bind to the memory pointed to by the pointer returned by the function, and the compiler would allow you to read from that pointer, but not modify what it points to.

For those people that don't know what PROGMEM is, AVR processors are so-called Harvard processors, where the text (read-only flash for holding the program) and data (read/write SRAM) spaces are different, while ARM processors used in the Teensy LC/3.x/4.x boards are called Von-Neumann processors where the text and data are logically in the same space. In a Harvard processor, address 0x100 can refer to two separate things, depending on whether the context is text space or data space. In a Von-Neumann processor, 0x100 refers to a single address. The address may be read-only or read/write depending on the memory layout.

The PROGMEM stuff is a way to put large constant data tables into the larger read-only program space. You use an accessor macro (F) to copy part of the data from the text space to the data space to use it temporarily. This is very useful on systems like the ATtiny85 that only has 512 bytes of read/write SRAM, and 8 kilobytes of read-only text memory.

On ARM systems, you just use const, and the compiler puts it automatically into a read-only area. The F accessor is just a simple pointer dereference.
 
@mjs513, I may grab your version soon and try it...

Right now I am trying a process of elimination... That is I tried commenting out code that create the BT list of objects, still dies. Tried making a few fixes like make sure the Next field is set to NULL (for both BT and HID), still dies... Although nothing unusual in the Serial4 outputs....


But if I compile and run it on T3.6 it runs. Have not tried it yet with seeing if the BT units can talk...

Will try commenting out more and more code to see if I can figure out where it is having problems...
Like maybe compiler with issues about multiple inheritance?
Like Keyboard now is: class KeyboardController : public USBDriver , public USBHIDInput, public BTHIDInput {

The BTHidInput was the part that was added... Likewise to joystick. Thought I had it for Mouse as well, but don't see it...
 
@mjs513, I may grab your version soon and try it...

Right now I am trying a process of elimination... That is I tried commenting out code that create the BT list of objects, still dies. Tried making a few fixes like make sure the Next field is set to NULL (for both BT and HID), still dies... Although nothing unusual in the Serial4 outputs....


But if I compile and run it on T3.6 it runs. Have not tried it yet with seeing if the BT units can talk...

Will try commenting out more and more code to see if I can figure out where it is having problems...
Like maybe compiler with issues about multiple inheritance?
Like Keyboard now is: class KeyboardController : public USBDriver , public USBHIDInput, public BTHIDInput {

The BTHidInput was the part that was added... Likewise to joystick. Thought I had it for Mouse as well, but don't see it...

@KurtE, did you see all the edits in post #1588. Maybe some of it will help you with the debugging process to isolate the problem
 
@MichaelMeissner:

Typically PROGMEM is only used for data, and not for functions.

What the compiler is telling you is there was a previous declaration of setup without specifying a section, and you are redefining it. I believe Teensy 3.x/LC just defined PROGMEM as nothing, so the compiler proper didn't see it after the preprocessor handled the #define. I believe Teensy 4.x defines PROGMEM to be an __attribute__ putting the data into a special section.

Due to the way C/C++ type descriptors work, if you declare a function as:
Code:
const void foo (void) { ... }

The const binds to the type being returned by the function and not to the function body. But the function returns void (i.e. nothing). If the function returned a pointer, then the const would bind to the memory pointed to by the pointer returned by the function, and the compiler would allow you to read from that pointer, but not modify what it points to.

For those people that don't know what PROGMEM is, AVR processors are so-called Harvard processors, where the text (read-only flash for holding the program) and data (read/write SRAM) spaces are different, while ARM processors used in the Teensy LC/3.x/4.x boards are called Von-Neumann processors where the text and data are logically in the same space. In a Harvard processor, address 0x100 can refer to two separate things, depending on whether the context is text space or data space. In a Von-Neumann processor, 0x100 refers to a single address. The address may be read-only or read/write depending on the memory layout.

The PROGMEM stuff is a way to put large constant data tables into the larger read-only program space. You use an accessor macro (F) to copy part of the data from the text space to the data space to use it temporarily. This is very useful on systems like the ATtiny85 that only has 512 bytes of read/write SRAM, and 8 kilobytes of read-only text memory.

On ARM systems, you just use const, and the compiler puts it automatically into a read-only area. The F accessor is just a simple pointer dereference.

Michael, for the T4 it is intended to be used for const data and code. It's true, we have linear adress-space - but different memorys:

- ITCM (@0x0, 256KB fast RAM, uncached) is 256KB and intended for code.
- DTCM (@0x20000000, 256Kb fast RAM, uncached) is intendeded for data,
- OTCM (@0x20200000, 512 KB RAM connected via a slower bus, can be cached) for data,
- Flash, @0x60000000, size defined by the external chip for code & data, can be cached.
- inbuilt devices

(Note: numbers shown for imxrt 1062, numbers in the file below for imxrt 1050)

At startup, ITCM and DTCM gets copied(filled) from the Flash (code for that in startup.c) . We we can have max 256KB code and 256KB data there. This is the reason for PROGMEM: We need way more than that. Wavetables or a bmp-file would use almost all RAM withou that. With PROGMEM it stays in Flash. Technically, this works. The same for Code. It can run directly from Flash, too. Paul added the PROGMEM for exactly this reason.
And indeed it works great if you use PROGMEM for both but in different compilation units. So from a users point of view it should be possible to use it for both in one single file, too (correct? :) )
So,it is indeed a bug (Not in GCC / Linker - never said that)
This is the linker-script:

Code:
MEMORY
{
    ITCM (rwx):  ORIGIN = 0x00000000, LENGTH = 128K
    DTCM (rwx):  ORIGIN = 0x20000000, LENGTH = 128K
    RAM (rwx):   ORIGIN = 0x20200000, LENGTH = 256K
    FLASH (rwx): ORIGIN = 0x60000000, LENGTH = 1536K
}

ENTRY(ImageVectorTable)

SECTIONS
{
    [COLOR=#ff0000].text.progmem[/COLOR] : {
        KEEP(*(.flashconfig))
        FILL(0xFF)
        . = ORIGIN(FLASH) + 0x1000;
        KEEP(*(.ivt))
        KEEP(*(.bootdata))
        KEEP(*(.vectors))
        KEEP(*(.startup))
        *(.progmem*)
                . = ALIGN(4);
                KEEP(*(.init))
                __preinit_array_start = .;
                KEEP (*(.preinit_array))
                __preinit_array_end = .;
                __init_array_start = .;
                KEEP (*(.init_array))
                __init_array_end = .;
        . = ALIGN(16);
    } > FLASH

    .text : {
        . = . + 32; /* MPU to trap NULL pointer deref */
        *(.fastrun)
        *(.text*)
        . = ALIGN(16);
    } > ITCM  AT> FLASH

    .vectorsRAM (NOLOAD) : {
        . = ALIGN(4);
        *(.vectorsRAM*)
    } > DTCM 
    
    .data : {
        *(.rodata*)
        *(.data*)
        . = ALIGN(16);
    } > DTCM  AT> FLASH

    .bss ALIGN(4) : {
        *(.bss*)
        *(COMMON)
        . = ALIGN(32);
        . = . + 32; /* MPU to trap stack overflow */
    } > DTCM

    .bss.dma (NOLOAD) : {
        *(.dmabuffers)
        . = ALIGN(16);
    } > RAM

    _stext = ADDR(.text);
    _etext = ADDR(.text) + SIZEOF(.text);
    _stextload = LOADADDR(.text);

    _sdata = ADDR(.data);
    _edata = ADDR(.data) + SIZEOF(.data);
    _sdataload = LOADADDR(.data);

    _estack = ORIGIN(DTCM) + LENGTH(DTCM);

    _sbss = ADDR(.bss);
    _ebss = ADDR(.bss) + SIZEOF(.bss);

    _heap_start = ADDR(.bss.dma) + SIZEOF(.bss.dma);
    _heap_end = ORIGIN(RAM) + LENGTH(RAM);

    _flashimagelen = SIZEOF(.text.progmem) + SIZEOF(.text) + SIZEOF(.data);
    _teensy_model_identifier = 0x23;

    .debug_info     0 : { *(.debug_info) }
    .debug_abbrev   0 : { *(.debug_abbrev) }
    .debug_line     0 : { *(.debug_line) }
    .debug_frame    0 : { *(.debug_frame) }
    .debug_str      0 : { *(.debug_str) }
    .debug_loc      0 : { *(.debug_loc) }

}

Code:
#define PROGMEM __attribute__((section(".progmem")))
#define PGM_P  const char *
#define PSTR(str) ({static const char data[] PROGMEM = (str); &data[0];})

You probably have not read the posts in this and older threads about PROGMEM.
So, can you help and tell us a way to make it possible without the error?

And yes, my first example was not correct (I added a note below the code a short time later)
This is better:
Code:
PROGMEM const volatile int foo = 5;
PROGMEM void setup() {}
void loop() {Serial.println(foo);}
- throws the same error:
Code:
foo causes a section type conflict with void setup()
Again, no technical reason why this should'nt work.
 
Last edited:
@mjs513 - I have tried the version you posted at the end of 1588 and so far with keyboard plugged in all I am seeing is:
Code:
USB Host Testing
960
USB2 PLL running
 reset waited 5
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20008000
periodictable = 20008000
port change: 14001403
    connect
  begin reset
port change: 14001405
  port enabled
  end recovery
new_Device: 1.5 Mbit/sec
new_Pipe
I don't think there is anything interesting on Serial4 either:
Code:
***********IMXRT Startup**********
test 1 -1234567 3
CCM_ANALOG_PLL_USB1=80003000
  enable USB clocks
CCM_ANALOG_PLL_USB1=80003040
Increasing voltage to 1250 mV
need to switch to alternate clock during reconfigure of ARM PLL
USB PLL is running, so we can use 120 MHz
Freq: 12 MHz * 100 / 2 / 1
ARM PLL=80002042
ARM PLL needs reconfigure
ARM PLL=80002064
New Frequency: ARM=600000000, IPG=150000000
USB reset took 5 loops
analogInit
usb_cdc_line_coding, baud=0
before C++ constructors
after C++ constructors
before setup
status = 00010080
status = 00000000
status = 00020080
status = 00000000
status = 00000000
after setup
status = 00080080
status = 00000000
status = 000E0080
status = 00000000
status = 00020080
status = 00000000
status = 00030080
status = 00000000
status = 00020080
status = 00000000

Next up maybe real simple mouse test program to see if that might work...

That does not work either... Wondering what is different? Probably should move my version of the library away and try the mouse one with one that was with latest install and make sure it works...

EDIT
Did not work with released last beta either... So unplugged everything. Made sure the probes were hitting USB... Worked. So put back my version of library and the mouse only worked as well, I think....

Now try to add some more back in...

EDIT 2 For some reason now the program is going farther? Including the version of Mouse with BT added....

I pushed up the changes in my branch... Hopefully did not break everything ;)
 
Last edited:
Yeah. I just put the released host back in and going to start from scratch again. When I went to try a few things it started acting funny again. Have to go find by usb keyboard and give it another try. Did you put dongle directly in the USB connector or are you using a hub with it? I plugged mine in directly
 
Mike/Kurt: for Bluetooth on USB_Host - what happens if you went to the code that worked on T_3.6 on a T_3.6 - then did the best Merge effort on T_3.6? If it works or breaks on T_3.6 that might give a starting point as nothing should have changed the T_3.6 functionality? If broken then that is in familiar old code that worked - if it works on T_3.6 then the problem is unique to any new T4 function.

Not knowing the code in my usual way - I'd use my unpublished debug_tt code and put a trace on each function and decision point - then when it faulted it would be clear what led to that with some key values at those traced points. Between lack of outside interest and the fact that Serial# stalls when faulted I haven't followed through to make that public. Perhaps I could rewrite it to use the always working PJRC :: printf_debug() on Serial4 - but I was trying to keep the output separate to minimize spew overload/crossposting. Where reducing spew until desired is why the trace is to RAM - also it minimizes overhead/impact or fear of use in _isr's or other critical code. Funny how mindlessly dropping a debug note in where you are sure it isn't needed can make clear a wrong assumption or bad logic or mistyped code when something doesn't get entered or never leaves or faults from memory abuse … a couple of those things I saw trying to get the trivial process of having the Trace Log wrap and print LIFO - and write a sketch to test that.
 
Hi @defragster. As I mentioned I tried a real simple mouse only program with my current merged code and it ran fine on T3.6 (beta board)... Then tried on T4 and did not work, but then tried unplugging everything, restart computer... And then it ran on T4 board...

Came back in and tried again and again the T4, did not respond, then unplug and replug and it mouse started reporting...

So not sure yet if hardware contacts and/or timing and/or ???

Now maybe start trying out some BT devices again... I have a keyboard that I was working on before.. That was temperamental, Also at some points I had the PS4 or PS3 controller responding... Right now looks like my PS4 controller has dead battery... Not sure if it will recharge or not... need to look for PS3 one...
Actually keyboard wise may also try out my keyboard I am typing on now (Kinesis Freestyle 2 blue)...

But other than T4 issues, may want to continue some of this on other threads...
 
Hi @defragster. As I mentioned I tried a real simple mouse only program with my current merged code and it ran fine on T3.6 (beta board)... Then tried on T4 and did not work, but then tried unplugging everything, restart computer... And then it ran on T4 board...

Came back in and tried again and again the T4, did not respond, then unplug and replug and it mouse started reporting...

Okay … odd ongoing chain of events . . . with inconsistent results.

Kurt - Forget who told me about CodeCompare - not sure if you've tried it or if SublimeMerge does the same - it does file or folder diff side by side and the windows are edit windows and there are 'button' objects for each diff group that can send the change L>R or L<R selectively. Not looked how extensive the changes are but that would let you approve/see them diff by diff.
 
@KurtE
Can you post your updated lib? Not sure what happened but nothing working now. Want to try and work from same base.
 
@KurtE
Can you post your updated lib? Not sure what happened but nothing working now. Want to try and work from same base.

My current stuff is up on github: https://github.com/KurtE/USBHost_t36/tree/WIP2-Bluetooth

I have tried it with one of the dongles and the screwy keyboard: https://www.amazon.com/gp/product/B00JO80LVW

Took a bit of time, and experimenting, but I had it talking for awhile :D

I turned on the Pairing code, then run it... Then turned on keyboard, hit BT button, then typed 0000<enter>
As that was the key that was part of the code..

Then it paired and I am able to type in a few things...

Here is complete debug: output with verbose output turned on.
Code:
USB Host Testing
960
USB2 PLL running
 reset waited 5
USBHS_ASYNCLISTADDR = 0
USBHS_PERIODICLISTBASE = 20008000
periodictable = 20008000
port change: 10001803
    connect
  begin reset
port change: 10001805
  port enabled
  end recovery
new_Device: 12 Mbit/sec
new_Pipe
enumeration:
enumeration:
enumeration:
Device Descriptor:
  12 01 00 02 E0 01 01 40 12 0A 01 00 91 88 00 02 00 01 
    VendorID = 0A12, ProductID = 0001, Version = 8891
    Class/Subclass/Protocol = 224 / 1 / 1
    Number of Configurations = 1
enumeration:
enumeration:
Product: CSR8510 A10
enumeration:
Config data length = 177
enumeration:
Configuration Descriptor:
  09 02 B1 00 02 01 00 E0 32 
    NumInterfaces = 2
    ConfigurationValue = 1
  09 04 00 00 03 E0 01 01 00 
    Interface = 0
    Number of endpoints = 3
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 81 03 10 00 01 
    Endpoint = 1 IN
    Type = Interrupt
    Max Size = 16
    Polling Interval = 1
  07 05 02 02 40 00 01 
    Endpoint = 2 OUT
    Type = Bulk
    Max Size = 64
    Polling Interval = 1
  07 05 82 02 40 00 01 
    Endpoint = 2 IN
    Type = Bulk
    Max Size = 64
    Polling Interval = 1
  09 04 01 00 02 E0 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 03 01 00 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 0
    Polling Interval = 1
  07 05 83 01 00 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 0
    Polling Interval = 1
  09 04 01 01 02 E0 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 03 01 09 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 9
    Polling Interval = 1
  07 05 83 01 09 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 9
    Polling Interval = 1
  09 04 01 02 02 E0 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 03 01 11 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 17
    Polling Interval = 1
  07 05 83 01 11 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 17
    Polling Interval = 1
  09 04 01 03 02 E0 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 03 01 19 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 25
    Polling Interval = 1
  07 05 83 01 19 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 25
    Polling Interval = 1
  09 04 01 04 02 E0 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 03 01 21 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 33
    Polling Interval = 1
  07 05 83 01 21 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 33
    Polling Interval = 1
  09 04 01 05 02 E0 01 01 00 
    Interface = 1
    Number of endpoints = 2
    Class/Subclass/Protocol = 224 / 1 / 1
  07 05 03 01 31 00 01 
    Endpoint = 3 OUT
    Type = Isochronous
    Max Size = 49
    Polling Interval = 1
  07 05 83 01 31 00 01 
    Endpoint = 3 IN
    Type = Isochronous
    Max Size = 49
    Polling Interval = 1
enumeration:
USBHub memory usage = 960
USBHub claim_device this=20006C80
USBHub memory usage = 960
USBHub claim_device this=20004F80
KeyboardController claim this=20004A80
KeyboardController claim this=20004D00
HIDParser claim this=20005360
HIDParser claim this=20005860
HIDParser claim this=20005D60
HIDParser claim this=20006260
HIDParser claim this=20006760
JoystickController claim this=20007820
BluetoothController claim this=20007040
BluetoothController claim this=20007040 vid:pid=a12:1
    9 4 0 0 3 e0 1 1 0 7 5 81 3 10 0 1 7 5 2 2 40 0 1 7 5 82 2 40 0 1 9 4 1 0 2 e0 1 1 0 7 5 3 1 0 0 1 7 5 83 1 0 0 1 9 4 1 1 2 e0 1 1 0 7 5 
    3 1 9 0 1 7 5 83 1 9 0 1 9 4 1 2 2 e0 1 1 0 7 5 3 1 11 0 1 7 5 83 1 11 0 1 9 4 1 3 2 e0 1 1 0 7 5 3 1 19 0 1 7 5 83 1 19 0 1 9 4 1 4 2 e0 
    1 1 0 7 5 3 1 21 0 1 7 5 83 1 21 0 1 9 4 1 5 2 e0 1 1 0 7 5 3 1 31 0 1 7 5 83 1 31 0 1 
      rxep=1(16) txep=2(64) rx2ep=2(64)
BluetoothController, rxep=1(16), txep=2(64)
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 3, at offset = 0, shift= 0
new_Pipe
allocate_interrupt_pipe_bandwidth
 best_bandwidth = 6, at offset = 0, shift= 1
new_Pipe
HCI_RESET called (03 0c 00 )
*** Device Bluet a12:1 - connected ***
  product: CSR8510 A10
    control callback (bluetooth) 1
    Control callback (bluetooth): 1 : 3 c 0 
0E 04 01 03 0C 00 
BT rx_data(6): e 4 1 3 c 0 
    Command Completed! 
HCI_WRITE_CLASS_OF_DEV called (24 0c 03 04 08 00 )
    control callback (bluetooth) 3
    Control callback (bluetooth): 3 : 24 c 3 4 8 0 
0E 04 01 24 0C 00 
BT rx_data(6): e 4 1 24 c 0 
    Command Completed! 
HCI_Read_BD_ADDR called (09 10 00 )
    control callback (bluetooth) 4
    Control callback (bluetooth): 4 : 9 10 0 
0E 0A 01 09 10 00 13 71 DA 7D 1A 00 
BT rx_data(12): e a 1 9 10 0 13 71 da 7d 1a 0 
    Command Completed! 
   BD Addr:13:71:da:7d:1a:0
HCI_Read_Local_Version_Information called (01 10 00 )
    control callback (bluetooth) 4
    Control callback (bluetooth): 4 : 1 10 0 
0E 0C 01 01 10 00 06 BB 22 06 0A 00 BB 22 
BT rx_data(14): e c 1 1 10 0 6 bb 22 6 a 0 bb 22 
    Command Completed! 
    Local Version: 6
HCI_INQUIRY called (01 04 05 33 8b 9e 30 0a )
    control callback (bluetooth) 6
    Control callback (bluetooth): 6 : 1 4 5 33 8b 9e 30 a 
0F 04 00 01 01 04 
BT rx_data(6): f 4 0 1 1 4 
    Command 401 Status 0
02 0F 01 CB 5D 3A BD 3D 20 01 02 00 28 04 24 58 
BT rx_data(16): 2 f 1 cb 5d 3a bd 3d 20 1 2 0 28 4 24 58 
22 
BT rx_data(1): 22 
    Inquiry Result - Count: 1
      BD:cb:5d:3a:bd:3d:20, PS:1, class: 240428
02 0F 01 79 22 23 0A C5 CC 01 02 00 40 25 00 44 
BT rx_data(16): 2 f 1 79 22 23 a c5 cc 1 2 0 40 25 0 44 
3E 
BT rx_data(1): 3e 
    Inquiry Result - Count: 1
      BD:79:22:23:a:c5:cc, PS:1, class: 2540
      Peripheral device
        Keyboard
BluetoothController::find_driver  driver 20004a98
Keyboard Controller::claim_bluetooth - Class 2540
KeyboardController::claim_bluetooth TRUE
    *** Claimed ***
HCI_INQUIRY_CANCEL called (02 04 00 )
    control callback (bluetooth) 64
    Control callback (bluetooth): 100 : 2 4 0 
0E 04 01 02 04 00 
BT rx_data(6): e 4 1 2 4 0 
    Command Completed! 
HCI_CREATE_CONNECTION called (05 04 0d 79 22 23 0a c5 cc 18 cc 01 00 00 00 00 )
    control callback (bluetooth) 65
    Control callback (bluetooth): 101 : 5 4 d 79 22 23 a c5 cc 18 cc 1 0 0 0 0 
0F 04 00 01 05 04 
BT rx_data(6): f 4 0 1 5 4 
    Command 405 Status 0
03 0B 00 48 00 79 22 23 0A C5 CC 01 00 
BT rx_data(13): 3 b 0 48 0 79 22 23 a c5 cc 1 0 
    Connection Complete - ST:0 LH:48
HCI_AUTH_REQUESTED called (11 04 02 48 00 )
    control callback (bluetooth) 6E
    Control callback (bluetooth): 110 : 11 4 2 48 0 
1B 03 48 00 05 
BT rx_data(5): 1b 3 48 0 5 
0F 04 00 01 11 04 
BT rx_data(6): f 4 0 1 11 4 
    Command 411 Status 0
17 06 79 22 23 0A C5 CC 
BT rx_data(8): 17 6 79 22 23 a c5 cc 
    Event: Link Key Request 79:22:23:a:c5:cc
HCI_LINK_KEY_NEG_REPLY called (0c 04 06 79 22 23 0a c5 cc )
    control callback (bluetooth) 78
    Control callback (bluetooth): 120 : c 4 6 79 22 23 a c5 cc 
0E 0A 01 0C 04 00 79 22 23 0A C5 CC 
BT rx_data(12): e a 1 c 4 0 79 22 23 a c5 cc 
    Command Completed! 
16 06 79 22 23 0A C5 CC 
BT rx_data(8): 16 6 79 22 23 a c5 cc 
    Event: Pin Code Request 79:22:23:a:c5:cc
HCI_PIN_CODE_REPLY called (0d 04 17 79 22 23 0a c5 cc 04 30 30 30 30 00 00 00 00 00 00 00 00 00 00 00 00 )
    control callback (bluetooth) 82
    Control callback (bluetooth): 130 : d 4 17 79 22 23 a c5 cc 4 30 30 30 30 0 0 0 0 0 0 0 0 0 0 0 0 
0E 0A 01 0D 04 00 79 22 23 0A C5 CC 
BT rx_data(12): e a 1 d 4 0 79 22 23 a c5 cc 
    Command Completed! 
18 17 79 22 23 0A C5 CC 4F 50 F0 BF 51 E3 42 B5 
BT rx_data(16): 18 17 79 22 23 a c5 cc 4f 50 f0 bf 51 e3 42 b5 
36 86 10 0F A2 EA 25 7B 00 
BT rx_data(9): 36 86 10 f a2 ea 25 7b 0 
    Event: Link Key Notificaton 79:22:23:a:c5:cc Type:0
    key:4f 50 f0 bf 51 e3 42 b5 36 86 10 0f a2 ea 25 7b 
06 03 00 48 00 
BT rx_data(5): 6 3 0 48 0 
    Event: HCI Authentication complete(0): handle: 48
`ConnectionRequest called(48 20 0c 00 08 00 01 00 02 00 04 00 11 00 70 00 )
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 0 : 48 20 c 0 8 0 1 0 2 0 4 0 11 0 70 0 
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 3 0 8 0 44 0 70 0 0 0 0 0 
    L2CAP Connection Response: ID: 0, Dest:44, Source:70, Result:0, Status: 0
      Control Response
L2CAP_ConfigRequest called(48 20 10 00 0c 00 01 00 04 00 08 00 44 00 00 00 01 02 ff ff )

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 4 2 8 0 70 0 0 0 1 2 30 0 
    L2CAP config Request: ID: 2, Dest:70, Flags:0,  Options: 1 2 30 0
      Control Configuration request
L2CAP_ConfigResponse called(48 20 12 00 0e 00 01 00 05 02 0a 00 44 00 00 00 00 00 01 02 a0 02 )
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 0 : 48 20 12 0 e 0 1 0 5 2 a 0 44 0 0 0 0 0 1 2 
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 0 : 48 20 12 0 e 0 1 0 5 2 a 0 44 0 0 0 0 0 1 2 a0 2 
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 

=====================
BT rx2_data(22): 48 20 12 0 e 0 1 0 5 0 a 0 70 0 0 0 0 0 1 2 30 0 
    L2CAP config Response: ID: 0, Source:70, Flags:0, Result:0, Config: 201
Set HID Protocol 0 (48 20 05 00 01 00 44 00 70 )
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 200 : 48 20 5 0 1 0 44 0 70 
`ConnectionRequest called(48 20 0c 00 08 00 01 00 02 01 04 00 13 00 71 00 )

=====================
BT rx2_data(9): 48 20 5 0 1 0 70 0 0 
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 0 : 48 20 c 0 8 0 1 0 2 1 4 0 13 0 71 0 
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 3 1 8 0 45 0 71 0 0 0 0 0 
    L2CAP Connection Response: ID: 1, Dest:45, Source:71, Result:0, Status: 0
      Interrupt Response
L2CAP_ConfigRequest called(48 20 10 00 0c 00 01 00 04 01 08 00 45 00 00 00 01 02 ff ff )

=====================
BT rx2_data(20): 48 20 10 0 c 0 1 0 4 3 8 0 71 0 0 0 1 2 30 0 
    L2CAP config Request: ID: 3, Dest:71, Flags:0,  Options: 1 2 30 0
      Interrupt Configuration request
L2CAP_ConfigResponse called(48 20 12 00 0e 00 01 00 05 03 0a 00 45 00 00 00 00 00 01 02 a0 02 )
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 0 : 48 20 12 0 e 0 1 0 5 3 a 0 45 0 0 0 0 0 1 2 
    tx_data(bluetooth) 82
tx_data callback (bluetooth): 0 : 48 20 12 0 e 0 1 0 5 3 a 0 45 0 0 0 0 0 1 2 a0 2 
13 05 01 48 00 01 00 
BT rx_data(7): 13 5 1 48 0 1 0 

=====================
BT rx2_data(22): 48 20 12 0 e 0 1 0 5 1 a 0 71 0 0 0 0 0 1 2 30 0 
    L2CAP config Response: ID: 1, Source:71, Flags:0, Result:0, Config: 201
HCI_WRITE_SCAN_ENABLE called(1a 0c 01 02 )

=====================
BT rx2_data(17): 48 20 d 0 9 0 71 0 a1 3 88 cc c5 a 23 22 79 
HID HDR Data: len: 9, Type: 3
KeyboardController::process_bluetooth_HID_data
    control callback (bluetooth) 82
    Control callback (bluetooth): 130 : 1a c 1 2 
0E 04 01 1A 0C 00 
BT rx_data(6): e 4 1 1a c 0 
    Command Completed! 
Write_Scan_enable Completed

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 7 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 07 00 00 00 00 00 
  press, key=7
  unicode = 100
key 'd'  100 MOD: 0 OEM: 0 LEDS: 0

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 0 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 00 00 00 00 00 00 
  release, key=7

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 e 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 0E 00 00 00 00 00 
  press, key=14
  unicode = 107
key 'k'  107 MOD: 0 OEM: 0 LEDS: 0

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 0 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 00 00 00 00 00 00 
  release, key=14

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 4 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 04 00 00 00 00 00 
  press, key=4
  unicode = 97
key 'a'  97 MOD: 0 OEM: 0 LEDS: 0

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 0 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 00 00 00 00 00 00 
  release, key=4

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 16 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 16 00 00 00 00 00 
  press, key=22
  unicode = 115
key 's'  115 MOD: 0 OEM: 0 LEDS: 0

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 0 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 00 00 00 00 00 00 
  release, key=22

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 7 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 07 00 00 00 00 00 
  press, key=7
  unicode = 100
key 'd'  100 MOD: 0 OEM: 0 LEDS: 0

=====================
BT rx2_data(18): 48 20 e 0 a 0 71 0 a1 1 0 0 0 0 0 0 0 0 
HID HDR Data: len: 10, Type: 1
KeyboardController::process_bluetooth_HID_data
  KB Data: 01 00 00 00 00 00 00 00 00 
  release, key=7

=====================
BT rx2_data(17): 48 20 d 0 9 0 71 0 a1 3 87 cc c5 a 23 22 79 
HID HDR Data: len: 9, Type: 3
KeyboardController::process_bluetooth_HID_data

As you can see at the end there are keyboard data... There is also data returned for pad area, not sure I am processing any of it...

But at least some of it looks like it is limping along
 
DCP tests

The 1050/1060 has a DCP module to accelerate AES, SHA1, SHA256, and CRC32. The NXP SDK has a library (fsl_dcp.c) and simple example
boards/evkbimxrt1050/driver_examples/dcp/
and they have extended wolfssl and mbedtls to utilize the hardware acceleration. I have ported/hacked a first-cut test that runs SHA256 using the T4 beta DCP. SHA256 test vectors look good.
https://github.com/manitou48/teensy4/blob/master/dcptst.ino

Here are some data rates
Code:
         SHA256 tests on T4 beta  (opt Faster, beta9)
                 dcptst   129 MBs  DCP with hash of 16K buffer
                 wolfssl   20.5 MBs   (EVKB DCP accel 81.2 MBs)
                 mbedtls   19   MBs   (EVKB DCP accel 59.1 MBs)
                 sha256tst 14.9 MBs   (old arduino version of SHA256)
         AES CBC tests on T4 beta  (opt Faster, beta9)
                 dcptst    68.3 MBs
                 wolfssl   17.1 MBs   (EVKB accel 46.8 MBs)
                 mbedtls   12.8 MBs   (EVKB accel 48.6 MBs)
                 aes        3.2 MBs   (old arduino aes lib)

         CRC32 tests on T4 beta  (opt Faster, beta9)  16K buffer
                 dcptst   381 MBs   (EVKB SDK 348 MBs) 
                 FastCRC   40 MBs   table-driven
                 crc32bb    9 MBs   bit-bang
Earlier pre-beta NXP EVKB tests

There is no documentation in the reference manual. In an earlier post, Paul noted you need to sign an NDA to get the NXP documentation on DCP and TRNG.

EDIT: Add AES CBC and CRC32 tests. Test vectors look good.

I'm not sure the exact fixed polynomial that T4 CRC32 uses. The SDK DCP example says poly spec is
width=32 poly=0x04c11db7 init=0xffffffff refin=false refout=false xorout=0x00000000
and for that poly, CRC catalog says
width=32 poly=0x04c11db7 init=0xffffffff refin=false refout=false xorout=0x00000000 check=0x0376e6e7 residue=0x00000000 name="CRC-32/MPEG-2"
But testing with test check string "123456789", I get 0x7F046ADD which does not match the catalog check value ??

UPDATE: 12/9/19
see Buggy CRC32 post, T4 is padding input to a multiple of 4 with 0's. So poly is indeed
width=32 poly=0x04c11db7 init=0xffffffff refin=false refout=false xorout=0x00000000
BUT it will only work with input data that are a multiple of 4 in length.
CRC calculator
 
Last edited:
Status
Not open for further replies.
Back
Top