Haunted USB Serial on Teensy 3.2

ryanrs

Active member
The Bug

During rx buffer starvation, usb serial will corrupt ~0.01% of packets received from the host.

(skip ahead to "The Fix" if you want a fairly wild tldr)

Tools

Bare Teensy 3.2 plugged into usb.

I am using platformio on a mac. I have verified this issue on platformio and teensyduino. I wrote the driver code on a mac, but it'll probably work on linux, too (not tested).

Mac OS 10.13.6 (High Sierra)
Platformio Core 5.1.1, Home 3.3.4
Teensyduino | Arduino 1.8.13
platform.txt says version=1.8.5 in both environments.


Testing strategy

- Create 1MB data file: 1024 blocks of 1024 bytes each.
- Precompute a hash for each block with cksum, hardcode them into the sketch.
- Feed 1MB data file to Teensy 3.2
- Teensy hashes the incoming data, compares result to pre-computed hash.
- If the hashes differ, send the rx'd block back to the host for debugging.

This lets us easily reproduce a rare bug, and capture the data so we can figure out what happened.


1MB Data File

I used teensy library source code, with runs of whitespace collapsed. The structured text makes it easier to see the corruption with diff.

data.in/
data.all - all the blocks cat'd together
data.0000
data.0001
data.0002


Driver program

Two distinct execution phases:
- Copy data from stdin to teensy until EOF.
- Copy data from teensy to stdout until a timeout.

build it:
$ gcc -o driver driver.c

Argument is the path to the teensy device file.
macs: /dev/tty.usbmodem12345
linux: /dev/ttyACM0

$ ./driver /dev/tty.usbmodem9319881 <data.in/data.all >data.out

If the whole 1MB is transferred successfully:
$ cat data.out
success

If there was corruption:
$ cat data.out
bad block 784, hash=535335854, expected=2079977378
c functions to wait for ready and send/receive packets
static inline void usb_wait_in_ready(void)
...

(the bit about "c functions" is the source code used to make the input data file)


Diff it
opendiff data.in/data.0784 data.out

haunted-usb-diff-0784.jpg


Running the driver in a loop

The driver returns 0 on success, so it's easy to run it in a loop:
$ while ./driver /dev/tty.usbmodem9319881 <data.in/data.all >data.out; do head -n 1 data.out; sleep 2; done; cat data.out; echo

It will stop on the first failure, which is recorded in data.out


Testing the test

If we do the following, the bug will not be exposed, letting us test the success condition.
- turn off the slowdown code, line 100
- compile with optimization=Faster, clock=96MHz

On a Teensy 3.2, this runs fast enough to keep the usb rx buffers from filling. No backpressure, so no corruption.


Debugging

It looks like two usb packets are getting swapped. I thought possibly an EVEN/ODD state machine bug, or maybe uninitialized memory from usb_malloc() or use-after-free?

Modify usb_mem.c to fill packet buffers using memset(buf, ch, 64);
ch = 'M' an uninitialized packet fresh from usb_malloc()
ch = 'F' a buffer on the free list, done in usb_free()
ch = 'R' a buffer forwarded from usb_free() to usb_rx_memory()

Run driver, examine data.out
> // endpoint descriptor, URRRRRRRRRRRRRR[..]RRRRRRRRRRRRcriptorType

haunted-usb-diff-0005.jpg

Ah ha! usb_rx_memory() is implicated.


Weirdness in usb_rx_memory()

usb_rx_memory() in usb_dev.c:783

More debugging. Before we give the packet to the endpoint, set:
packet->buf[0] = 'E'; or
packet->buf[0] = 'O';
so we know which branch it passed through.

Code:
// Called from usb_free, but only when usb_rx_memory_needed > 0, indicating
// receive endpoints are starving for memory.  The intention is to give
// endpoints needing receive memory priority over the user's code, which is
// likely calling usb_malloc to obtain memory for transmitting.  When the
// user is creating data very quickly, their consumption could starve reception
// without this prioritization.  The packet buffer (input) is assigned to the
// first endpoint needing memory.
//
void usb_rx_memory(usb_packet_t *packet)
{
	unsigned int i;
	const uint8_t *cfg;

	cfg = usb_endpoint_config_table;
	//serial_print("rx_mem:");
	__disable_irq();
	for (i=1; i <= NUM_ENDPOINTS; i++) {
#ifdef AUDIO_INTERFACE
		if (i == AUDIO_RX_ENDPOINT) continue;
#endif
		if (*cfg++ & USB_ENDPT_EPRXEN) {
			if (table[index(i, RX, EVEN)].desc == 0) {
				[COLOR="#FF0000"]packet->buf[0] = 'E';[/COLOR]
				table[index(i, RX, EVEN)].addr = packet->buf;
				table[index(i, RX, EVEN)].desc = BDT_DESC(64, 0);
				usb_rx_memory_needed--;
				__enable_irq();
				//serial_phex(i);
				//serial_print(",even\n");
				return;
			}
			if (table[index(i, RX, ODD)].desc == 0) {
				[COLOR="#FF0000"]packet->buf[0] = 'O';[/COLOR]
				table[index(i, RX, ODD)].addr = packet->buf;
				table[index(i, RX, ODD)].desc = BDT_DESC(64, 1);
				usb_rx_memory_needed--;
				__enable_irq();
				//serial_phex(i);
				//serial_print(",odd\n");
				return;
			}
		}
	}
	__enable_irq();
	// we should never reach this point.  If we get here, it means
	// usb_rx_memory_needed was set greater than zero, but no memory
	// was actually needed.
	usb_rx_memory_needed = 0;
	usb_free(packet);
	return;
}

...and that change fixed the corruption ??? !!!


The Fix: how does this even work?

Writing 'E' or 'O' to the empty buffer fixes the bug 100% of the time, at all clock speeds, optimization levels, etc. You need the write in both if bodies. The memsets in usb_mem.c are unnecessary.


Kinetis USB experts: What the hell, man?


I hope someone can explain what is going on here. I'm especially interested to know if similar behavior could occur in other parts of the usb serial code, because this change alone was not enough to get my larger, more complex usb serial project working.



Contents of haunted-usb.zip (has everything you need)
sketch.cpp
driver.c
usb_mem.c
usb_dev.c
data.in/
  • data.all - all blocks cat'd together
  • data.0000
  • data.0001
  • ...
  • data.1023


sketch.cpp
Code:
#include <Arduino.h>

#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>

#include <FastCRC.h>

#define PIN_LED 13

// Enable %f in printf.
asm(".global _printf_float");

#define SCB_AIRCR (*(volatile uint32_t *)0xE000ED0C) // Application Interrupt and Reset Control location

void reboot_now()
{
  Serial.end();  //clears the serial monitor  if used
  SCB_AIRCR = 0x05FA0004;  //write value for restart
}

void serial_printf(const char* fmt, ...) {
    va_list ap;
    static char buf[1024];
    if (!Serial) return;
    va_start(ap, fmt);
    vsnprintf(buf, sizeof(buf), fmt, ap);
    va_end(ap);
    Serial.print(buf);
}

// Same as linux/mac cksum command.
uint32_t cksum(const uint8_t* buf, uint32_t len) {
    FastCRC32 crc; // thanks Frank B!
    crc.cksum(buf, len);

    // add length to hash
    uint8_t buf2[4];
    uint32_t buf2_len = 0;
    while (len) {
        buf2[buf2_len++] = len;
        len >>= 8;
    }
    return crc.cksum_upd(buf2, buf2_len);
}

int discard_input() {
    int n = 0;
    while (Serial.available()) {
        Serial.read();
        n++;
    }
    return n;
}

// precomputed hashes of every 1k block of data.in
extern const uint32_t hashes[1024];

// timestamp of last received byte, used for timeout
uint32_t last_rx;

// the current block we're receiving
uint8_t block_buf[1024];
uint32_t block_buf_len = 0;

// block number for looking up hash
int block_n = 0;

// once we detect a bad block, remember it here
uint32_t bad_block_hash;
int bad_block = -1;
int did_print = 0;

void setup() {
    // enable LED
    digitalWrite(PIN_LED, LOW);
    pinMode(PIN_LED, OUTPUT);

    // enable cycle counter
    ARM_DEMCR |= ARM_DEMCR_TRCENA;
    ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA;

    // wait for connection
    Serial.begin(9600);
    while (!Serial);

    last_rx = ARM_DWT_CYCCNT;
}

void loop() {
    const int total_blocks = sizeof(hashes) / sizeof(hashes[0]);
    if (bad_block < 0 && block_n < total_blocks) {
        // input is good so far, keep hashing blocks
        while (Serial.available() && block_buf_len < sizeof(block_buf)) {
            char ch = Serial.read();
            block_buf[block_buf_len++] = ch;
            last_rx = ARM_DWT_CYCCNT;


#if 1       // Slowdown
            // Required to expose bug at higher clockspeeds / optimization.
            // Starve the usb rx buffers to apply backpressure to the host.
            static uint32_t slowdown = 0;
            if (++slowdown == 10) {
                delayMicroseconds(5);
                slowdown = 0;
            }
#endif
        }

        if (block_buf_len == sizeof(block_buf)) {
            // finished reading 1024 byte block, now check hash
            uint32_t h = cksum(block_buf, block_buf_len);
            uint32_t expect = hashes[block_n];
            if (h != expect) {
                // block has been corrupted!
                digitalWriteFast(PIN_LED, HIGH);
                bad_block = block_n;
                bad_block_hash = h;
            }
            else {
                // block is ok, get ready for next block
                block_buf_len = 0;
                block_n++;
            }
        }
    }
    else {
        // We already found 1 bad block, or we read all the blocks we have
        // hashes for. Discard rest of input.
        if (discard_input() > 0) {
            last_rx = ARM_DWT_CYCCNT;
        }
    }

    // Wait 250ms after receiving last character.
    if (!did_print && ARM_DWT_CYCCNT - last_rx > F_CPU/4) {
        if (bad_block < 0) {
            serial_printf("success\n");
        }
        else {
            serial_printf("bad block %04i, hash=%u, expected=%u\n",
                bad_block, bad_block_hash, hashes[bad_block]);
            Serial.write(block_buf, sizeof(block_buf));
        }
        did_print = 1;
    }

    // When host program exits, restart teensy.
    if (!Serial) {
        reboot_now();
   }
}

// Checksums of each 1024 byte block.
//
// $ cksum data.in/data.0000 data.in/data.0001
// 4228457909 1024 data.in/data.0000
// 1756643378 1024 data.in/data.0001
const uint32_t hashes[1024] = {
	4228457909,
	1756643378,
	1390827839,
	2423965792,
	3390210587,
	819127511,
	2310046989,
	386830310,
	3652457661,
	987039731,
	2548782095,
	2987884763,
	1004123995,
	1058494358,
	668239705,
	3416804312,
	2041977815,
	4207152148,
	818227541,
	163579598,
	3073125877,
	3674374627,
	3999065213,
	714336666,
	864300185,
	906008376,
	307008169,
	1903170675,
	4132093258,
	1653988441,
	181337998,
	202195943,
	3427156145,
	368111983,
	2351377580,
	1308352079,
	1439376271,
	3217826155,
	2099482396,
	3049572432,
	3294376581,
	3569505994,
	2299310252,
	2650502404,
	2062629456,
	3279958704,
	268896769,
	1984675841,
	2355746807,
	251681255,
	2350789702,
	3752250568,
	219351725,
	620031159,
	4125324168,
	3109165981,
	1915742819,
	3189872568,
	2216643619,
	2726555708,
	1856515034,
	4037622595,
	1620346867,
	2608530759,
	1277827894,
	2598211528,
	2842307299,
	1158928656,
	2231975796,
	3328892756,
	4094583104,
	409973335,
	3869639691,
	270410755,
	4173822740,
	1092149366,
	684260591,
	1635409117,
	1170171106,
	1266962644,
	403737307,
	3234847936,
	2675343944,
	566904840,
	690822646,
	1593692758,
	735247398,
	2402308738,
	2581553842,
	1910412035,
	1208479315,
	600176231,
	2201994854,
	912727099,
	2302160704,
	3468867073,
	2245733362,
	53100879,
	3701912105,
	1627385418,
	319746318,
	1913497855,
	748975578,
	2478661640,
	3717276380,
	1349240238,
	2588641539,
	3892255661,
	1681462016,
	1733437855,
	4184048993,
	3795962870,
	4258801974,
	2907249718,
	2871794919,
	3079251805,
	4192490343,
	4091299786,
	1695264126,
	504838142,
	4016645931,
	3952163723,
	3616539693,
	315429236,
	145504950,
	3236273733,
	93948482,
	4262811900,
	1567270237,
	599432975,
	3664031792,
	203075792,
	687923672,
	2787304704,
	574133491,
	2316008897,
	3188332485,
	581015821,
	2439859455,
	2834389843,
	62169563,
	2149379195,
	3629188085,
	3357350926,
	1900374679,
	2260202036,
	4167297033,
	983809120,
	1654661994,
	1726495612,
	2652221839,
	998128034,
	692745280,
	1624742499,
	575200295,
	2691572258,
	1324408938,
	2529151751,
	3566600743,
	3759550045,
	1314425539,
	1627980226,
	2518259122,
	1182735720,
	1521728637,
	461643767,
	877987243,
	108081537,
	552405374,
	3059659157,
	1346220304,
	3089130055,
	3140594371,
	459672485,
	986223909,
	4019916964,
	2808366536,
	4077295779,
	745327720,
	3400263726,
	4163121490,
	1948953946,
	185300733,
	1596048090,
	150362168,
	1392771251,
	212114285,
	2887261551,
	1795619219,
	2152954366,
	1144088574,
	3063788939,
	2036249126,
	3843925671,
	2084035227,
	4026541489,
	487809556,
	2346917752,
	2457799402,
	2057472648,
	1017823506,
	2612519871,
	2314484872,
	2109314817,
	1217634752,
	1919382256,
	2898342974,
	3788850556,
	4205699320,
	530615463,
	3790041155,
	1539240416,
	3837702307,
	2490858337,
	3234617832,
	1433294999,
	1184279191,
	2560831498,
	4137283872,
	1584463547,
	362095747,
	3765944996,
	2716312889,
	2706301828,
	1680334248,
	4053613019,
	3747398777,
	3254549220,
	488550417,
	782198462,
	3803862661,
	4141447081,
	1681572757,
	1160350737,
	3474199297,
	14281397,
	3792655904,
	3576591402,
	3438669867,
	4184246550,
	2791752941,
	3995310130,
	567228884,
	1825913475,
	2778748631,
	1387256045,
	1658851854,
	4092403033,
	22299972,
	2247422987,
	817376339,
	1786550895,
	3682532477,
	2979719780,
	3969081839,
	3417254538,
	3076555530,
	392240533,
	3000296006,
	2388761683,
	3337167294,
	3016230549,
	4176372266,
	2219392765,
	3845339116,
	1289664162,
	2098905627,
	2731933115,
	1274742276,
	2010679328,
	1237732175,
	3644796161,
	3757564542,
	1834659281,
	809999113,
	505515421,
	1898245875,
	1438091384,
	2027712496,
	13662573,
	699141999,
	1752722072,
	137410894,
	2118817467,
	2514803465,
	3714195288,
	3825616016,
	405676097,
	3723495148,
	4274725231,
	4051112385,
	2995735322,
	2977915443,
	2337175023,
	2457742691,
	3510173071,
	2369462207,
	4183458513,
	1908213379,
	3404581316,
	2792306434,
	3234989930,
	1604064510,
	594182718,
	1831226062,
	3978185905,
	3442942973,
	3139441302,
	2301978086,
	3248370654,
	3503734647,
	1191278100,
	3388824394,
	798812097,
	1735943781,
	3305015007,
	3842106820,
	1387160312,
	911327979,
	1638272308,
	4039102,
	216256582,
	558021307,
	610634028,
	3988649340,
	3499354157,
	1041616805,
	3191861971,
	4140659338,
	38829754,
	2300601372,
	4283937937,
	975129639,
	519989810,
	2380065917,
	1394357164,
	3705794712,
	99518253,
	3186569165,
	3338469537,
	1921051860,
	225086159,
	996210737,
	3502431520,
	3916530528,
	3284949844,
	1516474917,
	476638579,
	2252382272,
	2772742280,
	2610846583,
	4019373611,
	1080334508,
	781589714,
	2639299527,
	3426061970,
	3612442794,
	2203276915,
	1619722755,
	1761160097,
	4047344417,
	4209496951,
	2777327083,
	453572060,
	3708222832,
	425601650,
	1699657184,
	3158095196,
	4214455188,
	4254915366,
	2723575519,
	3106850957,
	3557899724,
	2375075598,
	3007132570,
	938941618,
	210899559,
	610937873,
	4271845890,
	365975988,
	539453223,
	142278793,
	674092505,
	1077493502,
	2324250293,
	2091268683,
	1853987413,
	3185755475,
	2751245798,
	3182665498,
	80962339,
	2369989329,
	2652994471,
	2231416430,
	1480570071,
	2192904042,
	1279374774,
	3647725975,
	2518488295,
	3658588678,
	2107726852,
	2002962395,
	3259043220,
	2029263516,
	2359701965,
	2964371983,
	1234696275,
	3205868353,
	1692899510,
	3894361519,
	2535644745,
	51539275,
	1318156843,
	3704876662,
	918288243,
	3103195605,
	1768290910,
	801858278,
	2107496250,
	3866438334,
	3403053924,
	3375755112,
	3841454297,
	791038047,
	2467240041,
	2451631466,
	1312174670,
	2616626609,
	1486693720,
	2206968738,
	2278244604,
	2808010612,
	3168147231,
	2586646722,
	3390933060,
	3492614060,
	641130206,
	1020955840,
	183270028,
	1820300065,
	3493718458,
	2889461959,
	2439829454,
	1485406265,
	1231136854,
	1306803660,
	4021067144,
	854428499,
	3822945221,
	2660611126,
	1100588512,
	929909407,
	1847342147,
	3537923951,
	2775737987,
	4241889591,
	53526193,
	2592184543,
	1288386233,
	850389287,
	399371489,
	833497661,
	552432283,
	2045791457,
	3322984641,
	1253031751,
	1648339538,
	3409548651,
	768731120,
	3082184998,
	3509170595,
	1778288959,
	3366303032,
	509546330,
	1606716597,
	3691820127,
	1649299278,
	21555563,
	3475196934,
	1293701658,
	2932218299,
	1162143343,
	22588651,
	2378978907,
	168856027,
	2527010465,
	3494772866,
	1179343321,
	2304756311,
	3470072239,
	472972227,
	2146896523,
	3830561359,
	1733400211,
	3440169064,
	2203370933,
	1162315460,
	1396900645,
	2618863675,
	540744707,
	2963203849,
	1002013412,
	851226491,
	264471460,
	4121109889,
	174417358,
	1553125135,
	3184573988,
	1034332621,
	583151622,
	2405736973,
	2240469143,
	1429440091,
	756098332,
	2036259300,
	3739596220,
	3961230038,
	569201915,
	2012597518,
	1003359704,
	3495387777,
	3375386366,
	3064409430,
	3107824733,
	59212460,
	4047217607,
	1300169818,
	1094978420,
	1068884882,
	1108585116,
	2804436769,
	197566978,
	3100739570,
	2079257405,
	3962061112,
	3576074192,
	788601916,
	4128899557,
	1076603238,
	242875979,
	2335782986,
	2017611665,
	4253169991,
	2065743221,
	552630866,
	2962851619,
	354986631,
	2165605118,
	2012032843,
	2889878242,
	2092890265,
	639338364,
	1347989204,
	942470730,
	2252829580,
	1679280633,
	3426926805,
	2460386877,
	2268837592,
	2939787632,
	4044478738,
	3743691795,
	3744446995,
	2933455444,
	2557686782,
	2253515640,
	3543288114,
	1463733644,
	2707846633,
	2255502178,
	806460925,
	1117612866,
	2747555290,
	2385356366,
	2852673631,
	784156444,
	1400988719,
	2227697536,
	2144080323,
	3713193879,
	1245510972,
	1307436318,
	1598550267,
	2058302879,
	1394077381,
	30602995,
	3144357521,
	3051790873,
	2762847484,
	1369525587,
	3502578773,
	2133852051,
	2618843137,
	2996807407,
	2857016292,
	482164482,
	934888861,
	545538528,
	2616352346,
	505241062,
	3763900197,
	2888722510,
	1264763076,
	1822329382,
	1257845551,
	1535649277,
	2089532395,
	2215424118,
	2295771800,
	543052005,
	1141685060,
	119138419,
	749337407,
	13485545,
	3874106929,
	2928428394,
	2544595324,
	1228498129,
	1197623568,
	1163938508,
	4260956477,
	3103969210,
	3731678889,
	592819979,
	2525340870,
	1682392315,
	883013012,
	1770592201,
	3523558385,
	3597948874,
	714171287,
	1247046859,
	3534161901,
	819669005,
	2612080378,
	2273018927,
	3463627335,
	2296444105,
	532263474,
	1822625065,
	3534652387,
	4290659295,
	494490863,
	2866134605,
	3793072803,
	3753946994,
	2459788002,
	3122139320,
	3885792534,
	509826136,
	483427050,
	3621836263,
	1841963022,
	3730194881,
	1230764812,
	54717181,
	3415843127,
	1111984570,
	1799932995,
	3294193988,
	2758729771,
	1279730562,
	2670542501,
	3076917323,
	2104303795,
	110997706,
	764560334,
	2859025702,
	550037746,
	2767121614,
	4009470551,
	1651207639,
	1157514380,
	935267206,
	2856750827,
	791504634,
	2787305692,
	1369497738,
	140669096,
	1167606214,
	447718239,
	3199820089,
	692933545,
	4006063109,
	3318495127,
	1974568827,
	2407546656,
	3156014333,
	753373809,
	1365768043,
	1152274450,
	2504822738,
	3063048204,
	1458625971,
	3875243945,
	2088409538,
	4278629151,
	2410743102,
	1602604338,
	4160672589,
	3496134650,
	2985507213,
	921713997,
	2250016173,
	2219237146,
	2259378922,
	1017714192,
	4263355383,
	4125383889,
	1332102076,
	977758853,
	11517204,
	4252283914,
	875599260,
	2611944926,
	3369895365,
	2145835305,
	4213884397,
	30376195,
	3998991217,
	2973438463,
	272696580,
	3403848954,
	3330273010,
	3550774645,
	697293896,
	458911542,
	2869908738,
	257978978,
	1610095969,
	2648072319,
	3420444038,
	4239107752,
	4046061194,
	3066050737,
	571741668,
	4090638442,
	1748018516,
	1730529058,
	115503973,
	3275262561,
	1082241110,
	997365964,
	1034532362,
	346659654,
	2344763600,
	2392040371,
	3696933128,
	488276171,
	3257693904,
	3788867234,
	405387546,
	3258297266,
	3614344809,
	2053739007,
	1135563987,
	80601375,
	2182172673,
	822192382,
	4097975004,
	1869701365,
	217647104,
	469743348,
	3590368804,
	980536618,
	50792880,
	674778571,
	2225018826,
	665571307,
	1587057614,
	2569231910,
	734555407,
	522818910,
	107174795,
	3875667478,
	1439704813,
	2374353360,
	3543171206,
	4193995686,
	3741405368,
	4171638274,
	4211530504,
	1716255036,
	1641991372,
	2079977378,
	1306797535,
	447815821,
	184278330,
	4226118535,
	2838563860,
	802348545,
	1614345970,
	2329598559,
	3909980848,
	1268621525,
	2910204840,
	1465685642,
	1561351736,
	1927231228,
	1548526690,
	1561223606,
	2433630100,
	674764382,
	290283463,
	3064867503,
	464875768,
	331506926,
	1743642855,
	2014210677,
	1923373952,
	1555936407,
	2387160762,
	252276859,
	2019717069,
	2882159161,
	2606121970,
	167021300,
	1670947197,
	624713933,
	812278327,
	1588855871,
	258173063,
	3126389784,
	3401108312,
	3677825498,
	898327590,
	3790121792,
	2267783899,
	2758400098,
	757228551,
	2759778248,
	4020813753,
	1983408194,
	2831266649,
	1734052469,
	811793678,
	2052628729,
	3491123026,
	2255200905,
	1727176909,
	4021556895,
	1924026098,
	3790846287,
	1565871025,
	3352945393,
	634090299,
	1927973038,
	2689764125,
	97795552,
	1363275155,
	3917753002,
	2861498920,
	2666182825,
	954443217,
	3623065706,
	2293231534,
	2802864606,
	678094452,
	3151743662,
	1553250607,
	1760085022,
	3114502212,
	3105637317,
	568278596,
	706068127,
	3006995427,
	3246670460,
	4134305585,
	3428237913,
	2381301418,
	2269013226,
	4115708403,
	3123335344,
	1720952799,
	2894760103,
	3648216607,
	783401454,
	141466472,
	3462339531,
	4020245973,
	2120596800,
	3485628784,
	1502924605,
	2325915897,
	3841260664,
	4215096758,
	2467110716,
	23966786,
	1677554518,
	3370487916,
	3498802623,
	124232462,
	936780707,
	3520529797,
	25531820,
	3555334839,
	897047873,
	3239975404,
	999420941,
	1569267646,
	82647075,
	2156564772,
	1213520264,
	471524678,
	2230196703,
	2546986008,
	3456694406,
	4271038195,
	2738224225,
	917532559,
	3478214647,
	2085024962,
	2668576920,
	1260040878,
	3249721556,
	2136556717,
	1083903407,
	2630801199,
	705789379,
	336268124,
	673164310,
	2614194481,
	3554853175,
	2812987894,
	764894752,
	1264208642,
	993726103,
	2174326119,
	2804413130,
	609781530,
	1454346894,
	1050324932,
	3524141160,
	621770131,
	3933908286,
	3587849499,
	3358489601,
	3681207795,
	3748704848,
	3299570571,
	1822895091,
	1579436793,
	3356730487,
	2060923311,
	1937632676,
	1370711317,
	2361771164,
	1105910994,
	3233032443,
	1102730797,
	683213159,
	4243832508,
	3792838247,
	2894441402,
	1588817832,
	420296804,
	4068210459,
	3285386607,
	3222423606,
	27870307,
	1264762071,
	1050979653,
	885792108,
	103739607,
	2858077429,
	2944899248,
	1627737897,
	1339106172,
	1160275329,
	1211859825,
	2754082985,
	990012903,
	1040656622,
	410708768,
	880528050,
	1815830020,
	4033895564,
	4286314265,
	29863736,
	90225554,
	3510311305,
	1217873367,
	3945490646,
	2866722547,
	1619844166,
	1236948233,
	1345316903,
	2449350112,
	3171207069,
	191718008,
	1456138340,
	3495979759,
	1930947001,
	3578448158,
	3397996154,
	2050137091,
	3358810265,
	3151063028,
	473639363,
	967838860,
	4067402421,
	3787458760,
	1589600924,
	967390492,
	95884283,
	609410709,
	4179210441,
	1785459396,
	61479931,
	1778744016,
	1992167485,
	3913397592,
	176615387,
	1399125722,
	1259649046,
	4239333143,
	2057858776,
	2124394241,
	1738068790,
	199501278,
	848616408,
	2178850397,
	2585695393,
	2138395007
};

driver.c
Code:
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <termios.h>

// Wall time in floating-point seconds, starting at 0.0
double now() {
    static struct timeval tv_0 = { 0 };
    if (tv_0.tv_sec == 0) {
        gettimeofday(&tv_0, 0);
        return 0.0;
    }

    struct timeval tv;
    gettimeofday(&tv, 0);
    double d = tv.tv_usec;
    d -= tv_0.tv_usec;
    d *= 1e-6;
    d += tv.tv_sec - tv_0.tv_sec;
    return d;
}

int main(int argc, const char* argv[]) {
    int error = 0;

    if (argc != 2) {
        fprintf(stderr, "Usage: ./driver /dev/tty.usbmodem123 <data.in/data.all >data.out\n");
        return 3;
    }

    // store the first little bit of the teensy reply, just enough
    // to detect "success"
    char reply[] = "success";
    int reply_n = 0;

    // use stdin and stdout for data
    int fd_in = 0;
    int fd_out = 1;

    const char* teensy_dev_path = argv[1];
    int fd_usb = open(teensy_dev_path, O_RDWR | O_NOCTTY | O_NONBLOCK);
    if (fd_usb == -1) {
        error = errno;
        fprintf(stderr, "Cannot open teensy device %s\n", teensy_dev_path);
        goto quit;
    }

    struct termios tios;
    memset(&tios, 0, sizeof(tios));
    tios.c_iflag = IGNBRK | IGNPAR;
    tios.c_oflag = 0;
    tios.c_cflag = CS8 | CREAD | CLOCAL;
    tios.c_lflag = 0;
    tios.c_cc[VTIME] = 0;
    tios.c_cc[VMIN] = 0;
    cfsetspeed(&tios, 9600);
    tcflush(fd_usb, TCIFLUSH);
    tcsetattr(fd_usb, TCSANOW, &tios);

    char buf[1024];
    while (1) {
        int n = read(fd_in, buf, sizeof(buf));
        if (n < 0) {
            error = errno;
            fprintf(stderr, "Error reading input.\n");
            goto quit;
        }
        if (n == 0) {
            // done reading input
            break;
        }

        // write data to teensy
        const char* p = buf;
        while (n > 0) {
            // this would be simpler if we didn't use O_NONBLOCK
            int r = write(fd_usb, p, n);
            if (r < 0) {
                if (errno == EAGAIN) continue;
                error = errno;
                fprintf(stderr, "Error writing to teensy.\n");
                goto quit;
            }
            p += r;
            n -= r;
        }
    }

    // done sending data, now read teensy reply

    // 500ms timeout to know teensy is done txing
    double last_rx = now();
    while (now() - last_rx < 0.5) {
        int n = read(fd_usb, buf, sizeof(buf));
        if (n < 0) {
            if (errno == EAGAIN) continue;
            error = errno;
            fprintf(stderr, "Error reading from teensy.\n");
            goto quit;
        }
        if (n > 0) {
            last_rx = now();
            int r = write(fd_out, buf, n);
            if (r < 0) {
                error = errno;
                fprintf(stderr, "Error writing output.\n");
                goto quit;
            }

            int reply_free = sizeof(reply) - reply_n;
            if (r > 0 && reply_free > 0) {
                if (r > reply_free) r = reply_free;
                memcpy(reply + reply_n, buf, r);
                reply_n += r;
            }
        }
    }

quit:
    if (error) {
        fprintf(stderr, "errno=%i %s\n", error, strerror(error));

        // force non-zero return
        reply[0] = 0;
    }

    close(fd_usb);

    if (reply_n == sizeof(reply)) reply_n--;
    reply[reply_n] = 0;

    return strcmp(reply, "success") != 0;
}
 

Attachments

  • haunted-usb.zip
    756.3 KB · Views: 79
I'm not sure it is what you're running into, but I ran into USB corruption with lots of data for WS2811 LEDs due to having a large array sitting across the SRAM_L and SRAM_U boundary at the 0x20000000 address. Check the memory placement in the symbol file to see if something is crossing over the 0x20000000 address. With the Arduino IDE, the memory placement can be verified in the <name>.ino.sym file located in C:\Users\<username>\AppData\Local\Temp\arduino_build_<rnd_number>.

Here's my prior post about what I ran into and how I worked around it: https://forum.pjrc.com/threads/5832...readBytes-hang?p=233075&viewfull=1#post233075
 
Thanks for the excellent tip, ShadowLight8!

For my test case, very little memory is used. The array of hashes is in flash. I don't think anything crosses that boundary.

Here's the symbol list, with flash mem filtered out:

Code:
619 ~/arduino-sketches/build$ cat cksum-teensydunino.ino.sym | grep -v ^0

/Users/ryan/arduino-sketches/build/cksum-teensydunino.ino.elf:     file format elf32-littlearm

SYMBOL TABLE:
1fff8000 l    d  .usbdescriptortable	00000000 .usbdescriptortable
1fff8200 l    d  .dmabuffers	00000000 .dmabuffers
1fff83bc l    d  .usbbuffers	00000000 .usbbuffers
1fff8720 l    d  .data	00000000 .data
1fff9180 l    d  .bss	00000000 .bss
1fff9180 l       .bss	00000000 completed.8603
1fff9184 l       .bss	00000000 object.8608
1fff959c l     O .bss	00000400 serial_printf(char const*, ...)::buf
1fff99b4 l     O .bss	00000004 ep0_tx_ptr
1fff99b8 l     O .bss	00000010 rx_last
1fff99c8 l     O .bss	00000002 ep0_tx_len
1fff99cc l     O .bss	00000040 ep0_rx0_buf
1fff9a0c l     O .bss	00000010 rx_first
1fff9a1c l     O .bss	00000001 ep0_tx_data_toggle
1fff9a20 l     O .bss	00000040 ep0_rx1_buf
1fff9a60 l     O .bss	00000010 tx_first
1fff8000 l     O .usbdescriptortable	000000a0 table
1fff9a70 l     O .bss	00000010 tx_last
1fff9a80 l     O .bss	00000008 setup
1fff9a88 l     O .bss	00000001 ep0_tx_bdt_bank
1fff9a8c l     O .bss	00000008 reply_buffer
1fff9a98 l     O .bss	00000004 tx_state
1fff8728 l     O .data	00000004 usb_buffer_available
1fff9a9d l     O .bss	00000001 tx_noautoflush
1fff9aa0 l     O .bss	00000004 tx_packet
1fff9aa4 l     O .bss	00000001 transmit_previous_timeout
1fff9aa8 l     O .bss	00000004 rx_packet
1fff9ac1 l     O .bss	00000001 yield::running
1fff9ac2 l     O .bss	00000001 calibrating
1fff872d l     O .data	00000001 analog_config_bits
1fff9ac3 l     O .bss	00000001 analog_reference_internal
1fff872e l     O .data	00000001 analog_num_average
1fff8730 l     O .data	00000012 device_descriptor
1fff875c l     O .data	00000043 config_descriptor
1fff87d8 l     O .data	00000428 impure_data
1fff9180 l       .bss	00000000 __bss_start__
1fff9b20 l       .bss	00000000 __bss_end__
1fff8744 g     O .data	00000018 usb_string_manufacturer_name_default
1fff8720 g     O .data	00000004 bad_block
1fff9ac0 g     O .bss	00000001 EventResponder::runningFromYield
1fff9ab0 g     O .bss	00000004 EventResponder::firstInterrupt
1fff9b1c g     O .bss	00000004 errno
1fff9180 g       .bss	00000000 _sbss
1fff9ab4 g     O .bss	00000004 EventResponder::lastInterrupt
1fff99b0 g     O .bss	00000004 systick_millis_count
1fff9a94 g     O .bss	00000001 usb_configuration
1fff8744  w    O .data	00000018 usb_string_manufacturer_name
1fff9b08 g     O .bss	00000008 usb_rx_byte_count_data
1fff9adc g     O .bss	00000004 __malloc_top_pad
1fff8720 g       .data	00000000 _sdata
1fff9b10 g     O .bss	00000008 usb_cdc_line_coding
1fff9ab8 g     O .bss	00000004 EventResponder::lastYield
1fff9ad8 g     O .bss	00000004 __malloc_max_sbrked_mem
1fff9abc g     O .bss	00000004 EventResponder::firstYield
1fff9b20 g       .bss	00000000 __bss_end
1fff8724 g     O .data	00000004 __brkval
1fff9aac g     O .bss	00000001 usb_cdc_line_rtsdtr
1fff9b20 g       .bss	00000000 _ebss
1fff9b18 g     O .bss	00000004 usb_cdc_line_rtsdtr_millis
1fff87bc g     O .data	00000016 usb_string_serial_number_default
1fff9010 g     O .data	00000004 __malloc_sbrk_base
1fff9a1d g     O .bss	00000001 usb_reboot_timer
1fff9ae0 g     O .bss	00000028 __malloc_current_mallinfo
1fff9ac4 g     O .bss	0000000c HardwareSerial::s_serials_with_serial_events
1fff9a89 g     O .bss	00000001 usb_rx_memory_needed
1fff83bc g     O .usbbuffers	00000360 usb_buffer_memory
1fff8c04 g     O .data	00000408 __malloc_av_
1fff8200 g     O .dmabuffers	000001bc _VectorsRam
1fff99a4 g     O .bss	00000004 block_buf_len
1fff872c g     O .data	00000001 yield_active_check_flags
1fff9ad4 g     O .bss	00000004 __malloc_max_total_mem
1fff9ad0 g     O .bss	00000001 HardwareSerial::s_count_serials_with_serial_events
608eb1ab g       *ABS*	00000000 __rtc_localtime
1fff87b8 g     O .data	00000004 string0
1fff87d2 g     O .data	00000001 _serialEvent_default
1fff99a8 g     O .bss	00000004 did_print
1fff87a0  w    O .data	00000016 usb_string_product_name
1fff999c g     O .bss	00000004 bad_block_hash
1fff8c00 g     O .data	00000004 _impure_ptr
20008000 g       .bss	00000000 _estack
1fff9180 g       .data	00000000 _edata
1fff900c g     O .data	00000004 __malloc_trim_threshold
1fff9a9c g     O .bss	00000001 usb_cdc_transmit_flush_timer
1fff99ac g     O .bss	00000004 block_n
1fff99a0 g     O .bss	00000004 last_rx
1fff87a0 g     O .data	00000016 usb_string_product_name_default
1fff919c g     O .bss	00000400 block_buf
1fff9014 g     O .data	0000016c __global_locale
1fff87bc  w    O .data	00000016 usb_string_serial_number


So I'm not sure I understand the issue in your thread. Was the libc memcpy() trying to be clever using DMA to do the copy? And did that end up getting fixed in libc, I hope?
 
Any chance you can try running the test on Linux or Windows?

When Teensy 4.0 transmits at max speed to MacOS, I've seen issues (and very high CPU usage) that don't happen on Linux and Windows. Would be nice to know if the problem happens on the other systems or is unique to Macintosh.
 
I gave it a quick try on my raspberry pi pi-hole server. Not the greatest environment, but it's what I have handy.

Linux raspberrypi 4.19.118-v7l+

I didn't install Arduino or Teensyduino, just the udev file.

On Linux, there seems to be a problem with the teensy not resetting when the tty is closed on the host, so you need to unplug/replug the teensy for each run. But it does show the same behavior with RRRRRRRRRRRR buffers passed to usb_rx_memory() not being filled with data before being passed back to the user program. Writing 'E'/'O' makes it work.


Re. the reset issue, is this the correct way to reset the teensy 3.2?

SCB_AIRCR = 0x05FA0004;

I'm hoping that just restarts my code, but maybe it is waiting for the teensy loader or something? (no loader on the raspberry)
 
Thanks for the excellent tip, ShadowLight8!

For my test case, very little memory is used. The array of hashes is in flash. I don't think anything crosses that boundary.

Here's the symbol list, with flash mem filtered out:

...

So I'm not sure I understand the issue in your thread. Was the libc memcpy() trying to be clever using DMA to do the copy? And did that end up getting fixed in libc, I hope?

I think you're right that it isn't the same issue since memory use is low and nothing seems to cross the boundary. In the case I had, the memcpy could be unaligned depending on the data coming from USB and would cause a hard fault in some cases, other times would lead to corruption that was visible as glitching in the LEDs.
 
Oh yeah, unaligned read across that boundary, I can see how that could trigger a fault.

You can probably tell the linker to park an unused int32 at 0x20000000 to prevent any objects from straddling the boundary.
 
Here's a quick test case for the memcpy 0x20000000 bug ShadowLight8 mentioned. Sure enough, memcpy fails.

Code:
#include <Arduino.h>

uint8_t big_buf[40 * 1024];

#define PIN_LED 13

// Enable %f in printf.
asm(".global _printf_float");

#define SCB_AIRCR (*(volatile uint32_t *)0xE000ED0C) // Application Interrupt and Reset Control location

void reboot_now()
{
  Serial.end();  //clears the serial monitor  if used
  SCB_AIRCR = 0x05FA0004;  //write value for restart
}

void serial_printf(const char* fmt, ...) {
    va_list ap;
    static char buf[1024];
    if (!Serial) return;
    va_start(ap, fmt);
    vsnprintf(buf, sizeof(buf), fmt, ap);
    va_end(ap);
    Serial.print(buf);
}

// Naive byte-by-byte copy.
void memcpy_trivial(void* dst_v, const void* src_v, size_t n) {
    uint8_t* dst = (uint8_t*) dst_v;
    uint8_t* src = (uint8_t*) src_v;
    while (n--) *dst++ = *src++;
}

#define BOUNDARY 0x20000000u

void setup() {
    // enable LED
    digitalWrite(PIN_LED, LOW);
    pinMode(PIN_LED, OUTPUT);

    // enable cycle counter
    ARM_DEMCR |= ARM_DEMCR_TRCENA;
    ARM_DWT_CTRL |= ARM_DWT_CTRL_CYCCNTENA;

    // wait for connection
    Serial.begin(9600);
    while (!Serial);

    // Prove big_buf straddles BOUNDARY
    uint32_t bb = (uint32_t) big_buf;
    serial_printf("big_buf = 0x%08x - 0x%08x\n", bb, bb + sizeof(big_buf) - 1);
    if (bb >= BOUNDARY || bb + sizeof(big_buf) <= BOUNDARY) {
        serial_printf("big_buf does not cross BOUNDARY 0x%08x\n", BOUNDARY);
        serial_printf("Not sure how this is possible on Teensy 3.2.\n");
        serial_printf("This test is for Teensy 3.2 memory map only.\n");
        return;
    }

    // Write a byte pattern across the boundary.
    uint8_t* p = (uint8_t*)BOUNDARY;
    p[-4] = 0xfc;
    p[-3] = 0xfd;
    p[-2] = 0xfe;
    p[-1] = 0xff;
    p[ 0] = 1;
    p[ 1] = 2;
    p[ 2] = 3;
    p[ 3] = 4;

    // initializers so we can detect unwritten bytes, if any
    struct {
        uint32_t below;
        uint32_t above;
    } st = { 0x55555555, 0x66666666 };
    uint32_t across = 077777777;
    uint32_t trivial_across = 0x88888888;

    // all below BOUNDARY, works fine
    memcpy(&st.below, p - 4, 4);
    serial_printf("below   0x%08x\n", st.below);

    // straddles BOUNDARY, upper half is not copied
    memcpy(&across, p - 2, 4);
    serial_printf("across  0x%08x\n", across);

    // all above BOUNDARY, works fine
    memcpy(&st.above, p, 4);
    serial_printf("above   0x%08x\n", st.above);

    // strict byte-by-byte copy across BOUNDARY, also fine
    memcpy_trivial(&trivial_across, p - 2, 4);
    serial_printf("trivial 0x%08x\n", trivial_across);

    // aligned memcpy across, works fine
    memcpy(&st, p - 4, 8);
    serial_printf("aligned 0x%08x 0x%08x\n", st.below, st.above);

    const char* result = (across == trivial_across) ? "success" : "fail";
    serial_printf("%s\n", result);
}

void loop() {
    // reboot teensy when serial monitor disconnects
    if (!Serial) reboot_now();
}

Output on teensy 3.2:
Code:
big_buf = 0x1fff9594 - 0x20003593
below   0xfffefdfc
across  0x[COLOR="#FF0000"]8000[/COLOR]fffe
above   0x04030201
trivial 0x0201fffe
aligned 0xfffefdfc 0x04030201
fail

Verdict:
Unaligned word reads across the 0x20000000 boundary silently corrupt results.

I think the fix is a dummy object at 0x20000000 to prevent user objects from straddling the boundary. I'm not very familiar with linker scripts, but I assume this isn't hard.

Paul, should I file a bug somewhere to track this? Not sure how that's managed.

I've also bought a dedicated linux dev machine so I can do proper testing and rule out mac os weirdness. (I've wanted one anyway for other reasons.) Should arrive tomorrow.

In the meantime, I've worked around the USB Serial corruption with checksums and retransmission. It's gross as hell, but it unblocks this board bringup. But I think we should debug this USB Serial corruption further, because I doubt I'm the only one who's tripped over it.
 
Last edited:
I remember Paul merged my patch for memcpy that switched it to aligned mode only, I guess another patch must have switched it off again..
 
OK, I am back with a fresh Linux dev environment to exclude the possibility of Mac USB weirdness. Here's the current setup:

Raspberry Pi 4 B booting off a SATA SSD via USB 3 adapter
Raspberry Pi Imager v1.6.1
Raspberry Pi OS 32-bit installed, see end of post for raspinfo output.
Arduino 1.8.13 arduino-1.8.13-linuxarm.tar.xz
Teensyduino 1.53 TeensyduinoInstall.linuxarm

That should be current versions of everything, as of today.


I solved my previous bug re. connect/disconnect on Linux. I forgot to turn on HUPCL in termios, so Linux wasn't closing the USB serial device when the process exited. Fixed in driver.c.
Code:
struct termios tios;
memset(&tios, 0, sizeof(tios));
tios.c_iflag = IGNBRK | IGNPAR;
tios.c_oflag = 0;
tios.c_cflag = CS8 | CREAD | CLOCAL [COLOR="#FF0000"]| HUPCL[/COLOR];
tios.c_lflag = 0;
tios.c_cc[VTIME] = 0;
tios.c_cc[VMIN] = 0;
cfsetspeed(&tios, 9600);
tcflush(fd_usb, TCIFLUSH);
tcsetattr(fd_usb, TCSANOW, &tios);

In the sketch I changed my timing routine to use micros() instead of ARM_DWT_CYCCNT, for broader device compatibility. This required moving the timing function out of the inner loop, since micros() is slower than ARM_DWT_CYCCNT. It needs to be very fast to keep up with USB so we can prove the bug only happens when the rx queue runs out of buffers. See slowdown code in sketch, line 96.

I am testing with brand new Teensy LC, 3.2, and 4.0 boards, to show that this specifically happens with 3.2, and that it's not a weird hardware issue with one specific 3.2 board.

Teensy LC and 4.0 both worked fine with an unmodified library and default Arduino compiler settings: Optimize=Faster, and CPU Speed= 48MHz or 600 MHz clocks, respectively. I believe the USB hardware and code are totally different for these two boards, so it is not too surprising they did not show a problem.

Teensy 3.2 works fine if you turn off the slowdown code (sketch line 96), and compile with Optimize=Faster, CPU Speed=96 MHz. With these settings, Teensy 3.2 can process input faster than USB, so USB rx buffer exhaustion never happens and the bug does not occur.

Turn the slowdown code back on, and Teensy 3.2 will fail every run with USB corruption, though not on the very first block. It usually takes dozens to hundred of blocks to see corruption (one run of driver.c sends 1024 blocks).

Now add the packet->buf[0] writes in usb_rx_memory(), and the bug disappears, same as before.

usb_dev.c
Code:
// Called from usb_free, but only when usb_rx_memory_needed > 0, indicating
// receive endpoints are starving for memory.  The intention is to give
// endpoints needing receive memory priority over the user's code, which is
// likely calling usb_malloc to obtain memory for transmitting.  When the
// user is creating data very quickly, their consumption could starve reception
// without this prioritization.  The packet buffer (input) is assigned to the
// first endpoint needing memory.
//
void usb_rx_memory(usb_packet_t *packet)
{
	unsigned int i;
	const uint8_t *cfg;

	cfg = usb_endpoint_config_table;
	//serial_print("rx_mem:");
	__disable_irq();
	for (i=1; i <= NUM_ENDPOINTS; i++) {
#ifdef AUDIO_INTERFACE
		if (i == AUDIO_RX_ENDPOINT) continue;
#endif
		if (*cfg++ & USB_ENDPT_EPRXEN) {
			if (table[index(i, RX, EVEN)].desc == 0) {
				[COLOR="#FF0000"]packet->buf[0] = 'E';[/COLOR]
				table[index(i, RX, EVEN)].addr = packet->buf;
				table[index(i, RX, EVEN)].desc = BDT_DESC(64, 0);
				usb_rx_memory_needed--;
				__enable_irq();
				//serial_phex(i);
				//serial_print(",even\n");
				return;
			}
			if (table[index(i, RX, ODD)].desc == 0) {
				[COLOR="#FF0000"]packet->buf[0] = 'O';[/COLOR]
				table[index(i, RX, ODD)].addr = packet->buf;
				table[index(i, RX, ODD)].desc = BDT_DESC(64, 1);
				usb_rx_memory_needed--;
				__enable_irq();
				//serial_phex(i);
				//serial_print(",odd\n");
				return;
			}
		}
	}
	__enable_irq();
	// we should never reach this point.  If we get here, it means
	// usb_rx_memory_needed was set greater than zero, but no memory
	// was actually needed.
	usb_rx_memory_needed = 0;
	usb_free(packet);
	return;
}




sketch.ino
Code:
#include <Arduino.h>

#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>

#include <FastCRC.h>

#define PIN_LED 13

// Enable %f in printf.
asm(".global _printf_float");

#define SCB_AIRCR (*(volatile uint32_t *)0xE000ED0C) // Application Interrupt and Reset Control location

void reboot_now()
{
  Serial.end();  //clears the serial monitor  if used
  SCB_AIRCR = 0x05FA0004;  //write value for restart
}

void serial_printf(const char* fmt, ...) {
    va_list ap;
    static char buf[1024];
    if (!Serial) return;
    va_start(ap, fmt);
    vsnprintf(buf, sizeof(buf), fmt, ap);
    va_end(ap);
    Serial.print(buf);
}

// Same as linux/mac cksum command.
uint32_t cksum(const uint8_t* buf, uint32_t len) {
    FastCRC32 crc; // thanks Frank B!
    crc.cksum(buf, len);

    // add length to hash
    uint8_t buf2[4];
    uint32_t buf2_len = 0;
    while (len) {
        buf2[buf2_len++] = len;
        len >>= 8;
    }
    return crc.cksum_upd(buf2, buf2_len);
}

int discard_input() {
    int n = 0;
    while (Serial.available()) {
        Serial.read();
        n++;
    }
    return n;
}

// precomputed hashes of every 1k block of data.in
extern const uint32_t hashes[1024];

// timestamp of last received byte, used for timeout
uint32_t last_rx;

// the current block we're receiving
uint8_t block_buf[1024];
uint32_t block_buf_len = 0;

// block number for looking up hash
int block_n = 0;

// once we detect a bad block, remember it here
uint32_t bad_block_hash;
int bad_block = -1;
int did_print = 0;

void setup() {
    // enable LED
    digitalWrite(PIN_LED, LOW);
    pinMode(PIN_LED, OUTPUT);

    // wait for connection
    Serial.begin(9600);
    while (!Serial);

    last_rx = micros();
}

void loop() {
    const int total_blocks = sizeof(hashes) / sizeof(hashes[0]);
    bool rx_flag = false;
    if (bad_block < 0 && block_n < total_blocks) {
        // input is good so far, keep hashing blocks
        while (Serial.available() && block_buf_len < sizeof(block_buf)) {
            char ch = Serial.read();
            block_buf[block_buf_len++] = ch;
            rx_flag = true;

#if 1       // Slowdown
            // Required to expose bug at higher clockspeeds / optimization.
            // Starve the usb rx buffers to apply backpressure to the host.
            //
            // To prevent USB rx exhaustion and thereby hide the bug, turn
            // off the #if and compile with Optimze=Faster, CPU_Speed=96MHz.
            static uint32_t slowdown = 0;
            if (++slowdown == 10) {
                delayMicroseconds(5);
                slowdown = 0;
            }
#endif
        }

        if (block_buf_len == sizeof(block_buf)) {
            // finished reading 1024 byte block, now check hash
            uint32_t h = cksum(block_buf, block_buf_len);
            uint32_t expect = hashes[block_n];
            if (h != expect) {
                // block has been corrupted!
                digitalWriteFast(PIN_LED, HIGH);
                bad_block = block_n;
                bad_block_hash = h;
            }
            else {
                // block is ok, get ready for next block
                block_buf_len = 0;
                block_n++;
            }
        }
    }
    else {
        // We already found 1 bad block, or we read all the blocks we have
        // hashes for. Discard rest of input.
        if (discard_input() > 0) {
            rx_flag = true;
        }
    }
    if (rx_flag) {
        // Move call to micros() out of the main loop because it slows us down.
        // We need to process data faster than USB if we want to supress
        // the bug when we turn off the slowdown code.
        last_rx = micros();
    }

    // Wait 250ms after receiving last character.
    if (!did_print && micros() - last_rx > 250000) {
        if (bad_block < 0) {
            serial_printf("success\n");
        }
        else {
            serial_printf("bad block %04i, hash=%u, expected=%u, %08x\n",
                bad_block, bad_block_hash, hashes[bad_block], (unsigned)block_buf);
            Serial.write(block_buf, sizeof(block_buf));
        }
        did_print = 1;
    }

    // When host program exits, restart teensy.
    if (!Serial) {
        reboot_now();
   }
}

// Checksums of each 1024 byte block.
//
// $ cksum data.in/data.0000 data.in/data.0001
// 4228457909 1024 data.in/data.0000
// 1756643378 1024 data.in/data.0001
const uint32_t hashes[1024] = {
	4228457909,
	1756643378,
	1390827839,
	2423965792,
	3390210587,
	819127511,
	2310046989,
	386830310,
	3652457661,
	987039731,
	2548782095,
	2987884763,
	1004123995,
	1058494358,
	668239705,
	3416804312,
	2041977815,
	4207152148,
	818227541,
	163579598,
	3073125877,
	3674374627,
	3999065213,
	714336666,
	864300185,
	906008376,
	307008169,
	1903170675,
	4132093258,
	1653988441,
	181337998,
	202195943,
	3427156145,
	368111983,
	2351377580,
	1308352079,
	1439376271,
	3217826155,
	2099482396,
	3049572432,
	3294376581,
	3569505994,
	2299310252,
	2650502404,
	2062629456,
	3279958704,
	268896769,
	1984675841,
	2355746807,
	251681255,
	2350789702,
	3752250568,
	219351725,
	620031159,
	4125324168,
	3109165981,
	1915742819,
	3189872568,
	2216643619,
	2726555708,
	1856515034,
	4037622595,
	1620346867,
	2608530759,
	1277827894,
	2598211528,
	2842307299,
	1158928656,
	2231975796,
	3328892756,
	4094583104,
	409973335,
	3869639691,
	270410755,
	4173822740,
	1092149366,
	684260591,
	1635409117,
	1170171106,
	1266962644,
	403737307,
	3234847936,
	2675343944,
	566904840,
	690822646,
	1593692758,
	735247398,
	2402308738,
	2581553842,
	1910412035,
	1208479315,
	600176231,
	2201994854,
	912727099,
	2302160704,
	3468867073,
	2245733362,
	53100879,
	3701912105,
	1627385418,
	319746318,
	1913497855,
	748975578,
	2478661640,
	3717276380,
	1349240238,
	2588641539,
	3892255661,
	1681462016,
	1733437855,
	4184048993,
	3795962870,
	4258801974,
	2907249718,
	2871794919,
	3079251805,
	4192490343,
	4091299786,
	1695264126,
	504838142,
	4016645931,
	3952163723,
	3616539693,
	315429236,
	145504950,
	3236273733,
	93948482,
	4262811900,
	1567270237,
	599432975,
	3664031792,
	203075792,
	687923672,
	2787304704,
	574133491,
	2316008897,
	3188332485,
	581015821,
	2439859455,
	2834389843,
	62169563,
	2149379195,
	3629188085,
	3357350926,
	1900374679,
	2260202036,
	4167297033,
	983809120,
	1654661994,
	1726495612,
	2652221839,
	998128034,
	692745280,
	1624742499,
	575200295,
	2691572258,
	1324408938,
	2529151751,
	3566600743,
	3759550045,
	1314425539,
	1627980226,
	2518259122,
	1182735720,
	1521728637,
	461643767,
	877987243,
	108081537,
	552405374,
	3059659157,
	1346220304,
	3089130055,
	3140594371,
	459672485,
	986223909,
	4019916964,
	2808366536,
	4077295779,
	745327720,
	3400263726,
	4163121490,
	1948953946,
	185300733,
	1596048090,
	150362168,
	1392771251,
	212114285,
	2887261551,
	1795619219,
	2152954366,
	1144088574,
	3063788939,
	2036249126,
	3843925671,
	2084035227,
	4026541489,
	487809556,
	2346917752,
	2457799402,
	2057472648,
	1017823506,
	2612519871,
	2314484872,
	2109314817,
	1217634752,
	1919382256,
	2898342974,
	3788850556,
	4205699320,
	530615463,
	3790041155,
	1539240416,
	3837702307,
	2490858337,
	3234617832,
	1433294999,
	1184279191,
	2560831498,
	4137283872,
	1584463547,
	362095747,
	3765944996,
	2716312889,
	2706301828,
	1680334248,
	4053613019,
	3747398777,
	3254549220,
	488550417,
	782198462,
	3803862661,
	4141447081,
	1681572757,
	1160350737,
	3474199297,
	14281397,
	3792655904,
	3576591402,
	3438669867,
	4184246550,
	2791752941,
	3995310130,
	567228884,
	1825913475,
	2778748631,
	1387256045,
	1658851854,
	4092403033,
	22299972,
	2247422987,
	817376339,
	1786550895,
	3682532477,
	2979719780,
	3969081839,
	3417254538,
	3076555530,
	392240533,
	3000296006,
	2388761683,
	3337167294,
	3016230549,
	4176372266,
	2219392765,
	3845339116,
	1289664162,
	2098905627,
	2731933115,
	1274742276,
	2010679328,
	1237732175,
	3644796161,
	3757564542,
	1834659281,
	809999113,
	505515421,
	1898245875,
	1438091384,
	2027712496,
	13662573,
	699141999,
	1752722072,
	137410894,
	2118817467,
	2514803465,
	3714195288,
	3825616016,
	405676097,
	3723495148,
	4274725231,
	4051112385,
	2995735322,
	2977915443,
	2337175023,
	2457742691,
	3510173071,
	2369462207,
	4183458513,
	1908213379,
	3404581316,
	2792306434,
	3234989930,
	1604064510,
	594182718,
	1831226062,
	3978185905,
	3442942973,
	3139441302,
	2301978086,
	3248370654,
	3503734647,
	1191278100,
	3388824394,
	798812097,
	1735943781,
	3305015007,
	3842106820,
	1387160312,
	911327979,
	1638272308,
	4039102,
	216256582,
	558021307,
	610634028,
	3988649340,
	3499354157,
	1041616805,
	3191861971,
	4140659338,
	38829754,
	2300601372,
	4283937937,
	975129639,
	519989810,
	2380065917,
	1394357164,
	3705794712,
	99518253,
	3186569165,
	3338469537,
	1921051860,
	225086159,
	996210737,
	3502431520,
	3916530528,
	3284949844,
	1516474917,
	476638579,
	2252382272,
	2772742280,
	2610846583,
	4019373611,
	1080334508,
	781589714,
	2639299527,
	3426061970,
	3612442794,
	2203276915,
	1619722755,
	1761160097,
	4047344417,
	4209496951,
	2777327083,
	453572060,
	3708222832,
	425601650,
	1699657184,
	3158095196,
	4214455188,
	4254915366,
	2723575519,
	3106850957,
	3557899724,
	2375075598,
	3007132570,
	938941618,
	210899559,
	610937873,
	4271845890,
	365975988,
	539453223,
	142278793,
	674092505,
	1077493502,
	2324250293,
	2091268683,
	1853987413,
	3185755475,
	2751245798,
	3182665498,
	80962339,
	2369989329,
	2652994471,
	2231416430,
	1480570071,
	2192904042,
	1279374774,
	3647725975,
	2518488295,
	3658588678,
	2107726852,
	2002962395,
	3259043220,
	2029263516,
	2359701965,
	2964371983,
	1234696275,
	3205868353,
	1692899510,
	3894361519,
	2535644745,
	51539275,
	1318156843,
	3704876662,
	918288243,
	3103195605,
	1768290910,
	801858278,
	2107496250,
	3866438334,
	3403053924,
	3375755112,
	3841454297,
	791038047,
	2467240041,
	2451631466,
	1312174670,
	2616626609,
	1486693720,
	2206968738,
	2278244604,
	2808010612,
	3168147231,
	2586646722,
	3390933060,
	3492614060,
	641130206,
	1020955840,
	183270028,
	1820300065,
	3493718458,
	2889461959,
	2439829454,
	1485406265,
	1231136854,
	1306803660,
	4021067144,
	854428499,
	3822945221,
	2660611126,
	1100588512,
	929909407,
	1847342147,
	3537923951,
	2775737987,
	4241889591,
	53526193,
	2592184543,
	1288386233,
	850389287,
	399371489,
	833497661,
	552432283,
	2045791457,
	3322984641,
	1253031751,
	1648339538,
	3409548651,
	768731120,
	3082184998,
	3509170595,
	1778288959,
	3366303032,
	509546330,
	1606716597,
	3691820127,
	1649299278,
	21555563,
	3475196934,
	1293701658,
	2932218299,
	1162143343,
	22588651,
	2378978907,
	168856027,
	2527010465,
	3494772866,
	1179343321,
	2304756311,
	3470072239,
	472972227,
	2146896523,
	3830561359,
	1733400211,
	3440169064,
	2203370933,
	1162315460,
	1396900645,
	2618863675,
	540744707,
	2963203849,
	1002013412,
	851226491,
	264471460,
	4121109889,
	174417358,
	1553125135,
	3184573988,
	1034332621,
	583151622,
	2405736973,
	2240469143,
	1429440091,
	756098332,
	2036259300,
	3739596220,
	3961230038,
	569201915,
	2012597518,
	1003359704,
	3495387777,
	3375386366,
	3064409430,
	3107824733,
	59212460,
	4047217607,
	1300169818,
	1094978420,
	1068884882,
	1108585116,
	2804436769,
	197566978,
	3100739570,
	2079257405,
	3962061112,
	3576074192,
	788601916,
	4128899557,
	1076603238,
	242875979,
	2335782986,
	2017611665,
	4253169991,
	2065743221,
	552630866,
	2962851619,
	354986631,
	2165605118,
	2012032843,
	2889878242,
	2092890265,
	639338364,
	1347989204,
	942470730,
	2252829580,
	1679280633,
	3426926805,
	2460386877,
	2268837592,
	2939787632,
	4044478738,
	3743691795,
	3744446995,
	2933455444,
	2557686782,
	2253515640,
	3543288114,
	1463733644,
	2707846633,
	2255502178,
	806460925,
	1117612866,
	2747555290,
	2385356366,
	2852673631,
	784156444,
	1400988719,
	2227697536,
	2144080323,
	3713193879,
	1245510972,
	1307436318,
	1598550267,
	2058302879,
	1394077381,
	30602995,
	3144357521,
	3051790873,
	2762847484,
	1369525587,
	3502578773,
	2133852051,
	2618843137,
	2996807407,
	2857016292,
	482164482,
	934888861,
	545538528,
	2616352346,
	505241062,
	3763900197,
	2888722510,
	1264763076,
	1822329382,
	1257845551,
	1535649277,
	2089532395,
	2215424118,
	2295771800,
	543052005,
	1141685060,
	119138419,
	749337407,
	13485545,
	3874106929,
	2928428394,
	2544595324,
	1228498129,
	1197623568,
	1163938508,
	4260956477,
	3103969210,
	3731678889,
	592819979,
	2525340870,
	1682392315,
	883013012,
	1770592201,
	3523558385,
	3597948874,
	714171287,
	1247046859,
	3534161901,
	819669005,
	2612080378,
	2273018927,
	3463627335,
	2296444105,
	532263474,
	1822625065,
	3534652387,
	4290659295,
	494490863,
	2866134605,
	3793072803,
	3753946994,
	2459788002,
	3122139320,
	3885792534,
	509826136,
	483427050,
	3621836263,
	1841963022,
	3730194881,
	1230764812,
	54717181,
	3415843127,
	1111984570,
	1799932995,
	3294193988,
	2758729771,
	1279730562,
	2670542501,
	3076917323,
	2104303795,
	110997706,
	764560334,
	2859025702,
	550037746,
	2767121614,
	4009470551,
	1651207639,
	1157514380,
	935267206,
	2856750827,
	791504634,
	2787305692,
	1369497738,
	140669096,
	1167606214,
	447718239,
	3199820089,
	692933545,
	4006063109,
	3318495127,
	1974568827,
	2407546656,
	3156014333,
	753373809,
	1365768043,
	1152274450,
	2504822738,
	3063048204,
	1458625971,
	3875243945,
	2088409538,
	4278629151,
	2410743102,
	1602604338,
	4160672589,
	3496134650,
	2985507213,
	921713997,
	2250016173,
	2219237146,
	2259378922,
	1017714192,
	4263355383,
	4125383889,
	1332102076,
	977758853,
	11517204,
	4252283914,
	875599260,
	2611944926,
	3369895365,
	2145835305,
	4213884397,
	30376195,
	3998991217,
	2973438463,
	272696580,
	3403848954,
	3330273010,
	3550774645,
	697293896,
	458911542,
	2869908738,
	257978978,
	1610095969,
	2648072319,
	3420444038,
	4239107752,
	4046061194,
	3066050737,
	571741668,
	4090638442,
	1748018516,
	1730529058,
	115503973,
	3275262561,
	1082241110,
	997365964,
	1034532362,
	346659654,
	2344763600,
	2392040371,
	3696933128,
	488276171,
	3257693904,
	3788867234,
	405387546,
	3258297266,
	3614344809,
	2053739007,
	1135563987,
	80601375,
	2182172673,
	822192382,
	4097975004,
	1869701365,
	217647104,
	469743348,
	3590368804,
	980536618,
	50792880,
	674778571,
	2225018826,
	665571307,
	1587057614,
	2569231910,
	734555407,
	522818910,
	107174795,
	3875667478,
	1439704813,
	2374353360,
	3543171206,
	4193995686,
	3741405368,
	4171638274,
	4211530504,
	1716255036,
	1641991372,
	2079977378,
	1306797535,
	447815821,
	184278330,
	4226118535,
	2838563860,
	802348545,
	1614345970,
	2329598559,
	3909980848,
	1268621525,
	2910204840,
	1465685642,
	1561351736,
	1927231228,
	1548526690,
	1561223606,
	2433630100,
	674764382,
	290283463,
	3064867503,
	464875768,
	331506926,
	1743642855,
	2014210677,
	1923373952,
	1555936407,
	2387160762,
	252276859,
	2019717069,
	2882159161,
	2606121970,
	167021300,
	1670947197,
	624713933,
	812278327,
	1588855871,
	258173063,
	3126389784,
	3401108312,
	3677825498,
	898327590,
	3790121792,
	2267783899,
	2758400098,
	757228551,
	2759778248,
	4020813753,
	1983408194,
	2831266649,
	1734052469,
	811793678,
	2052628729,
	3491123026,
	2255200905,
	1727176909,
	4021556895,
	1924026098,
	3790846287,
	1565871025,
	3352945393,
	634090299,
	1927973038,
	2689764125,
	97795552,
	1363275155,
	3917753002,
	2861498920,
	2666182825,
	954443217,
	3623065706,
	2293231534,
	2802864606,
	678094452,
	3151743662,
	1553250607,
	1760085022,
	3114502212,
	3105637317,
	568278596,
	706068127,
	3006995427,
	3246670460,
	4134305585,
	3428237913,
	2381301418,
	2269013226,
	4115708403,
	3123335344,
	1720952799,
	2894760103,
	3648216607,
	783401454,
	141466472,
	3462339531,
	4020245973,
	2120596800,
	3485628784,
	1502924605,
	2325915897,
	3841260664,
	4215096758,
	2467110716,
	23966786,
	1677554518,
	3370487916,
	3498802623,
	124232462,
	936780707,
	3520529797,
	25531820,
	3555334839,
	897047873,
	3239975404,
	999420941,
	1569267646,
	82647075,
	2156564772,
	1213520264,
	471524678,
	2230196703,
	2546986008,
	3456694406,
	4271038195,
	2738224225,
	917532559,
	3478214647,
	2085024962,
	2668576920,
	1260040878,
	3249721556,
	2136556717,
	1083903407,
	2630801199,
	705789379,
	336268124,
	673164310,
	2614194481,
	3554853175,
	2812987894,
	764894752,
	1264208642,
	993726103,
	2174326119,
	2804413130,
	609781530,
	1454346894,
	1050324932,
	3524141160,
	621770131,
	3933908286,
	3587849499,
	3358489601,
	3681207795,
	3748704848,
	3299570571,
	1822895091,
	1579436793,
	3356730487,
	2060923311,
	1937632676,
	1370711317,
	2361771164,
	1105910994,
	3233032443,
	1102730797,
	683213159,
	4243832508,
	3792838247,
	2894441402,
	1588817832,
	420296804,
	4068210459,
	3285386607,
	3222423606,
	27870307,
	1264762071,
	1050979653,
	885792108,
	103739607,
	2858077429,
	2944899248,
	1627737897,
	1339106172,
	1160275329,
	1211859825,
	2754082985,
	990012903,
	1040656622,
	410708768,
	880528050,
	1815830020,
	4033895564,
	4286314265,
	29863736,
	90225554,
	3510311305,
	1217873367,
	3945490646,
	2866722547,
	1619844166,
	1236948233,
	1345316903,
	2449350112,
	3171207069,
	191718008,
	1456138340,
	3495979759,
	1930947001,
	3578448158,
	3397996154,
	2050137091,
	3358810265,
	3151063028,
	473639363,
	967838860,
	4067402421,
	3787458760,
	1589600924,
	967390492,
	95884283,
	609410709,
	4179210441,
	1785459396,
	61479931,
	1778744016,
	1992167485,
	3913397592,
	176615387,
	1399125722,
	1259649046,
	4239333143,
	2057858776,
	2124394241,
	1738068790,
	199501278,
	848616408,
	2178850397,
	2585695393,
	2138395007
};


To test the code:
Code:
pi@raspberrypi:~/haunted-usb-2 $ gcc -o driver driver.c
pi@raspberrypi:~/haunted-usb-2 $ while ./driver /dev/ttyACM0 <data.in/data.all >data.out; do head -n 1 data.out; sleep 2; done; cat data.out; echo
bad block 0272, hash=1353003265, expected=3757564542, 1fff919c
(dump of data.out follow)

If the above run had succeeded, data.out would contain only "success".

The behavior I see on Linux is exactly the same as I see on Mac OS X. Totally different hardware and different OS, but exactly the same very weird behavior in usb_rx_memory(). This has got to be some subtle problem in the USB code, or I suppose a hardware errata, right? If anyone has any ideas, hints, or tips, I would very much like to get this fixed.

All files are included in haunted-usb-2.zip at the end of this post.

Thanks for helping me fix this issue!

raspinfo
Code:
pi@raspberrypi:~/haunted-usb-2 $ raspinfo 
System Information
------------------

Raspberry Pi 4 Model B Rev 1.4
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"

Raspberry Pi reference 2021-03-04
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 461109415073d2eb67083709662ba983cc191f14, stage4

Linux raspberrypi 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux
Revision	: d03114
Serial		: 1000000018fdbb3c
Model		: Raspberry Pi 4 Model B Rev 1.4
Throttled flag  : throttled=0x0
Camera          : supported=0 detected=0

Videocore information
---------------------

Apr 30 2021 13:45:52 
Copyright (c) 2012 Broadcom
version d7f29d96450abfc77cd6cf011af1faf1e03e5e56 (clean) (release) (start)

alloc failures:     0
compactions:        0
legacy block fails: 0

Filesystem information
----------------------
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root      480513176 4448100 456490736   1% /
devtmpfs         3899532       0   3899532   0% /dev
tmpfs            4031628   33964   3997664   1% /dev/shm
tmpfs            4031628    8824   4022804   1% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs            4031628       0   4031628   0% /sys/fs/cgroup
/dev/sda1         258095   49717    208379  20% /boot
tmpfs             806324       8    806316   1% /run/user/1000
/dev/mmcblk0p2  30449076 4591784  24567532  16% /media/pi/rootfs
/dev/mmcblk0p1    258095   50574    207522  20% /media/pi/boot

Filename				Type		Size		Used		Priority
/var/swap                               file		102396		0		-2

Package version information
---------------------------
raspberrypi-ui-mods:
  Installed: 1.20201210+nmu1
raspberrypi-sys-mods:
  Installed: 20210310
openbox:
  Installed: 3.6.1-8+rpt5
lxpanel:
  Installed: 0.10.0-2+rpt15
pcmanfm:
  Installed: 1.3.1-1+rpt27
rpd-plym-splash:
  Installed: 0.26

Networking Information
----------------------

eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether m.m.m.m  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet x.x.x.x  netmask x.x.x.x
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 6682  bytes 618589 (604.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6682  bytes 618589 (604.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet x.x.x.x  netmask x.x.x.x  broadcast x.x.x.x
        inet6 y::y.y.y.y  prefixlen 64  scopeid 0x20<link>
        ether m.m.m.m  txqueuelen 1000  (Ethernet)
        RX packets 129968  bytes 183872480 (175.3 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35674  bytes 3967835 (3.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


USB Information
---------------

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
        |__ Port 3: Dev 107, If 0, Class=Communications, Driver=cdc_acm, 12M
        |__ Port 3: Dev 107, If 1, Class=CDC Data, Driver=cdc_acm, 12M
        |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/3p, 480M
            |__ Port 2: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
            |__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

config.txt
----------

arm_freq=1500
audio_pwm_mode=514
config_hdmi_boost=5
core_freq=500
core_freq_min=200
disable_commandline_tags=2
disable_l2cache=1
display_hdmi_rotate=-1
display_lcd_rotate=-1
dvfs=2
enable_gic=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
gpu_freq=500
gpu_freq_min=250
init_uart_clock=0x2dc6c00
lcd_framerate=60
mask_gpu_interrupt0=1024
mask_gpu_interrupt1=0x10000
max_framebuffers=2
over_voltage_avs=-20000
pause_burst_frames=1
program_serial_random=1
total_mem=8192
hdmi_force_cec_address:0=65535
hdmi_force_cec_address:1=65535
hdmi_pixel_freq_limit:0=0x11e1a300
hdmi_pixel_freq_limit:1=0x11e1a300
device_tree=-
overlay_prefix=overlays/
hdmi_cvt:0=
hdmi_cvt:1=
hdmi_edid_filename:0=
hdmi_edid_filename:1=
hdmi_timings:0=
hdmi_timings:1=

cmdline.txt
-----------
coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:1920x1200M@60 smsc95xx.macaddr=DC:A6:32:E8:C9:98 vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  console=ttyS0,115200 console=tty1 root=PARTUUID=a06a2e39-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles

raspi-gpio settings
-------------------

BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=0 func=INPUT pull=UP
GPIO 1: level=1 fsel=0 func=INPUT pull=UP
GPIO 2: level=1 fsel=0 func=INPUT pull=UP
GPIO 3: level=1 fsel=0 func=INPUT pull=UP
GPIO 4: level=1 fsel=0 func=INPUT pull=UP
GPIO 5: level=1 fsel=0 func=INPUT pull=UP
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 7: level=1 fsel=0 func=INPUT pull=UP
GPIO 8: level=1 fsel=0 func=INPUT pull=UP
GPIO 9: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 10: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 11: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 12: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 14: level=1 fsel=0 func=INPUT pull=NONE
GPIO 15: level=1 fsel=0 func=INPUT pull=UP
GPIO 16: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 17: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 18: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 19: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 20: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 21: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 22: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 23: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 24: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 25: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 26: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 27: level=0 fsel=0 func=INPUT pull=DOWN
BANK1 (GPIO 28 to 45):
GPIO 28: level=1 fsel=2 alt=5 func=RGMII_MDIO pull=UP
GPIO 29: level=0 fsel=2 alt=5 func=RGMII_MDC pull=DOWN
GPIO 30: level=0 fsel=7 alt=3 func=CTS0 pull=UP
GPIO 31: level=0 fsel=7 alt=3 func=RTS0 pull=NONE
GPIO 32: level=1 fsel=7 alt=3 func=TXD0 pull=NONE
GPIO 33: level=1 fsel=7 alt=3 func=RXD0 pull=UP
GPIO 34: level=1 fsel=7 alt=3 func=SD1_CLK pull=NONE
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD pull=UP
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0 pull=UP
GPIO 37: level=1 fsel=7 alt=3 func=SD1_DAT1 pull=UP
GPIO 38: level=1 fsel=7 alt=3 func=SD1_DAT2 pull=UP
GPIO 39: level=1 fsel=7 alt=3 func=SD1_DAT3 pull=UP
GPIO 40: level=0 fsel=4 alt=0 func=PWM1_0 pull=NONE
GPIO 41: level=1 fsel=4 alt=0 func=PWM1_1 pull=NONE
GPIO 42: level=0 fsel=1 func=OUTPUT pull=UP
GPIO 43: level=1 fsel=0 func=INPUT pull=UP
GPIO 44: level=1 fsel=0 func=INPUT pull=UP
GPIO 45: level=1 fsel=0 func=INPUT pull=UP
BANK2 (GPIO 46 to 53):
GPIO 46: level=0 fsel=0 func=INPUT pull=UP
GPIO 47: level=0 fsel=0 func=INPUT pull=UP
GPIO 48: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 49: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 50: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 51: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 52: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 53: level=0 fsel=0 func=INPUT pull=DOWN

vcdbg log messages
------------------

007611.883: brfs: File read: /mfs/sd/config.txt
007612.635: brfs: File read: 1784 bytes
007707.402: brfs: File read: /mfs/sd/config.txt
007723.762: brfs: File read: 1784 bytes
008217.259: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
008219.757: *** Restart logging
008262.940: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
008262.956: HDMI0: hdmi_pixel_encoding: 300000000
008262.968: HDMI1: hdmi_pixel_encoding: 300000000
008267.907: dtb_file 'bcm2711-rpi-4-b.dtb'
008271.127: brfs: File read: /mfs/sd/bcm2711-rpi-4-b.dtb
008271.142: Loading 'bcm2711-rpi-4-b.dtb' to 0x100 size 0xbfc2
008283.651: brfs: File read: 49090 bytes
008290.828: brfs: File read: /mfs/sd/overlays/overlay_map.dtb
008353.179: brfs: File read: 1523 bytes
008354.743: brfs: File read: /mfs/sd/config.txt
008355.221: dtparam: audio=on
008365.217: brfs: File read: 1784 bytes
008374.990: brfs: File read: /mfs/sd/overlays/vc4-fkms-v3d.dtbo
008392.041: Loaded overlay 'vc4-fkms-v3d'
008431.516: brfs: File read: 1446 bytes
008432.870: brfs: File read: /mfs/sd/cmdline.txt
008432.917: Read command line from file 'cmdline.txt':
008432.930: 'console=serial0,115200 console=tty1 root=PARTUUID=a06a2e39-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles'
009603.364: brfs: File read: 166 bytes
010078.511: brfs: File read: /mfs/sd/kernel7l.img
010078.550: Loading 'kernel7l.img' to 0x8000 size 0x662680
010078.597: Device tree loaded to 0x2eff3a00 (size 0xc5f6)
010085.970: bfs_xhci_stop
010085.983: XHCI-STOP
010086.178: xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
010087.280: PCI reset
015173.173: vchiq_core: vchiq_init_state: slot_zero = 0xded80000, is_master = 1
015176.767: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
015184.426: TV service:host side not connected, dropping notification 0x00000002, 0x00000002, 0x00000044
021163.365: TV service:host side not connected, dropping notification 0x00000008, 0x00000004, 0x00000000

dmesg log
---------

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.17-v7l+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1414 SMP Fri Apr 30 13:20:47 BST 2021
[    0.000000] CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi 4 Model B Rev 1.4
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] Reserved memory: created CMA memory pool at 0x000000001ec00000, size 256 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000002fffffff]
[    0.000000]   Normal   empty
[    0.000000]   HighMem  [mem 0x0000000030000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b2fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   node   0: [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] On node 0 totalpages: 2061056
[    0.000000]   DMA zone: 2304 pages used for memmap
[    0.000000]   DMA zone: 0 pages reserved
[    0.000000]   DMA zone: 196608 pages, LIFO batch:63
[    0.000000]   HighMem zone: 1864448 pages, LIFO batch:63
[    0.000000] percpu: Embedded 20 pages/cpu s50700 r8192 d23028 u81920
[    0.000000] pcpu-alloc: s50700 r8192 d23028 u81920 alloc=20*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2058752
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:1920x1200M@60 smsc95xx.macaddr=m.m.m.m vc_mem.mem_base=0x3eb00000 vc_mem.mem_size=0x3ff00000  console=ttyS0,115200 console=tty1 root=PARTUUID=a06a2e39-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
               Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x0000000014c00000-0x0000000018c00000] (64MB)
[    0.000000] Memory: 7799064K/8244224K available (10240K kernel code, 1358K rwdata, 3160K rodata, 2048K init, 890K bss, 183016K reserved, 262144K cma-reserved, 7457792K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 33942 entries in 67 pages
[    0.000000] ftrace: allocated 67 pages with 3 groups
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] 	Rude variant of Tasks RCU enabled.
[    0.000000] 	Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x3c8/0x59c with crng_init=0
[    0.000009] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[    0.000028] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[    0.000095] bcm2835: system timer (irq = 25)
[    0.000744] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[    0.000762] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000782] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000799] Switching to timer-based delay loop, resolution 18ns
[    0.001059] Console: colour dummy device 80x30
[    0.001132] printk: console [tty1] enabled
[    0.001188] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=540000)
[    0.001220] pid_max: default: 32768 minimum: 301
[    0.001391] LSM: Security Framework initializing
[    0.001589] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.001615] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    0.003257] Disabling memory control group subsystem
[    0.003380] CPU: Testing write buffer coherency: ok
[    0.003866] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.005107] Setting up static identity map for 0x200000 - 0x20003c
[    0.005317] rcu: Hierarchical SRCU implementation.
[    0.006264] smp: Bringing up secondary CPUs ...
[    0.007547] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
[    0.008971] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
[    0.010315] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
[    0.010472] smp: Brought up 1 node, 4 CPUs
[    0.010494] SMP: Total of 4 processors activated (432.00 BogoMIPS).
[    0.010509] CPU: All CPU(s) started in HYP mode.
[    0.010523] CPU: Virtualization extensions available.
[    0.011513] devtmpfs: initialized
[    0.025893] VFP support v0.3: implementor 41 architecture 3 part 40 variant 8 rev 0
[    0.026140] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.026172] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.033552] pinctrl core: initialized pinctrl subsystem
[    0.034681] NET: Registered protocol family 16
[    0.038921] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[    0.039716] audit: initializing netlink subsys (disabled)
[    0.039984] audit: type=2000 audit(0.030:1): state=initialized audit_enabled=0 res=1
[    0.040581] thermal_sys: Registered thermal governor 'step_wise'
[    0.041436] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.041453] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.041867] Serial: AMBA PL011 UART driver
[    0.074132] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    0.090881] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-04-30T13:45:52, variant start
[    0.100893] raspberrypi-firmware soc:firmware: Firmware hash is d7f29d96450abfc77cd6cf011af1faf1e03e5e56
[    0.145694] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1
[    0.149917] vgaarb: loaded
[    0.150380] SCSI subsystem initialized
[    0.150613] usbcore: registered new interface driver usbfs
[    0.150674] usbcore: registered new interface driver hub
[    0.150748] usbcore: registered new device driver usb
[    0.151451] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.153517] clocksource: Switched to clocksource arch_sys_counter
[    1.154092] VFS: Disk quotas dquot_6.6.0
[    1.154201] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.154385] FS-Cache: Loaded
[    1.154599] CacheFiles: Loaded
[    1.155698] simple-framebuffer 3e22c000.framebuffer: framebuffer at 0x3e22c000, 0x8ca000 bytes, mapped to 0x(ptrval)
[    1.155719] simple-framebuffer 3e22c000.framebuffer: format=a8r8g8b8, mode=1920x1200x32, linelength=7680
[    1.156252] Console: switching to colour frame buffer device 240x75
[    1.168149] simple-framebuffer 3e22c000.framebuffer: fb0: simplefb registered!
[    1.178728] NET: Registered protocol family 2
[    1.179587] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    1.179629] TCP established hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    1.179789] TCP bind hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    1.179865] TCP: Hash tables configured (established 8192 bind 8192)
[    1.180041] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.180081] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    1.180351] NET: Registered protocol family 1
[    1.181098] RPC: Registered named UNIX socket transport module.
[    1.181114] RPC: Registered udp transport module.
[    1.181130] RPC: Registered tcp transport module.
[    1.181145] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.181170] PCI: CLS 0 bytes, default 64
[    1.184313] Initialise system trusted keyrings
[    1.184562] workingset: timestamp_bits=14 max_order=21 bucket_order=7
[    1.193295] zbud: loaded
[    1.195274] FS-Cache: Netfs 'nfs' registered for caching
[    1.196043] NFS: Registering the id_resolver key type
[    1.196081] Key type id_resolver registered
[    1.196096] Key type id_legacy registered
[    1.196230] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.197297] Key type asymmetric registered
[    1.197314] Asymmetric key parser 'x509' registered
[    1.197510] bounce: pool size: 64 pages
[    1.197558] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.197780] io scheduler mq-deadline registered
[    1.197796] io scheduler kyber registered
[    1.202374] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.202407] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.202488] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.202576] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x00bfffffff -> 0x0400000000
[    1.285624] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC)
[    1.286016] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[    1.286038] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.286059] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])
[    1.286150] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[    1.286399] pci 0000:00:00.0: PME# supported from D0 D3hot
[    1.289938] PCI: bus0: Fast back to back transfers disabled
[    1.290199] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[    1.290273] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    1.290535] pci 0000:01:00.0: PME# supported from D0 D3hot
[    1.293966] PCI: bus1: Fast back to back transfers disabled
[    1.294031] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff]
[    1.294055] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit]
[    1.294099] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.294125] pci 0000:00:00.0:   bridge window [mem 0x600000000-0x6000fffff]
[    1.294569] pcieport 0000:00:00.0: enabling device (0140 -> 0142)
[    1.294808] pcieport 0000:00:00.0: PME: Signaling with IRQ 62
[    1.303426] iproc-rng200 fe104000.rng: hwrng registered
[    1.303783] vc-mem: phys_addr:0x00000000 mem_base=0x3eb00000 mem_size:0x3ff00000(1023 MiB)
[    1.304673] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[    1.317224] brd: module loaded
[    1.329932] loop: module loaded
[    1.331658] Loading iSCSI transport class v2.0-870.
[    1.334234] libphy: Fixed MDIO Bus: probed
[    1.335980] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[    1.353594] libphy: bcmgenet MII bus: probed
[    1.433681] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[    1.434914] usbcore: registered new interface driver r8152
[    1.434987] usbcore: registered new interface driver lan78xx
[    1.435048] usbcore: registered new interface driver smsc95xx
[    1.483250] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.483286] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[    1.486532] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000030000000890
[    1.487889] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    1.487908] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.487926] usb usb1: Product: xHCI Host Controller
[    1.487943] usb usb1: Manufacturer: Linux 5.10.17-v7l+ xhci-hcd
[    1.487959] usb usb1: SerialNumber: 0000:01:00.0
[    1.488738] hub 1-0:1.0: USB hub found
[    1.488856] hub 1-0:1.0: 1 port detected
[    1.489538] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.489578] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    1.489606] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[    1.490106] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[    1.490125] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.490142] usb usb2: Product: xHCI Host Controller
[    1.490159] usb usb2: Manufacturer: Linux 5.10.17-v7l+ xhci-hcd
[    1.490175] usb usb2: SerialNumber: 0000:01:00.0
[    1.490889] hub 2-0:1.0: USB hub found
[    1.490962] hub 2-0:1.0: 4 ports detected
[    1.492665] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.492981] dwc_otg: FIQ enabled
[    1.492996] dwc_otg: NAK holdoff enabled
[    1.493011] dwc_otg: FIQ split-transaction FSM enabled
[    1.493029] Module dwc_common_port init
[    1.493548] usbcore: registered new interface driver uas
[    1.493664] usbcore: registered new interface driver usb-storage
[    1.493875] mousedev: PS/2 mouse device common for all mice
[    1.495632] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    1.499242] sdhci: Secure Digital Host Controller Interface driver
[    1.499258] sdhci: Copyright(c) Pierre Ossman
[    1.499979] mmc-bcm2835 fe300000.mmcnr: could not get clk, deferring probe
[    1.500630] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.504835] ledtrig-cpu: registered to indicate activity on CPUs
[    1.505197] hid: raw HID events driver (C) Jiri Kosina
[    1.505394] usbcore: registered new interface driver usbhid
[    1.505409] usbhid: USB HID core driver
[    1.511472] Initializing XFRM netlink socket
[    1.511516] NET: Registered protocol family 17
[    1.511648] Key type dns_resolver registered
[    1.512114] Registering SWP/SWPB emulation handler
[    1.512313] registered taskstats version 1
[    1.512343] Loading compiled-in X.509 certificates
[    1.513187] Key type ._fscrypt registered
[    1.513205] Key type .fscrypt registered
[    1.513221] Key type fscrypt-provisioning registered
[    1.524967] uart-pl011 fe201000.serial: there is not valid maps for state default
[    1.525280] uart-pl011 fe201000.serial: cts_event_workaround enabled
[    1.525379] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 36, base_baud = 0) is a PL011 rev2
[    1.532221] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    1.533295] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    1.533312] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[    1.563739] of_cfs_init
[    1.564019] of_cfs_init: OK
[    1.582979] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    1.584668] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.586389] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.589409] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    1.591096] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    1.598921] mmc0: SDHCI controller on fe340000.emmc2 [fe340000.emmc2] using ADMA
[    1.599611] Waiting for root device PARTUUID=a06a2e39-02...
[    1.638755] random: fast init done
[    1.670549] mmc1: new high speed SDIO card at address 0001
[    1.706476] mmc0: new ultra high speed DDR50 SDHC card at address 0001
[    1.707508] mmcblk0: mmc0:0001 JB1RT 29.8 GiB
[    1.710302]  mmcblk0: p1 p2
[    1.853560] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    2.036173] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[    2.036194] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.036212] usb 1-1: Product: USB2.0 Hub
[    2.038127] hub 1-1:1.0: USB hub found
[    2.038422] hub 1-1:1.0: 4 ports detected
[    2.183990] usb 2-2: new SuperSpeed Gen 1 USB device number 2 using xhci_hcd
[    2.215203] usb 2-2: New USB device found, idVendor=174c, idProduct=55aa, bcdDevice= 1.00
[    2.215222] usb 2-2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[    2.215239] usb 2-2: Product: ASM105x
[    2.215256] usb 2-2: Manufacturer: ASMT
[    2.215272] usb 2-2: SerialNumber: 1234567A564C
[    2.239325] scsi host0: uas
[    2.240805] scsi 0:0:0:0: Direct-Access     ASMT     ASM105x          0    PQ: 0 ANSI: 6
[    2.242964] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    2.243158] sd 0:0:0:0: [sda] Write Protect is off
[    2.243178] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[    2.243584] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    2.244391] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes
[    2.246924]  sda: sda1 sda2
[    2.250136] sd 0:0:0:0: [sda] Attached SCSI disk
[    2.304332] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[    2.304432] VFS: Mounted root (ext4 filesystem) readonly on device 8:2.
[    2.305075] devtmpfs: mounted
[    2.314261] Freeing unused kernel memory: 2048K
[    2.343886] Run /sbin/init as init process
[    2.343901]   with arguments:
[    2.343916]     /sbin/init
[    2.343930]     splash
[    2.343944]   with environment:
[    2.343958]     HOME=/
[    2.343972]     TERM=linux
[    2.373591] usb 1-1.1: new low-speed USB device number 3 using xhci_hcd
[    2.513865] usb 1-1.1: New USB device found, idVendor=046d, idProduct=c069, bcdDevice=56.01
[    2.513888] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    2.513908] usb 1-1.1: Product: USB Laser Mouse
[    2.513925] usb 1-1.1: Manufacturer: Logitech
[    2.527268] input: Logitech USB Laser Mouse as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0/0003:046D:C069.0001/input/input0
[    2.527802] hid-generic 0003:046D:C069.0001: input,hidraw0: USB HID v1.10 Mouse [Logitech USB Laser Mouse] on usb-0000:01:00.0-1.1/input0
[    2.557900] systemd[1]: System time before build time, advancing clock.
[    2.625083] usb 1-1.4: new high-speed USB device number 4 using xhci_hcd
[    2.631596] NET: Registered protocol family 10
[    2.633029] Segment Routing with IPv6
[    2.669300] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid)
[    2.670113] systemd[1]: Detected architecture arm.
[    2.725464] systemd[1]: Set hostname to <raspberrypi>.
[    2.762425] usb 1-1.4: New USB device found, idVendor=05ac, idProduct=1005, bcdDevice=96.15
[    2.762451] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.762474] usb 1-1.4: Product: Keyboard Hub
[    2.762492] usb 1-1.4: Manufacturer: Apple Inc.
[    2.762509] usb 1-1.4: SerialNumber: 000000000000
[    2.764735] hub 1-1.4:1.0: USB hub found
[    2.764855] hub 1-1.4:1.0: 3 ports detected
[    3.083583] usb 1-1.4.2: new low-speed USB device number 5 using xhci_hcd
[    3.222544] usb 1-1.4.2: New USB device found, idVendor=05ac, idProduct=021d, bcdDevice= 0.70
[    3.222568] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    3.222587] usb 1-1.4.2: Product: Apple Keyboard
[    3.222604] usb 1-1.4.2: Manufacturer: Apple Inc.
[    3.369518] random: systemd: uninitialized urandom read (16 bytes read)
[    3.379109] random: systemd: uninitialized urandom read (16 bytes read)
[    3.381652] systemd[1]: Created slice User and Session Slice.
[    3.381924] random: systemd: uninitialized urandom read (16 bytes read)
[    3.381998] systemd[1]: Reached target Slices.
[    3.384473] systemd[1]: Listening on udev Kernel Socket.
[    3.386815] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[    3.387549] systemd[1]: Listening on fsck to fsckd communication Socket.
[    3.388477] systemd[1]: Listening on Journal Socket.
[    3.394617] systemd[1]: Mounting POSIX Message Queue File System...
[    3.531637] i2c /dev entries driver
[    4.712687] EXT4-fs (sda2): re-mounted. Opts: (null)
[    4.808930] systemd-journald[116]: Received request to flush runtime journal from PID 1
[    5.494485] rpivid-mem feb00000.hevc-decoder: rpivid-hevcmem initialised: Registers at 0xfeb00000 length 0x00010000
[    5.495018] rpivid-mem feb10000.rpivid-local-intc: rpivid-intcmem initialised: Registers at 0xfeb10000 length 0x00001000
[    5.495505] rpivid-mem feb20000.h264-decoder: rpivid-h264mem initialised: Registers at 0xfeb20000 length 0x00010000
[    5.496338] rpivid-mem feb30000.vp9-decoder: rpivid-vp9mem initialised: Registers at 0xfeb30000 length 0x00010000
[    5.580517] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned.
[    5.582814] bcm2835_vc_sm_cma_probe: Videocore shared memory driver
[    5.582840] [vc_sm_connected_init]: start
[    5.595359] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[    5.600063] [vc_sm_connected_init]: installed successfully
[    5.618846] mc: Linux media interface: v0.10
[    5.645878] bcm2835_audio bcm2835_audio: card created with 4 channels
[    5.689653] videodev: Linux video capture interface: v2.00
[    5.741516] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[    5.748129] bcm2835_audio bcm2835_audio: card created with 4 channels
[    5.753383] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned.
[    5.762653] bcm2835-codec bcm2835-codec: Device registered as /dev/video10
[    5.762733] bcm2835-codec bcm2835-codec: Loaded V4L2 decode
[    5.763352] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
[    5.783396] bcm2835-codec bcm2835-codec: Device registered as /dev/video11
[    5.783444] bcm2835-codec bcm2835-codec: Loaded V4L2 encode
[    5.804348] bcm2835-codec bcm2835-codec: Device registered as /dev/video12
[    5.804474] bcm2835-codec bcm2835-codec: Loaded V4L2 isp
[    5.850749] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    5.867074] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned.
[    5.998637] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13
[    6.003695] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14
[    6.004214] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15
[    6.004607] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16
[    6.004639] bcm2835-isp bcm2835-isp: Register output node 0 with media controller
[    6.004665] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller
[    6.004689] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller
[    6.004712] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller
[    6.004955] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp
[    6.025725] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    6.084567] [drm] Initialized v3d 1.0.0 20180419 for fec00000.v3d on minor 0
[    6.104021] brcmfmac: F1 signature read @0x18000000=0x15264345
[    6.137088] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.139226] usbcore: registered new interface driver brcmfmac
[    6.148589] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2
[    6.350696] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    6.361096] vc4-drm gpu: bound fe600000.firmwarekms (ops vc4_fkms_ops [vc4])
[    6.361126] checking generic (3e22c000 8ca000) vs hw (0 ffffffffffffffff)
[    6.361144] fb0: switching to vc4drmfb from simple
[    6.361840] Console: switching to colour dummy device 80x30
[    6.363073] [drm] Initialized vc4 0.0.0 20140616 for gpu on minor 1
[    6.402216] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    6.417646] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan  4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e
[    6.429686] Console: switching to colour frame buffer device 240x75
[    6.429745] vc4-drm gpu: [drm] fb0: vc4drmfb frame buffer device
[    6.456215] input: Apple Inc. Apple Keyboard as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.2/1-1.4.2:1.0/0003:05AC:021D.0002/input/input1
[    6.529462] apple 0003:05AC:021D.0002: input,hidraw1: USB HID v1.11 Keyboard [Apple Inc. Apple Keyboard] on usb-0000:01:00.0-1.4.2/input0
[    6.533251] apple 0003:05AC:021D.0003: Fn key not found (Apple Wireless Keyboard clone?), disabling Fn key handling
[    6.533824] input: Apple Inc. Apple Keyboard as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4.2/1-1.4.2:1.1/0003:05AC:021D.0003/input/input2
[    6.604105] apple 0003:05AC:021D.0003: input,hidraw2: USB HID v1.11 Device [Apple Inc. Apple Keyboard] on usb-0000:01:00.0-1.4.2/input1
[    9.044126] random: crng init done
[    9.044150] random: 7 urandom warning(s) missed due to ratelimiting
[    9.104459] uart-pl011 fe201000.serial: no DMA platform data
[    9.160301] 8021q: 802.1Q VLAN Support v1.8
[    9.513813] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS
[    9.713403] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[   10.079720] bcmgenet fd580000.ethernet: configuring instance for external RGMII (RX delay)
[   10.080221] bcmgenet fd580000.ethernet eth0: Link is Down
[   11.491733] broken atomic modeset userspace detected, disabling atomic
[   13.361056] fuse: init (API version 7.32)
[   15.377316] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   15.685421] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   15.824019] Bluetooth: Core ver 2.22
[   15.824085] NET: Registered protocol family 31
[   15.824092] Bluetooth: HCI device and connection manager initialized
[   15.824393] Bluetooth: HCI socket layer initialized
[   15.824403] Bluetooth: L2CAP socket layer initialized
[   15.824421] Bluetooth: SCO socket layer initialized
[   15.828954] Bluetooth: HCI UART driver ver 2.3
[   15.828964] Bluetooth: HCI UART protocol H4 registered
[   15.829032] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   15.829603] Bluetooth: HCI UART protocol Broadcom registered
[   15.954058] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   15.954087] Bluetooth: BNEP filters: protocol multicast
[   15.954153] Bluetooth: BNEP socket layer initialized
[   15.990286] Bluetooth: RFCOMM TTY layer initialized
[   15.990315] Bluetooth: RFCOMM socket layer initialized
[   15.990351] Bluetooth: RFCOMM ver 1.11
[   26.967162] v3d fec00000.v3d: MMU error from client L2T (0) at 0x38e1000, pte invalid
[  502.216568] process 'home/pi/Downloads/TeensyduinoInstall.linuxarm' started with executable stack
[  847.741684] usb 1-1.3: new high-speed USB device number 6 using xhci_hcd
[  847.872432] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0486, bcdDevice= 2.79
[  847.872457] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  847.872475] usb 1-1.3: Product: Teensyduino RawHID
[  847.872493] usb 1-1.3: Manufacturer: Teensyduino
[  847.872510] usb 1-1.3: SerialNumber: 9461660
[  847.879460] hid-generic 0003:16C0:0486.0004: hiddev96,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:01:00.0-1.3/input0
[  847.883274] hid-generic 0003:16C0:0486.0005: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:01:00.0-1.3/input1
[  989.803060] usb 1-1.3: USB disconnect, device number 6
[  990.114816] usb 1-1.3: new high-speed USB device number 7 using xhci_hcd
[  990.245191] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.05
[  990.245201] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[  990.245209] usb 1-1.3: SerialNumber: 000E6FF6
[  990.248405] hid-generic 0003:16C0:0478.0006: hidraw3: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:01:00.0-1.3/input0
[  991.083260] usb 1-1.3: USB disconnect, device number 7
[  991.384990] usb 1-1.3: new high-speed USB device number 8 using xhci_hcd
[  991.515312] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[  991.515323] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  991.515331] usb 1-1.3: Product: USB Serial
[  991.515338] usb 1-1.3: Manufacturer: Teensyduino
[  991.515344] usb 1-1.3: SerialNumber: 9461660
[  991.533936] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[  991.534538] usbcore: registered new interface driver cdc_acm
[  991.534547] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1020.783962] usb 1-1.3: USB disconnect, device number 8
[ 1021.082269] usb 1-1.3: new high-speed USB device number 9 using xhci_hcd
[ 1021.212634] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.05
[ 1021.212644] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[ 1021.212651] usb 1-1.3: SerialNumber: 000E6FF6
[ 1021.215334] hid-generic 0003:16C0:0478.0007: hidraw3: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:01:00.0-1.3/input0
[ 1022.063822] usb 1-1.3: USB disconnect, device number 9
[ 1022.372189] usb 1-1.3: new high-speed USB device number 10 using xhci_hcd
[ 1022.502685] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1022.502695] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1022.502703] usb 1-1.3: Product: USB Serial
[ 1022.502710] usb 1-1.3: Manufacturer: Teensyduino
[ 1022.502717] usb 1-1.3: SerialNumber: 9461660
[ 1022.505421] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1115.262132] usb 1-1.3: USB disconnect, device number 10
[ 1115.569226] usb 1-1.3: new high-speed USB device number 11 using xhci_hcd
[ 1115.699731] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1115.699741] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1115.699748] usb 1-1.3: Product: USB Serial
[ 1115.699755] usb 1-1.3: Manufacturer: Teensyduino
[ 1115.699762] usb 1-1.3: SerialNumber: 9461660
[ 1115.702362] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1168.261932] usb 1-1.3: USB disconnect, device number 11
[ 1168.610553] usb 1-1.3: new high-speed USB device number 12 using xhci_hcd
[ 1168.741016] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1168.741027] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1168.741035] usb 1-1.3: Product: USB Serial
[ 1168.741042] usb 1-1.3: Manufacturer: Teensyduino
[ 1168.741049] usb 1-1.3: SerialNumber: 9461660
[ 1168.744155] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1173.894821] usb 1-1.3: USB disconnect, device number 12
[ 1174.200513] usb 1-1.3: new high-speed USB device number 13 using xhci_hcd
[ 1174.331051] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1174.331062] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1174.331069] usb 1-1.3: Product: USB Serial
[ 1174.331076] usb 1-1.3: Manufacturer: Teensyduino
[ 1174.331083] usb 1-1.3: SerialNumber: 9461660
[ 1174.333670] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1253.010240] usb 1-1.3: USB disconnect, device number 13
[ 1253.318958] usb 1-1.3: new high-speed USB device number 14 using xhci_hcd
[ 1253.459504] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1253.459515] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1253.459523] usb 1-1.3: Product: USB Serial
[ 1253.459530] usb 1-1.3: Manufacturer: Teensyduino
[ 1253.459537] usb 1-1.3: SerialNumber: 9461660
[ 1253.462107] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1316.763882] usb 1-1.3: USB disconnect, device number 14
[ 1317.166045] usb 1-1.3: new high-speed USB device number 15 using xhci_hcd
[ 1317.296538] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1317.296549] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1317.296556] usb 1-1.3: Product: USB Serial
[ 1317.296563] usb 1-1.3: Manufacturer: Teensyduino
[ 1317.296570] usb 1-1.3: SerialNumber: 9461660
[ 1317.299310] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1320.348442] usb 1-1.3: USB disconnect, device number 15
[ 1320.655852] usb 1-1.3: new high-speed USB device number 16 using xhci_hcd
[ 1320.786406] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1320.786416] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1320.786424] usb 1-1.3: Product: USB Serial
[ 1320.786431] usb 1-1.3: Manufacturer: Teensyduino
[ 1320.786438] usb 1-1.3: SerialNumber: 9461660
[ 1320.789506] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1323.933011] usb 1-1.3: USB disconnect, device number 16
[ 1324.235656] usb 1-1.3: new high-speed USB device number 17 using xhci_hcd
[ 1324.366162] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1324.366172] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1324.366180] usb 1-1.3: Product: USB Serial
[ 1324.366187] usb 1-1.3: Manufacturer: Teensyduino
[ 1324.366194] usb 1-1.3: SerialNumber: 9461660
[ 1324.368777] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1327.261217] usb 1-1.3: USB disconnect, device number 17
[ 1327.605466] usb 1-1.3: new high-speed USB device number 18 using xhci_hcd
[ 1327.735976] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1327.735987] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1327.735995] usb 1-1.3: Product: USB Serial
[ 1327.736002] usb 1-1.3: Manufacturer: Teensyduino
[ 1327.736009] usb 1-1.3: SerialNumber: 9461660
[ 1327.738677] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1330.846158] usb 1-1.3: USB disconnect, device number 18
[ 1331.155279] usb 1-1.3: new high-speed USB device number 19 using xhci_hcd
[ 1331.285806] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1331.285817] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1331.285825] usb 1-1.3: Product: USB Serial
[ 1331.285832] usb 1-1.3: Manufacturer: Teensyduino
[ 1331.285838] usb 1-1.3: SerialNumber: 9461660
[ 1331.288527] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1334.221781] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1334.430688] usb 1-1.3: USB disconnect, device number 19
[ 1334.735057] usb 1-1.3: new high-speed USB device number 20 using xhci_hcd
[ 1334.865566] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1334.865577] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1334.865585] usb 1-1.3: Product: USB Serial
[ 1334.865593] usb 1-1.3: Manufacturer: Teensyduino
[ 1334.865599] usb 1-1.3: SerialNumber: 9461660
[ 1334.868214] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1337.759014] usb 1-1.3: USB disconnect, device number 20
[ 1338.114865] usb 1-1.3: new high-speed USB device number 21 using xhci_hcd
[ 1338.245361] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1338.245373] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1338.245380] usb 1-1.3: Product: USB Serial
[ 1338.245388] usb 1-1.3: Manufacturer: Teensyduino
[ 1338.245394] usb 1-1.3: SerialNumber: 9461660
[ 1338.248076] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1341.208306] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1341.343532] usb 1-1.3: USB disconnect, device number 21
[ 1341.644658] usb 1-1.3: new high-speed USB device number 22 using xhci_hcd
[ 1341.775196] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1341.775207] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1341.775215] usb 1-1.3: Product: USB Serial
[ 1341.775222] usb 1-1.3: Manufacturer: Teensyduino
[ 1341.775229] usb 1-1.3: SerialNumber: 9461660
[ 1341.795179] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1344.928069] usb 1-1.3: USB disconnect, device number 22
[ 1345.224461] usb 1-1.3: new high-speed USB device number 23 using xhci_hcd
[ 1345.354963] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1345.354974] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1345.354981] usb 1-1.3: Product: USB Serial
[ 1345.354988] usb 1-1.3: Manufacturer: Teensyduino
[ 1345.354995] usb 1-1.3: SerialNumber: 9461660
[ 1345.357668] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1348.256560] usb 1-1.3: USB disconnect, device number 23
[ 1348.604268] usb 1-1.3: new high-speed USB device number 24 using xhci_hcd
[ 1348.734745] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1348.734755] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1348.734762] usb 1-1.3: Product: USB Serial
[ 1348.734769] usb 1-1.3: Manufacturer: Teensyduino
[ 1348.734776] usb 1-1.3: SerialNumber: 9461660
[ 1348.737351] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1351.840806] usb 1-1.3: USB disconnect, device number 24
[ 1352.144041] usb 1-1.3: new high-speed USB device number 25 using xhci_hcd
[ 1352.274600] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1352.274617] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1352.274630] usb 1-1.3: Product: USB Serial
[ 1352.274642] usb 1-1.3: Manufacturer: Teensyduino
[ 1352.274654] usb 1-1.3: SerialNumber: 9461660
[ 1352.278142] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1355.425389] usb 1-1.3: USB disconnect, device number 25
[ 1355.723829] usb 1-1.3: new high-speed USB device number 26 using xhci_hcd
[ 1355.854334] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1355.854345] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1355.854353] usb 1-1.3: Product: USB Serial
[ 1355.854360] usb 1-1.3: Manufacturer: Teensyduino
[ 1355.854367] usb 1-1.3: SerialNumber: 9461660
[ 1355.856958] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1358.753869] usb 1-1.3: USB disconnect, device number 26
[ 1359.063623] usb 1-1.3: new high-speed USB device number 27 using xhci_hcd
[ 1359.194198] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1359.194209] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1359.194217] usb 1-1.3: Product: USB Serial
[ 1359.194224] usb 1-1.3: Manufacturer: Teensyduino
[ 1359.194231] usb 1-1.3: SerialNumber: 9461660
[ 1359.196777] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1362.338418] usb 1-1.3: USB disconnect, device number 27
[ 1362.663426] usb 1-1.3: new high-speed USB device number 28 using xhci_hcd
[ 1362.804107] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1362.804129] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1362.804146] usb 1-1.3: Product: USB Serial
[ 1362.804161] usb 1-1.3: Manufacturer: Teensyduino
[ 1362.804176] usb 1-1.3: SerialNumber: 9461660
[ 1362.808091] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1365.667134] usb 1-1.3: USB disconnect, device number 28
[ 1366.063238] usb 1-1.3: new high-speed USB device number 29 using xhci_hcd
[ 1366.203677] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1366.203688] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1366.203695] usb 1-1.3: Product: USB Serial
[ 1366.203702] usb 1-1.3: Manufacturer: Teensyduino
[ 1366.203709] usb 1-1.3: SerialNumber: 9461660
[ 1366.206430] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1369.251510] usb 1-1.3: USB disconnect, device number 29
[ 1369.552988] usb 1-1.3: new high-speed USB device number 30 using xhci_hcd
[ 1369.693545] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1369.693556] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1369.693564] usb 1-1.3: Product: USB Serial
[ 1369.693571] usb 1-1.3: Manufacturer: Teensyduino
[ 1369.693578] usb 1-1.3: SerialNumber: 9461660
[ 1369.696184] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1372.853306] usb 1-1.3: USB disconnect, device number 30
[ 1373.152759] usb 1-1.3: new high-speed USB device number 31 using xhci_hcd
[ 1373.283260] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1373.283271] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1373.283279] usb 1-1.3: Product: USB Serial
[ 1373.283286] usb 1-1.3: Manufacturer: Teensyduino
[ 1373.283293] usb 1-1.3: SerialNumber: 9461660
[ 1373.285825] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1376.141246] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1376.164655] usb 1-1.3: USB disconnect, device number 31
[ 1376.522563] usb 1-1.3: new high-speed USB device number 32 using xhci_hcd
[ 1376.663045] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1376.663056] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1376.663064] usb 1-1.3: Product: USB Serial
[ 1376.663071] usb 1-1.3: Manufacturer: Teensyduino
[ 1376.663078] usb 1-1.3: SerialNumber: 9461660
[ 1376.665782] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1379.749270] usb 1-1.3: USB disconnect, device number 32
[ 1380.052359] usb 1-1.3: new high-speed USB device number 33 using xhci_hcd
[ 1380.182883] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1380.182894] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1380.182902] usb 1-1.3: Product: USB Serial
[ 1380.182909] usb 1-1.3: Manufacturer: Teensyduino
[ 1380.182916] usb 1-1.3: SerialNumber: 9461660
[ 1380.185459] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1383.333800] usb 1-1.3: USB disconnect, device number 33
[ 1383.642121] usb 1-1.3: new high-speed USB device number 34 using xhci_hcd
[ 1383.772583] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1383.772593] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1383.772601] usb 1-1.3: Product: USB Serial
[ 1383.772608] usb 1-1.3: Manufacturer: Teensyduino
[ 1383.772615] usb 1-1.3: SerialNumber: 9461660
[ 1383.775146] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1386.662233] usb 1-1.3: USB disconnect, device number 34
[ 1387.011907] usb 1-1.3: new high-speed USB device number 35 using xhci_hcd
[ 1387.142379] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1387.142391] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1387.142399] usb 1-1.3: Product: USB Serial
[ 1387.142406] usb 1-1.3: Manufacturer: Teensyduino
[ 1387.142413] usb 1-1.3: SerialNumber: 9461660
[ 1387.145073] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1390.246510] usb 1-1.3: USB disconnect, device number 35
[ 1390.601657] usb 1-1.3: new high-speed USB device number 36 using xhci_hcd
[ 1390.742107] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1390.742118] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1390.742126] usb 1-1.3: Product: USB Serial
[ 1390.742133] usb 1-1.3: Manufacturer: Teensyduino
[ 1390.742140] usb 1-1.3: SerialNumber: 9461660
[ 1390.744626] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1393.831452] usb 1-1.3: USB disconnect, device number 36
[ 1394.131450] usb 1-1.3: new high-speed USB device number 37 using xhci_hcd
[ 1394.261896] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1394.261908] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1394.261915] usb 1-1.3: Product: USB Serial
[ 1394.261922] usb 1-1.3: Manufacturer: Teensyduino
[ 1394.261929] usb 1-1.3: SerialNumber: 9461660
[ 1394.264502] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1397.159774] usb 1-1.3: USB disconnect, device number 37
[ 1397.521872] usb 1-1.3: new high-speed USB device number 38 using xhci_hcd
[ 1397.654566] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1397.654583] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1397.654596] usb 1-1.3: Product: USB Serial
[ 1397.654608] usb 1-1.3: Manufacturer: Teensyduino
[ 1397.654620] usb 1-1.3: SerialNumber: 9461660
[ 1397.657907] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1400.744380] usb 1-1.3: USB disconnect, device number 38
[ 1401.040980] usb 1-1.3: new high-speed USB device number 39 using xhci_hcd
[ 1401.171515] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1401.171526] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1401.171533] usb 1-1.3: Product: USB Serial
[ 1401.171540] usb 1-1.3: Manufacturer: Teensyduino
[ 1401.171547] usb 1-1.3: SerialNumber: 9461660
[ 1401.174228] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1404.328858] usb 1-1.3: USB disconnect, device number 39
[ 1404.650712] usb 1-1.3: new high-speed USB device number 40 using xhci_hcd
[ 1404.791212] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1404.791224] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1404.791231] usb 1-1.3: Product: USB Serial
[ 1404.791239] usb 1-1.3: Manufacturer: Teensyduino
[ 1404.791246] usb 1-1.3: SerialNumber: 9461660
[ 1404.793830] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1407.657161] usb 1-1.3: USB disconnect, device number 40
[ 1407.960500] usb 1-1.3: new high-speed USB device number 41 using xhci_hcd
[ 1408.091109] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1408.091124] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1408.091135] usb 1-1.3: Product: USB Serial
[ 1408.091146] usb 1-1.3: Manufacturer: Teensyduino
[ 1408.091156] usb 1-1.3: SerialNumber: 9461660
[ 1408.094375] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1411.241930] usb 1-1.3: USB disconnect, device number 41
[ 1411.550257] usb 1-1.3: new high-speed USB device number 42 using xhci_hcd
[ 1411.700774] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1411.700785] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1411.700793] usb 1-1.3: Product: USB Serial
[ 1411.700800] usb 1-1.3: Manufacturer: Teensyduino
[ 1411.700807] usb 1-1.3: SerialNumber: 9461660
[ 1411.703394] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1414.826167] usb 1-1.3: USB disconnect, device number 42
[ 1415.130067] usb 1-1.3: new high-speed USB device number 43 using xhci_hcd
[ 1415.270502] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1415.270513] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1415.270521] usb 1-1.3: Product: USB Serial
[ 1415.270527] usb 1-1.3: Manufacturer: Teensyduino
[ 1415.270535] usb 1-1.3: SerialNumber: 9461660
[ 1415.273070] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1418.154679] usb 1-1.3: USB disconnect, device number 43
[ 1418.479784] usb 1-1.3: new high-speed USB device number 44 using xhci_hcd
[ 1418.610321] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1418.610333] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1418.610341] usb 1-1.3: Product: USB Serial
[ 1418.610348] usb 1-1.3: Manufacturer: Teensyduino
[ 1418.610355] usb 1-1.3: SerialNumber: 9461660
[ 1418.612897] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1421.739211] usb 1-1.3: USB disconnect, device number 44
[ 1422.039539] usb 1-1.3: new high-speed USB device number 45 using xhci_hcd
[ 1422.170148] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1422.170159] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1422.170167] usb 1-1.3: Product: USB Serial
[ 1422.170174] usb 1-1.3: Manufacturer: Teensyduino
[ 1422.170181] usb 1-1.3: SerialNumber: 9461660
[ 1422.172854] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1425.067919] usb 1-1.3: USB disconnect, device number 45
[ 1425.419319] usb 1-1.3: new high-speed USB device number 46 using xhci_hcd
[ 1425.549819] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1425.549830] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1425.549837] usb 1-1.3: Product: USB Serial
[ 1425.549844] usb 1-1.3: Manufacturer: Teensyduino
[ 1425.549851] usb 1-1.3: SerialNumber: 9461660
[ 1425.552385] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1428.652464] usb 1-1.3: USB disconnect, device number 46
[ 1428.949077] usb 1-1.3: new high-speed USB device number 47 using xhci_hcd
[ 1429.079631] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1429.079644] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1429.079652] usb 1-1.3: Product: USB Serial
[ 1429.079659] usb 1-1.3: Manufacturer: Teensyduino
[ 1429.079665] usb 1-1.3: SerialNumber: 9461660
[ 1429.082491] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1432.237039] usb 1-1.3: USB disconnect, device number 47
[ 1432.548814] usb 1-1.3: new high-speed USB device number 48 using xhci_hcd
[ 1432.679381] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.79
[ 1432.679391] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1432.679399] usb 1-1.3: Product: USB Serial
[ 1432.679406] usb 1-1.3: Manufacturer: Teensyduino
[ 1432.679413] usb 1-1.3: SerialNumber: 9461660
[ 1432.682065] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1442.478121] usb 1-1.3: USB disconnect, device number 48
[ 1466.076461] usb 1-1.3: new full-speed USB device number 49 using xhci_hcd
[ 1466.211818] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0486, bcdDevice= 2.73
[ 1466.211829] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1466.211837] usb 1-1.3: Product: Teensyduino RawHID
[ 1466.211844] usb 1-1.3: Manufacturer: Teensyduino
[ 1466.211851] usb 1-1.3: SerialNumber: 9423190
[ 1466.221133] hid-generic 0003:16C0:0486.0008: hiddev96,hidraw3: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:01:00.0-1.3/input0
[ 1466.227184] hid-generic 0003:16C0:0486.0009: hidraw4: USB HID v1.11 Device [Teensyduino Teensyduino RawHID] on usb-0000:01:00.0-1.3/input1
[ 1534.395624] usb 1-1.3: USB disconnect, device number 49
[ 1534.851447] usb 1-1.3: new full-speed USB device number 50 using xhci_hcd
[ 1534.984994] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.02
[ 1534.985005] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[ 1534.985013] usb 1-1.3: SerialNumber: 000E60EF
[ 1534.990172] hid-generic 0003:16C0:0478.000A: hidraw3: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:01:00.0-1.3/input0
[ 1535.932093] usb 1-1.3: USB disconnect, device number 50
[ 1536.291300] usb 1-1.3: new full-speed USB device number 51 using xhci_hcd
[ 1536.426706] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1536.426717] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1536.426725] usb 1-1.3: Product: USB Serial
[ 1536.426732] usb 1-1.3: Manufacturer: Teensyduino
[ 1536.426738] usb 1-1.3: SerialNumber: 9423190
[ 1536.443653] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1565.483408] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1565.632791] usb 1-1.3: USB disconnect, device number 51
[ 1565.932547] usb 1-1.3: new full-speed USB device number 52 using xhci_hcd
[ 1566.068094] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1566.068104] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1566.068112] usb 1-1.3: Product: USB Serial
[ 1566.068119] usb 1-1.3: Manufacturer: Teensyduino
[ 1566.068126] usb 1-1.3: SerialNumber: 9423190
[ 1566.070782] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1611.533178] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1611.719622] usb 1-1.3: USB disconnect, device number 52
[ 1612.016447] usb 1-1.3: new full-speed USB device number 53 using xhci_hcd
[ 1612.151912] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1612.151923] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1612.151931] usb 1-1.3: Product: USB Serial
[ 1612.151938] usb 1-1.3: Manufacturer: Teensyduino
[ 1612.151945] usb 1-1.3: SerialNumber: 9423190
[ 1612.154608] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1880.303062] usb 1-1.3: USB disconnect, device number 53
[ 1880.752464] usb 1-1.3: new full-speed USB device number 54 using xhci_hcd
[ 1880.888188] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0478, bcdDevice= 1.02
[ 1880.888199] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber=1
[ 1880.888207] usb 1-1.3: SerialNumber: 000E60EF
[ 1880.893595] hid-generic 0003:16C0:0478.000B: hidraw3: USB HID v1.11 Device [HID 16c0:0478] on usb-0000:01:00.0-1.3/input0
[ 1882.095042] usb 1-1.3: USB disconnect, device number 54
[ 1882.392442] usb 1-1.3: new full-speed USB device number 55 using xhci_hcd
[ 1882.527805] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1882.527815] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1882.527823] usb 1-1.3: Product: USB Serial
[ 1882.527830] usb 1-1.3: Manufacturer: Teensyduino
[ 1882.527837] usb 1-1.3: SerialNumber: 9423190
[ 1882.530491] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1893.803824] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1893.873310] usb 1-1.3: USB disconnect, device number 55
[ 1894.172279] usb 1-1.3: new full-speed USB device number 56 using xhci_hcd
[ 1894.309678] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1894.309688] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1894.309696] usb 1-1.3: Product: USB Serial
[ 1894.309703] usb 1-1.3: Manufacturer: Teensyduino
[ 1894.309710] usb 1-1.3: SerialNumber: 9423190
[ 1894.312384] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1903.447391] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1903.859065] usb 1-1.3: USB disconnect, device number 56
[ 1904.172109] usb 1-1.3: new full-speed USB device number 57 using xhci_hcd
[ 1904.307529] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1904.307540] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1904.307548] usb 1-1.3: Product: USB Serial
[ 1904.307555] usb 1-1.3: Manufacturer: Teensyduino
[ 1904.307562] usb 1-1.3: SerialNumber: 9423190
[ 1904.310205] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1910.880883] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1911.027823] usb 1-1.3: USB disconnect, device number 57
[ 1911.362000] usb 1-1.3: new full-speed USB device number 58 using xhci_hcd
[ 1911.517923] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1911.517941] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1911.517949] usb 1-1.3: Product: USB Serial
[ 1911.517957] usb 1-1.3: Manufacturer: Teensyduino
[ 1911.517963] usb 1-1.3: SerialNumber: 9423190
[ 1911.522463] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1918.314844] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1918.709080] usb 1-1.3: USB disconnect, device number 58
[ 1919.001851] usb 1-1.3: new full-speed USB device number 59 using xhci_hcd
[ 1919.137240] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1919.137253] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1919.137261] usb 1-1.3: Product: USB Serial
[ 1919.137268] usb 1-1.3: Manufacturer: Teensyduino
[ 1919.137275] usb 1-1.3: SerialNumber: 9423190
[ 1919.139910] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1925.750562] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1926.134153] usb 1-1.3: USB disconnect, device number 59
[ 1926.431702] usb 1-1.3: new full-speed USB device number 60 using xhci_hcd
[ 1926.567078] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1926.567089] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1926.567097] usb 1-1.3: Product: USB Serial
[ 1926.567104] usb 1-1.3: Manufacturer: Teensyduino
[ 1926.567111] usb 1-1.3: SerialNumber: 9423190
[ 1926.569780] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1933.184409] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1933.303180] usb 1-1.3: USB disconnect, device number 60
[ 1933.601597] usb 1-1.3: new full-speed USB device number 61 using xhci_hcd
[ 1933.746895] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1933.746905] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1933.746913] usb 1-1.3: Product: USB Serial
[ 1933.746920] usb 1-1.3: Manufacturer: Teensyduino
[ 1933.746927] usb 1-1.3: SerialNumber: 9423190
[ 1933.749565] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1940.616381] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1940.728361] usb 1-1.3: USB disconnect, device number 61
[ 1941.041430] usb 1-1.3: new full-speed USB device number 62 using xhci_hcd
[ 1941.176871] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1941.176882] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1941.176889] usb 1-1.3: Product: USB Serial
[ 1941.176896] usb 1-1.3: Manufacturer: Teensyduino
[ 1941.176903] usb 1-1.3: SerialNumber: 9423190
[ 1941.179544] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1948.052353] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1948.153409] usb 1-1.3: USB disconnect, device number 62
[ 1948.461210] usb 1-1.3: new full-speed USB device number 63 using xhci_hcd
[ 1948.596728] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1948.596744] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1948.596756] usb 1-1.3: Product: USB Serial
[ 1948.596766] usb 1-1.3: Manufacturer: Teensyduino
[ 1948.596776] usb 1-1.3: SerialNumber: 9423190
[ 1948.599488] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1955.484090] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1955.578488] usb 1-1.3: USB disconnect, device number 63
[ 1955.891080] usb 1-1.3: new full-speed USB device number 64 using xhci_hcd
[ 1956.026568] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1956.026579] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1956.026587] usb 1-1.3: Product: USB Serial
[ 1956.026594] usb 1-1.3: Manufacturer: Teensyduino
[ 1956.026601] usb 1-1.3: SerialNumber: 9423190
[ 1956.029243] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1962.916063] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1963.003605] usb 1-1.3: USB disconnect, device number 64
[ 1963.320847] usb 1-1.3: new full-speed USB device number 65 using xhci_hcd
[ 1963.472298] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1963.472309] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1963.472317] usb 1-1.3: Product: USB Serial
[ 1963.472324] usb 1-1.3: Manufacturer: Teensyduino
[ 1963.472331] usb 1-1.3: SerialNumber: 9423190
[ 1963.474976] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1970.349705] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1970.428733] usb 1-1.3: USB disconnect, device number 65
[ 1970.730660] usb 1-1.3: new full-speed USB device number 66 using xhci_hcd
[ 1970.876141] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1970.876151] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1970.876159] usb 1-1.3: Product: USB Serial
[ 1970.876166] usb 1-1.3: Manufacturer: Teensyduino
[ 1970.876172] usb 1-1.3: SerialNumber: 9423190
[ 1970.878823] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1977.781510] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1977.853777] usb 1-1.3: USB disconnect, device number 66
[ 1978.170466] usb 1-1.3: new full-speed USB device number 67 using xhci_hcd
[ 1978.305875] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1978.305885] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1978.305893] usb 1-1.3: Product: USB Serial
[ 1978.305900] usb 1-1.3: Manufacturer: Teensyduino
[ 1978.305907] usb 1-1.3: SerialNumber: 9423190
[ 1978.308546] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1985.213362] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1985.279052] usb 1-1.3: USB disconnect, device number 67
[ 1985.590252] usb 1-1.3: new full-speed USB device number 68 using xhci_hcd
[ 1985.725733] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1985.725747] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1985.725759] usb 1-1.3: Product: USB Serial
[ 1985.725769] usb 1-1.3: Manufacturer: Teensyduino
[ 1985.725781] usb 1-1.3: SerialNumber: 9423190
[ 1985.728494] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 1992.647104] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 1992.703870] usb 1-1.3: USB disconnect, device number 68
[ 1993.020082] usb 1-1.3: new full-speed USB device number 69 using xhci_hcd
[ 1993.165446] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 1993.165457] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1993.165465] usb 1-1.3: Product: USB Serial
[ 1993.165472] usb 1-1.3: Manufacturer: Teensyduino
[ 1993.165479] usb 1-1.3: SerialNumber: 9423190
[ 1993.168121] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2000.080938] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2000.129064] usb 1-1.3: USB disconnect, device number 69
[ 2000.429811] usb 1-1.3: new full-speed USB device number 70 using xhci_hcd
[ 2000.585167] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2000.585178] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2000.585185] usb 1-1.3: Product: USB Serial
[ 2000.585193] usb 1-1.3: Manufacturer: Teensyduino
[ 2000.585199] usb 1-1.3: SerialNumber: 9423190
[ 2000.587875] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2007.514544] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2007.554186] usb 1-1.3: USB disconnect, device number 70
[ 2007.849601] usb 1-1.3: new full-speed USB device number 71 using xhci_hcd
[ 2007.985032] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2007.985043] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2007.985050] usb 1-1.3: Product: USB Serial
[ 2007.985057] usb 1-1.3: Manufacturer: Teensyduino
[ 2007.985064] usb 1-1.3: SerialNumber: 9423190
[ 2007.987708] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2014.952389] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2014.979546] usb 1-1.3: USB disconnect, device number 71
[ 2015.279363] usb 1-1.3: new full-speed USB device number 72 using xhci_hcd
[ 2015.424744] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2015.424755] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2015.424762] usb 1-1.3: Product: USB Serial
[ 2015.424769] usb 1-1.3: Manufacturer: Teensyduino
[ 2015.424776] usb 1-1.3: SerialNumber: 9423190
[ 2015.427416] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2022.386243] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2022.404444] usb 1-1.3: USB disconnect, device number 72
[ 2022.759118] usb 1-1.3: new full-speed USB device number 73 using xhci_hcd
[ 2022.904599] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2022.904609] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2022.904617] usb 1-1.3: Product: USB Serial
[ 2022.904624] usb 1-1.3: Manufacturer: Teensyduino
[ 2022.904631] usb 1-1.3: SerialNumber: 9423190
[ 2022.907277] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2029.818115] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2030.341508] usb 1-1.3: USB disconnect, device number 73
[ 2030.648869] usb 1-1.3: new full-speed USB device number 74 using xhci_hcd
[ 2030.784267] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2030.784278] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2030.784286] usb 1-1.3: Product: USB Serial
[ 2030.784293] usb 1-1.3: Manufacturer: Teensyduino
[ 2030.784299] usb 1-1.3: SerialNumber: 9423190
[ 2030.786946] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2037.251744] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2037.254540] usb 1-1.3: USB disconnect, device number 74
[ 2037.598634] usb 1-1.3: new full-speed USB device number 75 using xhci_hcd
[ 2037.734047] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2037.734057] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2037.734066] usb 1-1.3: Product: USB Serial
[ 2037.734073] usb 1-1.3: Manufacturer: Teensyduino
[ 2037.734080] usb 1-1.3: SerialNumber: 9423190
[ 2037.736720] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2044.691559] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2044.935672] usb 1-1.3: USB disconnect, device number 75
[ 2045.278360] usb 1-1.3: new full-speed USB device number 76 using xhci_hcd
[ 2045.431813] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2045.431825] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2045.431833] usb 1-1.3: Product: USB Serial
[ 2045.431841] usb 1-1.3: Manufacturer: Teensyduino
[ 2045.431847] usb 1-1.3: SerialNumber: 9423190
[ 2045.434503] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2052.125154] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2052.360791] usb 1-1.3: USB disconnect, device number 76
[ 2052.658119] usb 1-1.3: new full-speed USB device number 77 using xhci_hcd
[ 2052.803529] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2052.803540] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2052.803547] usb 1-1.3: Product: USB Serial
[ 2052.803554] usb 1-1.3: Manufacturer: Teensyduino
[ 2052.803561] usb 1-1.3: SerialNumber: 9423190
[ 2052.808367] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2059.558896] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2059.785882] usb 1-1.3: USB disconnect, device number 77
[ 2060.087968] usb 1-1.3: new full-speed USB device number 78 using xhci_hcd
[ 2060.223254] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2060.223264] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2060.223272] usb 1-1.3: Product: USB Serial
[ 2060.223279] usb 1-1.3: Manufacturer: Teensyduino
[ 2060.223286] usb 1-1.3: SerialNumber: 9423190
[ 2060.226008] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2066.990622] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2067.211186] usb 1-1.3: USB disconnect, device number 78
[ 2067.527579] usb 1-1.3: new full-speed USB device number 79 using xhci_hcd
[ 2067.672982] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2067.672993] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2067.673001] usb 1-1.3: Product: USB Serial
[ 2067.673008] usb 1-1.3: Manufacturer: Teensyduino
[ 2067.673015] usb 1-1.3: SerialNumber: 9423190
[ 2067.675677] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2074.424337] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2074.892259] usb 1-1.3: USB disconnect, device number 79
[ 2075.187297] usb 1-1.3: new full-speed USB device number 80 using xhci_hcd
[ 2075.322741] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2075.322752] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2075.322760] usb 1-1.3: Product: USB Serial
[ 2075.322767] usb 1-1.3: Manufacturer: Teensyduino
[ 2075.322774] usb 1-1.3: SerialNumber: 9423190
[ 2075.325423] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2081.858075] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2082.061449] usb 1-1.3: USB disconnect, device number 80
[ 2082.357019] usb 1-1.3: new full-speed USB device number 81 using xhci_hcd
[ 2082.492444] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2082.492462] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2082.492476] usb 1-1.3: Product: USB Serial
[ 2082.492488] usb 1-1.3: Manufacturer: Teensyduino
[ 2082.492499] usb 1-1.3: SerialNumber: 9423190
[ 2082.495237] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2089.291784] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2089.486344] usb 1-1.3: USB disconnect, device number 81
[ 2089.786783] usb 1-1.3: new full-speed USB device number 82 using xhci_hcd
[ 2089.922416] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2089.922427] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2089.922434] usb 1-1.3: Product: USB Serial
[ 2089.922442] usb 1-1.3: Manufacturer: Teensyduino
[ 2089.922449] usb 1-1.3: SerialNumber: 9423190
[ 2089.925080] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2096.723908] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2096.911494] usb 1-1.3: USB disconnect, device number 82
[ 2097.206451] usb 1-1.3: new full-speed USB device number 83 using xhci_hcd
[ 2097.341878] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2097.341889] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2097.341897] usb 1-1.3: Product: USB Serial
[ 2097.341915] usb 1-1.3: Manufacturer: Teensyduino
[ 2097.341927] usb 1-1.3: SerialNumber: 9423190
[ 2097.344574] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2104.157281] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2104.336571] usb 1-1.3: USB disconnect, device number 83
[ 2104.646158] usb 1-1.3: new full-speed USB device number 84 using xhci_hcd
[ 2104.781606] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2104.781617] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2104.781625] usb 1-1.3: Product: USB Serial
[ 2104.781632] usb 1-1.3: Manufacturer: Teensyduino
[ 2104.781639] usb 1-1.3: SerialNumber: 9423190
[ 2104.784297] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2111.589092] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2111.761652] usb 1-1.3: USB disconnect, device number 84
[ 2112.055894] usb 1-1.3: new full-speed USB device number 85 using xhci_hcd
[ 2112.211214] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2112.211226] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2112.211234] usb 1-1.3: Product: USB Serial
[ 2112.211241] usb 1-1.3: Manufacturer: Teensyduino
[ 2112.211248] usb 1-1.3: SerialNumber: 9423190
[ 2112.213895] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2119.022681] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2119.442832] usb 1-1.3: USB disconnect, device number 85
[ 2119.765542] usb 1-1.3: new full-speed USB device number 86 using xhci_hcd
[ 2119.920976] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2119.920988] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2119.920996] usb 1-1.3: Product: USB Serial
[ 2119.921003] usb 1-1.3: Manufacturer: Teensyduino
[ 2119.921010] usb 1-1.3: SerialNumber: 9423190
[ 2119.923671] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2126.456296] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2126.611763] usb 1-1.3: USB disconnect, device number 86
[ 2126.925257] usb 1-1.3: new full-speed USB device number 87 using xhci_hcd
[ 2127.070664] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2127.070674] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2127.070682] usb 1-1.3: Product: USB Serial
[ 2127.070689] usb 1-1.3: Manufacturer: Teensyduino
[ 2127.070695] usb 1-1.3: SerialNumber: 9423190
[ 2127.073342] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2133.890015] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2134.036925] usb 1-1.3: USB disconnect, device number 87
[ 2134.344952] usb 1-1.3: new full-speed USB device number 88 using xhci_hcd
[ 2134.498406] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2134.498423] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2134.498435] usb 1-1.3: Product: USB Serial
[ 2134.498447] usb 1-1.3: Manufacturer: Teensyduino
[ 2134.498458] usb 1-1.3: SerialNumber: 9423190
[ 2134.503208] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2141.323764] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2141.462199] usb 1-1.3: USB disconnect, device number 88
[ 2141.764646] usb 1-1.3: new full-speed USB device number 89 using xhci_hcd
[ 2141.900108] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2141.900120] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2141.900127] usb 1-1.3: Product: USB Serial
[ 2141.900135] usb 1-1.3: Manufacturer: Teensyduino
[ 2141.900141] usb 1-1.3: SerialNumber: 9423190
[ 2141.902805] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2148.757604] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2148.887080] usb 1-1.3: USB disconnect, device number 89
[ 2149.194350] usb 1-1.3: new full-speed USB device number 90 using xhci_hcd
[ 2149.339713] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2149.339724] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2149.339732] usb 1-1.3: Product: USB Serial
[ 2149.339739] usb 1-1.3: Manufacturer: Teensyduino
[ 2149.339746] usb 1-1.3: SerialNumber: 9423190
[ 2149.342398] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2156.191200] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2156.312308] usb 1-1.3: USB disconnect, device number 90
[ 2156.634003] usb 1-1.3: new full-speed USB device number 91 using xhci_hcd
[ 2156.769439] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2156.769450] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2156.769457] usb 1-1.3: Product: USB Serial
[ 2156.769465] usb 1-1.3: Manufacturer: Teensyduino
[ 2156.769471] usb 1-1.3: SerialNumber: 9423190
[ 2156.774209] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2163.626803] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2163.737397] usb 1-1.3: USB disconnect, device number 91
[ 2164.043722] usb 1-1.3: new full-speed USB device number 92 using xhci_hcd
[ 2164.179041] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2164.179053] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2164.179061] usb 1-1.3: Product: USB Serial
[ 2164.179068] usb 1-1.3: Manufacturer: Teensyduino
[ 2164.179075] usb 1-1.3: SerialNumber: 9423190
[ 2164.181724] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2171.058536] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2171.162467] usb 1-1.3: USB disconnect, device number 92
[ 2171.493368] usb 1-1.3: new full-speed USB device number 93 using xhci_hcd
[ 2171.628767] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2171.628778] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2171.628786] usb 1-1.3: Product: USB Serial
[ 2171.628793] usb 1-1.3: Manufacturer: Teensyduino
[ 2171.628799] usb 1-1.3: SerialNumber: 9423190
[ 2171.631444] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2178.490382] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2178.587603] usb 1-1.3: USB disconnect, device number 93
[ 2178.893039] usb 1-1.3: new full-speed USB device number 94 using xhci_hcd
[ 2179.028488] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2179.028499] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2179.028507] usb 1-1.3: Product: USB Serial
[ 2179.028514] usb 1-1.3: Manufacturer: Teensyduino
[ 2179.028521] usb 1-1.3: SerialNumber: 9423190
[ 2179.031184] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2185.925856] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2186.012660] usb 1-1.3: USB disconnect, device number 94
[ 2186.312715] usb 1-1.3: new full-speed USB device number 95 using xhci_hcd
[ 2186.458090] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2186.458101] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2186.458109] usb 1-1.3: Product: USB Serial
[ 2186.458116] usb 1-1.3: Manufacturer: Teensyduino
[ 2186.458123] usb 1-1.3: SerialNumber: 9423190
[ 2186.460766] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2193.357711] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2193.693905] usb 1-1.3: USB disconnect, device number 95
[ 2193.992350] usb 1-1.3: new full-speed USB device number 96 using xhci_hcd
[ 2194.127727] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2194.127738] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2194.127746] usb 1-1.3: Product: USB Serial
[ 2194.127753] usb 1-1.3: Manufacturer: Teensyduino
[ 2194.127759] usb 1-1.3: SerialNumber: 9423190
[ 2194.130419] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2200.791071] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2200.862813] usb 1-1.3: USB disconnect, device number 96
[ 2201.162065] usb 1-1.3: new full-speed USB device number 97 using xhci_hcd
[ 2201.307419] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2201.307430] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2201.307437] usb 1-1.3: Product: USB Serial
[ 2201.307445] usb 1-1.3: Manufacturer: Teensyduino
[ 2201.307451] usb 1-1.3: SerialNumber: 9423190
[ 2201.310113] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2208.224805] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2208.288057] usb 1-1.3: USB disconnect, device number 97
[ 2208.581693] usb 1-1.3: new full-speed USB device number 98 using xhci_hcd
[ 2208.717141] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2208.717151] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2208.717159] usb 1-1.3: Product: USB Serial
[ 2208.717167] usb 1-1.3: Manufacturer: Teensyduino
[ 2208.717174] usb 1-1.3: SerialNumber: 9423190
[ 2208.719843] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2215.656523] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2215.969242] usb 1-1.3: USB disconnect, device number 98
[ 2216.271330] usb 1-1.3: new full-speed USB device number 99 using xhci_hcd
[ 2216.406781] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2216.406792] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2216.406800] usb 1-1.3: Product: USB Serial
[ 2216.406807] usb 1-1.3: Manufacturer: Teensyduino
[ 2216.406814] usb 1-1.3: SerialNumber: 9423190
[ 2216.409508] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2223.090145] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2223.138137] usb 1-1.3: USB disconnect, device number 99
[ 2223.441030] usb 1-1.3: new full-speed USB device number 100 using xhci_hcd
[ 2223.586348] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2223.586360] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2223.586367] usb 1-1.3: Product: USB Serial
[ 2223.586374] usb 1-1.3: Manufacturer: Teensyduino
[ 2223.586381] usb 1-1.3: SerialNumber: 9423190
[ 2223.589025] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2230.521862] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2230.563334] usb 1-1.3: USB disconnect, device number 100
[ 2230.860647] usb 1-1.3: new full-speed USB device number 101 using xhci_hcd
[ 2231.006073] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2231.006083] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2231.006091] usb 1-1.3: Product: USB Serial
[ 2231.006098] usb 1-1.3: Manufacturer: Teensyduino
[ 2231.006105] usb 1-1.3: SerialNumber: 9423190
[ 2231.008742] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2237.955453] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2237.988300] usb 1-1.3: USB disconnect, device number 101
[ 2238.300303] usb 1-1.3: new full-speed USB device number 102 using xhci_hcd
[ 2238.455729] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2238.455739] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2238.455746] usb 1-1.3: Product: USB Serial
[ 2238.455753] usb 1-1.3: Manufacturer: Teensyduino
[ 2238.455760] usb 1-1.3: SerialNumber: 9423190
[ 2238.458460] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2245.389067] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2245.418707] usb 1-1.3: USB disconnect, device number 102
[ 2245.719951] usb 1-1.3: new full-speed USB device number 103 using xhci_hcd
[ 2245.855524] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2245.855535] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2245.855543] usb 1-1.3: Product: USB Serial
[ 2245.855550] usb 1-1.3: Manufacturer: Teensyduino
[ 2245.855557] usb 1-1.3: SerialNumber: 9423190
[ 2245.858196] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2252.825027] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2252.838582] usb 1-1.3: USB disconnect, device number 103
[ 2253.209603] usb 1-1.3: new full-speed USB device number 104 using xhci_hcd
[ 2253.345009] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2253.345020] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2253.345027] usb 1-1.3: Product: USB Serial
[ 2253.345034] usb 1-1.3: Manufacturer: Teensyduino
[ 2253.345041] usb 1-1.3: SerialNumber: 9423190
[ 2253.347704] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2260.256424] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2260.263670] usb 1-1.3: USB disconnect, device number 104
[ 2260.619245] usb 1-1.3: new full-speed USB device number 105 using xhci_hcd
[ 2260.774609] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2260.774620] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2260.774627] usb 1-1.3: Product: USB Serial
[ 2260.774634] usb 1-1.3: Manufacturer: Teensyduino
[ 2260.774641] usb 1-1.3: SerialNumber: 9423190
[ 2260.777306] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2267.689982] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2267.944812] usb 1-1.3: USB disconnect, device number 105
[ 2268.238871] usb 1-1.3: new full-speed USB device number 106 using xhci_hcd
[ 2268.374238] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2268.374249] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2268.374257] usb 1-1.3: Product: USB Serial
[ 2268.374264] usb 1-1.3: Manufacturer: Teensyduino
[ 2268.374271] usb 1-1.3: SerialNumber: 9423190
[ 2268.384941] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[ 2275.121582] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[ 2275.369929] usb 1-1.3: USB disconnect, device number 106
[ 2275.678505] usb 1-1.3: new full-speed USB device number 107 using xhci_hcd
[ 2275.813841] usb 1-1.3: New USB device found, idVendor=16c0, idProduct=0483, bcdDevice= 2.73
[ 2275.813852] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2275.813860] usb 1-1.3: Product: USB Serial
[ 2275.813867] usb 1-1.3: Manufacturer: Teensyduino
[ 2275.813873] usb 1-1.3: SerialNumber: 9423190
[ 2275.830567] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device

View attachment haunted-usb-2.zip
 
Ah ha!

usb_dev.c
Code:
// This code has a known bug with compiled with -O2 optimization on gcc 5.4.1
// https://forum.pjrc.com/threads/53574-Teensyduino-1-43-Beta-2?p=186177&viewfull=1#post186177
#if defined(__MKL26Z64__)
#pragma GCC optimize ("Os")
#else
#pragma GCC optimize ("O3")
#endif

This was overriding my optimization settings. I thought I had ruled out compiler bugs by compiling Optimization=Debug, but that pragma was forcing O3 every time.

When I remove the pragma and recompile Debug, the bug does not appear. This suggests a possible compiler bug.

I will investigate the code gen some this evening.
 
OK, I believe I know what's going on. At -O2, the compiler is re-ordering assignments to bdt_t.addr and bdt_t.desc. If we're unlucky, the USB engine grabs the bdt_t between writes and gets the old bdt_t.addr before we can update it. Interrupts are off, but that won't save us because we're in a race with DMA hardware, not interrupt code.

I think this reordering is allowed, since bdt_t is not declared volatile.

BTW, today was the first time I have looked at ARM assembly. Please double-check my work. In particular, am I correct about the highlighted str.w instructions being the bdt_t.desc store?

Compiled with Optimize=Faster.

Original usb_rx_memory()
Code:
00000000 <usb_rx_memory>:
   0:	b4f0      	push	{r4, r5, r6, r7}
   2:	b672      	cpsid	i
   4:	491a      	ldr	r1, [pc, #104]	; (70 <usb_rx_memory+0x70>)
   6:	4e1b      	ldr	r6, [pc, #108]	; (74 <usb_rx_memory+0x74>)
   8:	2301      	movs	r3, #1
   a:	f811 4b01 	ldrb.w	r4, [r1], #1
   e:	4f19      	ldr	r7, [pc, #100]	; (74 <usb_rx_memory+0x74>)
  10:	009a      	lsls	r2, r3, #2
  12:	0724      	lsls	r4, r4, #28
  14:	f042 0501 	orr.w	r5, r2, #1
  18:	d505      	bpl.n	26 <usb_rx_memory+0x26>
  1a:	f856 4032 	ldr.w	r4, [r6, r2, lsl #3]
  1e:	b164      	cbz	r4, 3a <usb_rx_memory+0x3a>
  20:	f856 2035 	ldr.w	r2, [r6, r5, lsl #3]
  24:	b1ba      	cbz	r2, 56 <usb_rx_memory+0x56>
  26:	3301      	adds	r3, #1
  28:	2b05      	cmp	r3, #5
  2a:	d1ee      	bne.n	a <usb_rx_memory+0xa>
  2c:	b662      	cpsie	i
  2e:	4b12      	ldr	r3, [pc, #72]	; (78 <usb_rx_memory+0x78>)
  30:	2200      	movs	r2, #0
  32:	701a      	strb	r2, [r3, #0]
  34:	bcf0      	pop	{r4, r5, r6, r7}
  36:	f7ff bffe 	b.w	0 <usb_free>
  3a:	4c0f      	ldr	r4, [pc, #60]	; (78 <usb_rx_memory+0x78>)
  3c:	4d0f      	ldr	r5, [pc, #60]	; (7c <usb_rx_memory+0x7c>)
  3e:	7821      	ldrb	r1, [r4, #0]


[COLOR="#FF0000"]  40:	f847 5032 	str.w	r5, [r7, r2, lsl #3]  // bdt_t.desc = BDT_DESC(...);[/COLOR]
  44:	eb07 1343 	add.w	r3, r7, r3, lsl #5      r3 = r7 + (r3 * 32)
  48:	3008      	adds	r0, #8
  4a:	1e4a      	subs	r2, r1, #1
[COLOR="#FF0000"]  4c:	6058      	str	r0, [r3, #4]  // bdt_t.addr = packet->buf;[/COLOR]
  4e:	7022      	strb	r2, [r4, #0]


  50:	b662      	cpsie	i
  52:	bcf0      	pop	{r4, r5, r6, r7}
  54:	4770      	bx	lr
  56:	4908      	ldr	r1, [pc, #32]	; (78 <usb_rx_memory+0x78>)
  58:	4b09      	ldr	r3, [pc, #36]	; (80 <usb_rx_memory+0x80>)
  5a:	780a      	ldrb	r2, [r1, #0]
  5c:	f847 3035 	str.w	r3, [r7, r5, lsl #3]
  60:	eb07 03c5 	add.w	r3, r7, r5, lsl #3
  64:	3008      	adds	r0, #8
  66:	3a01      	subs	r2, #1
  68:	6058      	str	r0, [r3, #4]
  6a:	700a      	strb	r2, [r1, #0]
  6c:	b662      	cpsie	i
  6e:	e7f0      	b.n	52 <usb_rx_memory+0x52>
	...
  7c:	00400088 	.word	0x00400088
  80:	004000c8 	.word	0x004000c8



Working usb_rx_memory() with packet->buf[0] = 'E'
Code:
00000000 <usb_rx_memory>:
   0:	b4f0      	push	{r4, r5, r6, r7}
   2:	b672      	cpsid	i
   4:	491c      	ldr	r1, [pc, #112]	; (78 <usb_rx_memory+0x78>)
   6:	4e1d      	ldr	r6, [pc, #116]	; (7c <usb_rx_memory+0x7c>)
   8:	2301      	movs	r3, #1
   a:	f811 4b01 	ldrb.w	r4, [r1], #1
   e:	4f1b      	ldr	r7, [pc, #108]	; (7c <usb_rx_memory+0x7c>)
  10:	009a      	lsls	r2, r3, #2
  12:	0724      	lsls	r4, r4, #28
  14:	f042 0501 	orr.w	r5, r2, #1
  18:	d505      	bpl.n	26 <usb_rx_memory+0x26>
  1a:	f856 4032 	ldr.w	r4, [r6, r2, lsl #3]
  1e:	b164      	cbz	r4, 3a <usb_rx_memory+0x3a>
  20:	f856 2035 	ldr.w	r2, [r6, r5, lsl #3]
  24:	b1ca      	cbz	r2, 5a <usb_rx_memory+0x5a>
  26:	3301      	adds	r3, #1
  28:	2b05      	cmp	r3, #5
  2a:	d1ee      	bne.n	a <usb_rx_memory+0xa>
  2c:	b662      	cpsie	i
  2e:	4b14      	ldr	r3, [pc, #80]	; (80 <usb_rx_memory+0x80>)
  30:	2200      	movs	r2, #0
  32:	701a      	strb	r2, [r3, #0]
  34:	bcf0      	pop	{r4, r5, r6, r7}
  36:	f7ff bffe 	b.w	0 <usb_free>
  3a:	4c11      	ldr	r4, [pc, #68]	; (80 <usb_rx_memory+0x80>)
  3c:	4d11      	ldr	r5, [pc, #68]	; (84 <usb_rx_memory+0x84>)
  3e:	7821      	ldrb	r1, [r4, #0]


  40:	2645      	movs	r6, #69	; 0x45
  42:	f800 6f08 	strb.w	r6, [r0, #8]! // packet->buf[0] = 'E';
  46:	eb07 1343 	add.w	r3, r7, r3, lsl #5
  4a:	3901      	subs	r1, #1
[COLOR="#00C000"]  4c:	6058      	str	r0, [r3, #4]  // bdt_t.addr = packet->buf;[/COLOR]
  4e:	7021      	strb	r1, [r4, #0]
[COLOR="#00C000"]  50:	f847 5032 	str.w	r5, [r7, r2, lsl #3]  // bdt_t.desc = BDT_DESC(...);[/COLOR]


  54:	b662      	cpsie	i
  56:	bcf0      	pop	{r4, r5, r6, r7}
  58:	4770      	bx	lr
  5a:	4a09      	ldr	r2, [pc, #36]	; (80 <usb_rx_memory+0x80>)
  5c:	490a      	ldr	r1, [pc, #40]	; (88 <usb_rx_memory+0x88>)
  5e:	7813      	ldrb	r3, [r2, #0]
  60:	244f      	movs	r4, #79	; 0x4f
  62:	f800 4f08 	strb.w	r4, [r0, #8]!
  66:	eb07 04c5 	add.w	r4, r7, r5, lsl #3
  6a:	3b01      	subs	r3, #1
  6c:	6060      	str	r0, [r4, #4]
  6e:	7013      	strb	r3, [r2, #0]
  70:	f847 1035 	str.w	r1, [r7, r5, lsl #3]
  74:	b662      	cpsie	i
  76:	e7ee      	b.n	56 <usb_rx_memory+0x56>
	...
  84:	00400088 	.word	0x00400088
  88:	004000c8 	.word	0x004000c8


And the Fix
It's a lot less inscrutable this time around:
- declare bdt_t type volatile
- drop the optimization pragmas

Apply volatile to the type, not the static array because we access table[] through pointers, as well as directly.

Code:
// This code has a known bug with compiled with -O2 optimization on gcc 5.4.1
// https://forum.pjrc.com/threads/53574-Teensyduino-1-43-Beta-2?p=186177&viewfull=1#post186177
[COLOR="#FF0000"]-#if defined(__MKL26Z64__)
-#pragma GCC optimize ("Os")
-#else
-#pragma GCC optimize ("O3")
-#endif
[/COLOR]
// buffer descriptor table

typedef [COLOR="#00C000"][B]volatile[/B][/COLOR] struct {
	uint32_t desc;
	void * addr;
} bdt_t;

__attribute__ ((section(".usbdescriptortable"), used))
static bdt_t table[(NUM_ENDPOINTS+1)*4];

This change seems to fix the problem at -O2, -O3, and -Os.

Someone more familiar with the library code should check for similar errors elsewhere. I did not look outside usb_rx_memory().
 
Last edited:
I'm also having 'haunted usb' issues.
Specifically both serial and audio are being periodically corrupted when transmitted from a Raspberry Pi to a Teensy 4.0
I haven't been able to recreate the issue on Windows, but I also can't guarantee it's not there.

I'm also using platformio, which doesn't have support for beta-10
If I try with beta-12 by editing platformio.ini:

Code:
[env:teensy40]
platform = teensy
board = teensy40
framework = arduino
build_flags = -DUSB_MIDI_AUDIO_SERIAL
lib_deps = 
    msgpack-arduino
platform_packages = 
    framework-arduinoteensy@https://github.com/maxgerhardt/teensy-core-pio-package#1.54-beta9

Then I receive many build errors:

Code:
> Executing task: C:\Users\elliot\.platformio\penv\Scripts\platformio.exe run <

Processing teensy40 (platform: teensy; board: teensy40; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/teensy/teensy40.html
PLATFORM: Teensy (4.15.0) > Teensy 4.0
HARDWARE: IMXRT1062 600MHz, 512KB RAM, 1.94MB Flash
DEBUG: Current (jlink) External (jlink)
PACKAGES:
 - framework-arduinoteensy 1.154.0-beta9+sha.d704f75
 - tool-teensy 1.155.0 (1.55)
 - toolchain-gccarmnoneeabi 1.50401.190816 (5.4.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 3 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <msgpack-arduino>
|-- <PacketIO> 0.3.0
Building in release mode
Compiling .pio\build\teensy40\src\App.cpp.o
Compiling .pio\build\teensy40\src\main.cpp.o
Compiling .pio\build\teensy40\src\modules\Audio\AudioInputDoubleBuffer.cpp.o
Compiling .pio\build\teensy40\src\modules\Device.cpp.o
Compiling .pio\build\teensy40\src\modules\Projection.cpp.o
Compiling .pio\build\teensy40\src\modules\TCM.cpp.o
Compiling .pio\build\teensy40\src\modules\play_mem_la.cpp.o
Compiling .pio\build\teensy40\liba0b\msgpack-arduino\msgpack\COBSRWStream.cpp.o
Compiling .pio\build\teensy40\liba0b\msgpack-arduino\msgpack\Messaging.cpp.o
Compiling .pio\build\teensy40\liba0b\msgpack-arduino\msgpack\Serializer.cpp.o
Compiling .pio\build\teensy40\liba0b\msgpack-arduino\msgpack\deserialize.cpp.o
Compiling .pio\build\teensy40\liba0b\msgpack-arduino\msgpack\logError.cpp.o
In file included from lib\msgpack-arduino\src/msgpack/Platform.h:3:0,
                 from lib\msgpack-arduino\src/msgpack/serialize.hpp:3,
                 from lib\msgpack-arduino\src/msgpack.hpp:3,
                 from src\modules/Projection.h:5,
                 from src\App.h:1,
                 from src\App.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.hCompiling .pio\build\teensy40\liba0b\msgpack-arduino\msgpack\serialize.cpp.o       

*
******************************************************************

compilation terminated.
src\main.cpp:1:19: fatal error: Audio.h: No such file or directory

***************************************************************
* Looking for Audio.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Audio.h"
* Web  > https://registry.platformio.org/search?q=header:Audio.h
*
***************************************************************

compilation terminated.
In file included from src\modules\Audio\AudioInputDoubleBuffer.h:3:0,
                 from src\modules\Audio\AudioInputDoubleBuffer.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\AudioStream.cpp.o
In file included from lib\msgpack-arduino\src/msgpack/Platform.h:3:0,
                 from lib\msgpack-arduino\src/msgpack/serialize.hpp:3,
                 from lib\msgpack-arduino\src/msgpack.hpp:3,
                 from src\modules\TCM.h:5,
                 from src\modules\Device.h:3,
                 from src\modules\Device.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from src\modules\TCM.cpp:1:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from src\modules\play_mem_la.cpp:1:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\EventResponder.cpp.o
src\modules\Projection.cpp:1:18: fatal error: Wire.h: No such file or directory

**************************************************************
* Looking for Wire.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Wire.h"
* Web  > https://registry.platformio.org/search?q=header:Wire.h
*
**************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial1.cpp.o
In file included from lib\msgpack-arduino\src\msgpack\Platform.h:3:0,
                 from lib\msgpack-arduino\src\msgpack\COBSRWStream.hpp:4,
                 from lib\msgpack-arduino\src\msgpack\COBSRWStream.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial2.cpp.o
compilation terminated.
In file included from lib\msgpack-arduino\src\msgpack\Platform.h:3:0,
                 from lib\msgpack-arduino\src\msgpack\Messaging.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\Messaging.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial3.cpp.o
In file included from lib\msgpack-arduino\src\msgpack\Platform.h:3:0,
                 from lib\msgpack-arduino\src\msgpack\serialize.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\Serializer.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\Serializer.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial4.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial5.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial6.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial7.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\HardwareSerial8.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\IPAddress.cpp.o
Compiling .pio\build\teensy40\FrameworkArduino\Print.cpp.o
In file included from lib\msgpack-arduino\src\msgpack\Platform.h:3:0,
                 from lib\msgpack-arduino\src\msgpack\serialize.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\serialize.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for Compiling .pio\build\teensy40\FrameworkArduino\clockspeed.c.o
WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from lib\msgpack-arduino\src\msgpack\Platform.h:3:0,
                 from lib\msgpack-arduino\src\msgpack\deserialize.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\deserialize.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from lib\msgpack-arduino\src\msgpack\Platform.h:3:0,
                 from lib\msgpack-arduino\src\msgpack\serialize.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\Serializer.hpp:3,
                 from lib\msgpack-arduino\src\msgpack\logError.hpp:2,
                 from lib\msgpack-arduino\src\msgpack\logError.cpp:1:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\AudioStream.cpp:32:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial1.cpp:32:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial.h:115:20: fatal error: Stream.h: No such file or directory  

****************************************************************
* Looking for Stream.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:Stream.h"
* Web  > https://registry.platformio.org/search?q=header:Stream.h
*
****************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\extmem.c.o
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\EventResponder.cpp:34:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > Compiling .pio\build\teensy40\FrameworkArduino\interrupt.c.o
https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
Compiling .pio\build\teensy40\FrameworkArduino\keylayouts.c.o
Compiling .pio\build\teensy40\FrameworkArduino\main.cpp.o
*** [.pio\build\teensy40\src\App.cpp.o] Error 1
Compiling .pio\build\teensy40\FrameworkArduino\memcpy-armv7m.S.o
*** [.pio\build\teensy40\src\main.cpp.o] Error 1
*** [.pio\build\teensy40\src\modules\Audio\AudioInputDoubleBuffer.cpp.o] Error 1
*** [.pio\build\teensy40\src\modules\Device.cpp.o] Error 1
*** [.pio\build\teensy40\src\modules\TCM.cpp.o] Error 1
*** [.pio\build\teensy40\src\modules\play_mem_la.cpp.o] Error 1
*** [.pio\build\teensy40\src\modules\Projection.cpp.o] Error 1
*** [.pio\build\teensy40\liba0b\msgpack-arduino\msgpack\COBSRWStream.cpp.o] Error 1
*** [.pio\build\teensy40\liba0b\msgpack-arduino\msgpack\Messaging.cpp.o] Error 1
*** [.pio\build\teensy40\liba0b\msgpack-arduino\msgpack\Serializer.cpp.o] Error 1
*** [.pio\build\teensy40\liba0b\msgpack-arduino\msgpack\logError.cpp.o] Error 1
*** [.pio\build\teensy40\liba0b\msgpack-arduino\msgpack\deserialize.cpp.o] Error 1
*** [.pio\build\teensy40\liba0b\msgpack-arduino\msgpack\serialize.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\AudioStream.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial1.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\EventResponder.cpp.o] Error 1
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial7.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial4.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial6.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial3.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial5.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial8.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\HardwareSerial2.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial7.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial4.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial6.cpp.o] Error 1
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\Print.cpp:37:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\IPAddress.cpp:20:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial3.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial5.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial8.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\HardwareSerial2.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\Print.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\IPAddress.cpp.o] Error 1
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\extmem.c:5:21: fatal error: smalloc.h: No such file or directory

*****************************************************************
* Looking for smalloc.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:smalloc.h"
* Web  > https://registry.platformio.org/search?q=header:smalloc.h
*
*****************************************************************

compilation terminated.
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\clockspeed.c:3:20: fatal error: wiring.h: No such file or directory        

****************************************************************
* Looking for wiring.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:wiring.h"
* Web  > https://registry.platformio.org/search?q=header:wiring.h
*
****************************************************************

compilation terminated.
*** [.pio\build\teensy40\FrameworkArduino\extmem.c.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\clockspeed.c.o] Error 1
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\interrupt.c:1:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
In file included from C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4\main.cpp:31:0:
C:\Users\elliot\.platformio\packages\framework-arduinoteensy\cores\teensy4/Arduino.h:6:22: fatal error: WProgram.h: No such file or directory

******************************************************************
* Looking for WProgram.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:WProgram.h"
* Web  > https://registry.platformio.org/search?q=header:WProgram.h
*
******************************************************************

compilation terminated.
*** [.pio\build\teensy40\FrameworkArduino\main.cpp.o] Error 1
*** [.pio\build\teensy40\FrameworkArduino\interrupt.c.o] Error 1
============================================================= [FAILED] Took 1.02 seconds =============================================================The terminal process "C:\Users\elliot\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

I have errors both in transmitting RPi -> Teensy and Teensy -> RPi
When I compare messages to what I'm getting on Windows machine (baseline working), I see missing bytes in the stream between the RPi and the Teensy (so far only checked when receiving Teensy -> RPi).
This may be a different error, and if so, apologies if I'm distracting from the error above.

Elliot
 
For the time being, my issues seems to go away after:

1. Adding the udev rules (it took me a while to find that)
2. Manually closing the serial port when my app closes (not sure if this makes a difference)

Code:
/etc/udev/rules.d
sudo wget https://www.pjrc.com/teensy/00-teensy.rules
 
Back
Top