Become a leader in the IoT community!
New DevHeads get a 320-point leaderboard boost when joining the DevHeads IoT Integration Community. In addition to learning and advising, active community leaders are rewarded with community recognition and free tech stuff. Start your Legendary Collaboration now!
I am working on a 32-bit embedded Linux, kernel is 2.6 running on a 64mb device.
Trying to stream in some 2MB of data into the device but get stuck after reading in a couple of KBs.
`dmesg` gives me`
`circ_buf_get err now with c:
for which device is it?
i have seen TI’s related driver have a default of 2kB as buffer normally
honestly if possible, try using HW/SW control to stream data
a proprietary device datasheet is very vague on speccific
been thinking it is an algorithmic issue.
most probably,
as 2kB is more than enough for buffer
i would either break the stream into small payloads or use some form of control flow
@melta101 it was a HW constraint issue. The device is configured to accept only 16K of data at a go.
I simply just read 16K then send an ack byte to inform the sender to give me more data.
The implementation is a bit slow since I need to read the data over 128 iterations.
ahh,
That’s nice
how were you able to find it to be HW contraints
An almost strongly worded email to the manufacturer of the device, asking for docs, but I was only offered the buffer size constraint.
I am thinking how easy it would be to use `setvbuf` with the serial file descriptor for automated streaming.
Maybe I will run away from those loops.
what’s the prob with the fragemented approach, like the one above, other than some overhead, it should be fine
the solution is perfectly fine but if I could be faster. Be greater, since theoretically with 115200 baud and some 100ms of copying to another buffer and sending back ack, the stream should take about 3 minutes.
Stupid question DMA?
It’s a linux box and the serial is usb. DMA would be overkill. Killing a cockroach with an atomic bomb and not even achieving better results, not dying faster.
Ah I see, same round trips too if the hardware limit exists
Exactly. I am thinking I can shave off sometime with a bigger baudrate… I’ll see. And cut out buffer copying with `setvbuf`… not sure how that’ll work, yet.
which subset of USB?
serial, or acm?
or something else?
ACM, I think the driver is custom or a modified version of some bcm usb cdc
At least that what I have gathered from a bit of digging. But I realize it has become irrelevant, what I need to solve is more high level at this point.
CONTRIBUTE TO THIS THREAD