Skip to content

Instantly share code, notes, and snippets.

@Hylian
Created December 29, 2023 23:37
Show Gist options
  • Save Hylian/71d6e1c30b70c1a6d23671729d0b2865 to your computer and use it in GitHub Desktop.
Save Hylian/71d6e1c30b70c1a6d23671729d0b2865 to your computer and use it in GitHub Desktop.
Sensor Watch CDC Write Stress Test Results
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 512
// 0 ms delay
// Result: Fails at 31
swsh> stress 100
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 123456789012345678901234567
28: 1234567890123456789012345678
29: 12345678901234567890123456789
30: 123456789012345678901234567890
31: 37: 1234567890123456789012345678901234567
38: 1234567890123456749: 1234567890123456789012345678901234567890123456789
50: 1234560: 12345678901234567890123456789012345678901234567890123456789072: 12345678901234567890123456789012345678901234567890123456789083: 12345678901234567890123456789012345678901234567890123456789094: 12345678901234567890123456789012345678901234567890120
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 512
// 1 ms delay
// Result: Fails at 43
swsh> stress 100 1
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 123456789012345678901234567
28: 1234567890123456789012345678
29: 12345678901234567890123456789
30: 123456789012345678901234567890
31: 1234567890123456789012345678901
32: 12345678901234567890123456789012
33: 123456789012345678901234567890123
34: 1234567890123456789012345678901234
35: 12345678901234567890123456789012345
36: 123456789012345678901234567890123456
37: 1234567890123456789012345678901234567
38: 12345678901234567890123456789012345678
39: 123456789012345678901234567890123456789
42: 123456789012345678901234567890123456789012
43: 12345678901246: 1234567890123456789012345678901234567890123456
47: 1234567850: 12345678901234567890123456789012345678901234567890
51: 123454: 123456789012345678901234567890123456789012345678901234
55: 58: 1234567890123456789012345678901234567890123456789012345678
62: 12345678901234567890123456789012345678901234567890123456789066: 12345678901234567890123456789012345678901234567890123456789070: 12345678901234567890123456789012345678901234567890123456789074: 12345678901234567890123456789012345678901234567890123456789078: 12340
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 512
// 1 ms delay
// Result: Pass
swsh> stress 100 10
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 123456789012345678901234567
28: 1234567890123456789012345678
29: 12345678901234567890123456789
30: 123456789012345678901234567890
31: 1234567890123456789012345678901
32: 12345678901234567890123456789012
33: 123456789012345678901234567890123
34: 1234567890123456789012345678901234
35: 12345678901234567890123456789012345
36: 123456789012345678901234567890123456
37: 1234567890123456789012345678901234567
38: 12345678901234567890123456789012345678
39: 123456789012345678901234567890123456789
40: 1234567890123456789012345678901234567890
41: 12345678901234567890123456789012345678901
42: 123456789012345678901234567890123456789012
43: 1234567890123456789012345678901234567890123
44: 12345678901234567890123456789012345678901234
45: 123456789012345678901234567890123456789012345
46: 1234567890123456789012345678901234567890123456
47: 12345678901234567890123456789012345678901234567
48: 123456789012345678901234567890123456789012345678
49: 1234567890123456789012345678901234567890123456789
50: 12345678901234567890123456789012345678901234567890
51: 123456789012345678901234567890123456789012345678901
52: 1234567890123456789012345678901234567890123456789012
53: 12345678901234567890123456789012345678901234567890123
54: 123456789012345678901234567890123456789012345678901234
55: 1234567890123456789012345678901234567890123456789012345
56: 12345678901234567890123456789012345678901234567890123456
57: 123456789012345678901234567890123456789012345678901234567
58: 1234567890123456789012345678901234567890123456789012345678
59: 12345678901234567890123456789012345678901234567890123456789
60: 123456789012345678901234567890123456789012345678901234567890
61: 1234567890123456789012345678901234567890123456789012345678901
62: 12345678901234567890123456789012345678901234567890123456789012
63: 123456789012345678901234567890123456789012345678901234567890123
64: 1234567890123456789012345678901234567890123456789012345678901234
65: 12345678901234567890123456789012345678901234567890123456789012345
66: 123456789012345678901234567890123456789012345678901234567890123456
67: 1234567890123456789012345678901234567890123456789012345678901234567
68: 12345678901234567890123456789012345678901234567890123456789012345678
69: 123456789012345678901234567890123456789012345678901234567890123456789
70: 1234567890123456789012345678901234567890123456789012345678901234567890
71: 12345678901234567890123456789012345678901234567890123456789012345678901
72: 123456789012345678901234567890123456789012345678901234567890123456789012
73: 1234567890123456789012345678901234567890123456789012345678901234567890123
74: 12345678901234567890123456789012345678901234567890123456789012345678901234
75: 123456789012345678901234567890123456789012345678901234567890123456789012345
76: 1234567890123456789012345678901234567890123456789012345678901234567890123456
77: 12345678901234567890123456789012345678901234567890123456789012345678901234567
78: 123456789012345678901234567890123456789012345678901234567890123456789012345678
79: 1234567890123456789012345678901234567890123456789012345678901234567890123456789
80: 12345678901234567890123456789012345678901234567890123456789012345678901234567890
81: 123456789012345678901234567890123456789012345678901234567890123456789012345678901
82: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012
83: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123
84: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234
85: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345
86: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456
87: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
88: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
89: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
90: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
91: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
92: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
93: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
94: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234
95: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
96: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
97: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
98: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
99: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
100: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 64
// 0 ms delay
// Result: Fails at 8
swsh> stress 100 0
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
813: 1234567890123
14: 12345678901234
15: 123456789012345
16: 25: 1234567890123456789012345
26: 12345678901234567890123456
237: 1234567890123456789012345678901234567
38: 1234567890123456749: 1234567890123456789012345678901234567890123456789
50: 1234560: 12345678901234567890123456789012345678901234567890123456789071: 1234567890123456789012345678901234567890123450
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 64
// 1 ms delay
// Result: Fails at 13
swsh> stress 100 1
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 12345678914: 12345678901234
15: 123456789012345
16: 1234567890123456
118: 123456789012345678
19: 1234567890123456789
20: 1234567890122: 1234567890123456789012
23: 12345678901234567890123
24: 12326: 12345678901234567890123456
30: 123456789012345678901234567890
31: 12345678901234567890123434: 1234567890123456789012345678901234
35: 1234567890123456789038: 12345678901234567890123456789012345678
39: 123456789012345642: 123456789012345678901234567890123456789012
43: 12345678901246: 1234567890123456789012345678901234567890123456
47: 1234567850: 12345678901234567890123456789012345678901234567890
51: 123454: 123456789012345678901234567890123456789012345678901234
55: 58: 1234567890123456789012345678901234567890123456789012345678
62: 12345678901234567890123456789012345678901234567890123456789066: 12345678901234567890123456789012345678901234567890123456789070
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 64
// 10 ms delay
// Result: Fails at 60
swsh> stress 100 10
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 123456789012345678901234567
28: 1234567890123456789012345678
29: 12345678901234567890123456789
30: 123456789012345678901234567890
31: 1234567890123456789012345678901
32: 12345678901234567890123456789012
33: 123456789012345678901234567890123
34: 1234567890123456789012345678901234
35: 12345678901234567890123456789012345
36: 123456789012345678901234567890123456
37: 1234567890123456789012345678901234567
38: 12345678901234567890123456789012345678
39: 123456789012345678901234567890123456789
40: 1234567890123456789012345678901234567890
41: 12345678901234567890123456789012345678901
42: 123456789012345678901234567890123456789012
43: 1234567890123456789012345678901234567890123
44: 12345678901234567890123456789012345678901234
45: 123456789012345678901234567890123456789012345
46: 1234567890123456789012345678901234567890123456
47: 12345678901234567890123456789012345678901234567
48: 123456789012345678901234567890123456789012345678
49: 1234567890123456789012345678901234567890123456789
50: 12345678901234567890123456789012345678901234567890
51: 123456789012345678901234567890123456789012345678901
52: 1234567890123456789012345678901234567890123456789012
53: 12345678901234567890123456789012345678901234567890123
54: 123456789012345678901234567890123456789012345678901234
55: 1234567890123456789012345678901234567890123456789012345
56: 12345678901234567890123456789012345678901234567890123456
57: 123456789012345678901234567890123456789012345678901234567
58: 1234567890123456789012345678901234567890123456789012345678
59: 12345678901234567890123456789012345678901234567890123456789
60: 12345678901234567890123456789012345678901234567890123456789061: 12345678901234567890123456789012345678901234567890123456789069
// Direct TUD Write
// CFG_TUD_CDC_TX_BUFSIZE = 64
// 20 ms delay
// Result: Pass
swsh> stress 100 20
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 123456789012345678901234567
28: 1234567890123456789012345678
29: 12345678901234567890123456789
30: 123456789012345678901234567890
31: 1234567890123456789012345678901
32: 12345678901234567890123456789012
33: 123456789012345678901234567890123
34: 1234567890123456789012345678901234
35: 12345678901234567890123456789012345
36: 123456789012345678901234567890123456
37: 1234567890123456789012345678901234567
38: 12345678901234567890123456789012345678
39: 123456789012345678901234567890123456789
40: 1234567890123456789012345678901234567890
41: 12345678901234567890123456789012345678901
42: 123456789012345678901234567890123456789012
43: 1234567890123456789012345678901234567890123
44: 12345678901234567890123456789012345678901234
45: 123456789012345678901234567890123456789012345
46: 1234567890123456789012345678901234567890123456
47: 12345678901234567890123456789012345678901234567
48: 123456789012345678901234567890123456789012345678
49: 1234567890123456789012345678901234567890123456789
50: 12345678901234567890123456789012345678901234567890
51: 123456789012345678901234567890123456789012345678901
52: 1234567890123456789012345678901234567890123456789012
53: 12345678901234567890123456789012345678901234567890123
54: 123456789012345678901234567890123456789012345678901234
55: 1234567890123456789012345678901234567890123456789012345
56: 12345678901234567890123456789012345678901234567890123456
57: 123456789012345678901234567890123456789012345678901234567
58: 1234567890123456789012345678901234567890123456789012345678
59: 12345678901234567890123456789012345678901234567890123456789
60: 123456789012345678901234567890123456789012345678901234567890
61: 1234567890123456789012345678901234567890123456789012345678901
62: 12345678901234567890123456789012345678901234567890123456789012
63: 123456789012345678901234567890123456789012345678901234567890123
64: 1234567890123456789012345678901234567890123456789012345678901234
65: 12345678901234567890123456789012345678901234567890123456789012345
66: 123456789012345678901234567890123456789012345678901234567890123456
67: 1234567890123456789012345678901234567890123456789012345678901234567
68: 12345678901234567890123456789012345678901234567890123456789012345678
69: 123456789012345678901234567890123456789012345678901234567890123456789
70: 1234567890123456789012345678901234567890123456789012345678901234567890
71: 12345678901234567890123456789012345678901234567890123456789012345678901
72: 123456789012345678901234567890123456789012345678901234567890123456789012
73: 1234567890123456789012345678901234567890123456789012345678901234567890123
74: 12345678901234567890123456789012345678901234567890123456789012345678901234
75: 123456789012345678901234567890123456789012345678901234567890123456789012345
76: 1234567890123456789012345678901234567890123456789012345678901234567890123456
77: 12345678901234567890123456789012345678901234567890123456789012345678901234567
78: 123456789012345678901234567890123456789012345678901234567890123456789012345678
79: 1234567890123456789012345678901234567890123456789012345678901234567890123456789
80: 12345678901234567890123456789012345678901234567890123456789012345678901234567890
81: 123456789012345678901234567890123456789012345678901234567890123456789012345678901
82: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012
83: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123
84: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234
85: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345
86: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456
87: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
88: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
89: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
90: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
91: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
92: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
93: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123
94: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234
95: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345
96: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
97: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567
98: 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678
99: 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
100: 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
// Buffered CDC Write
// CFG_TUD_CDC_TX_BUFSIZE = 64
// Write Buffer Size = 512
// cdc_task 32 byte chunked writes
// 0 ms delay
// Result: Consistently clamped by size of write buffer
swsh> stress 100 0
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 12345678
// Buffered CDC Write
// CFG_TUD_CDC_TX_BUFSIZE = 32
// Write Buffer Size = 512
// cdc_task 32 byte chunked writes
// 0 ms delay
// Result: Consistently clamped by size of write buffer
swsh> stress 100 0
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 12345678
// Buffered CDC Write
// CFG_TUD_CDC_TX_BUFSIZE = 32
// Write Buffer Size = 1024
// cdc_task 32 byte chunked writes
// 0 ms delay
// Result: Consistently clamped by size of write buffer
swsh> stress 100 0
1: 1
2: 12
3: 123
4: 1234
5: 12345
6: 123456
7: 1234567
8: 12345678
9: 123456789
10: 1234567890
11: 12345678901
12: 123456789012
13: 1234567890123
14: 12345678901234
15: 123456789012345
16: 1234567890123456
17: 12345678901234567
18: 123456789012345678
19: 1234567890123456789
20: 12345678901234567890
21: 123456789012345678901
22: 1234567890123456789012
23: 12345678901234567890123
24: 123456789012345678901234
25: 1234567890123456789012345
26: 12345678901234567890123456
27: 123456789012345678901234567
28: 1234567890123456789012345678
29: 12345678901234567890123456789
30: 123456789012345678901234567890
31: 1234567890123456789012345678901
32: 12345678901234567890123456789012
33: 123456789012345678901234567890123
34: 1234567890123456789012345678901234
35: 12345678901234567890123456789012345
36: 123456789012345678901234567890123456
37: 1234567890123456789012345678901234567
38: 12345678901234567890123456789012345678
39: 123456789012345678901234567890123456789
40: 1234567890123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment