Karl Palsson
2015-08-30 02:17:41 UTC
It's quite possible I'm doing something wrong in my device firmware, but
I'm not sure how my device side can care, so...
My device firmware is meant to be compatible with the linux gadget zero
source/sink function, so I should be able to write as much as I like to
it. And, mostly, this seems to be true. I can write 64, 640, 1000,
5000, bigger and bigger, but around 400k, it starts to fail the
assertions. The exact number of bytes written out is not consistent
every time, but is around 450000. What causes this, and is it
something I'm doing?
def test_write_perf2(self):
ts = datetime.datetime.now()
txc = 0
data = [x & 0xff for x in range(500 * 1024)]
w = self.ep_out.write(data)
self.assertEqual(w, len(data), "Should have written all bytes plz")
txc += w
te = datetime.datetime.now() - ts
print("wrote %s bytes in %s for %s kps" % (txc, te, self.tput(txc, te)))
Failure
Traceback (most recent call last):
File "/home/karlp/src/libopencm3-examples/tests/gadget-zero/test_gadget0.py", line 172, in test_write_perf2
self.assertEqual(w, len(data), "Should have written all bytes plz")
AssertionError: 455680 != 512000 : Should have written all bytes plz
Failure
Traceback (most recent call last):
File "/home/karlp/src/libopencm3-examples/tests/gadget-zero/test_gadget0.py", line 172, in test_write_perf2
self.assertEqual(w, len(data), "Should have written all bytes plz")
AssertionError: 456896 != 512000 : Should have written all bytes plz
Cheers,
Karl P
- --
Sent using Mailpile, Free Software from www.mailpile.is
I'm not sure how my device side can care, so...
My device firmware is meant to be compatible with the linux gadget zero
source/sink function, so I should be able to write as much as I like to
it. And, mostly, this seems to be true. I can write 64, 640, 1000,
5000, bigger and bigger, but around 400k, it starts to fail the
assertions. The exact number of bytes written out is not consistent
every time, but is around 450000. What causes this, and is it
something I'm doing?
def test_write_perf2(self):
ts = datetime.datetime.now()
txc = 0
data = [x & 0xff for x in range(500 * 1024)]
w = self.ep_out.write(data)
self.assertEqual(w, len(data), "Should have written all bytes plz")
txc += w
te = datetime.datetime.now() - ts
print("wrote %s bytes in %s for %s kps" % (txc, te, self.tput(txc, te)))
Failure
Traceback (most recent call last):
File "/home/karlp/src/libopencm3-examples/tests/gadget-zero/test_gadget0.py", line 172, in test_write_perf2
self.assertEqual(w, len(data), "Should have written all bytes plz")
AssertionError: 455680 != 512000 : Should have written all bytes plz
Failure
Traceback (most recent call last):
File "/home/karlp/src/libopencm3-examples/tests/gadget-zero/test_gadget0.py", line 172, in test_write_perf2
self.assertEqual(w, len(data), "Should have written all bytes plz")
AssertionError: 456896 != 512000 : Should have written all bytes plz
Cheers,
Karl P
- --
Sent using Mailpile, Free Software from www.mailpile.is