Hello
I'm having a program on a Raspberry PI (running Debian Linux) that sends data over USB, using the profile CDC serial. The length transferred from the PI is of variable size, from a few bytes (always a multiple of 4) to about 3K max every 16 ms. From time to time the communication locks up. The TEENSY detects a timeout condition, but the PI is still stuck in transmit. I have to disconnect and reconnect the cable, and restart the transfer on the the PI. Note that I tried the same program on a PC running Windows, and I have the same problem (maybe less frequently, but I have it also).
I have a Teensy 4.1
I am using Teensyduino 1.53
The teensy never transmits data, always receive
The PI never receive data, always transmit
I noticed that every time it hangs, the PI has over 2K of data to transmit. It does not seem to hang under the 2K limit.
For the moment, I have a workaround (never transmit over 2K), but still - there seems to be a problem on the receive size of the TEENSY.
Here is the code.
Teensy (receive side)
RASPI (or PC)
static int serial_write(void *buf, uint32_t size)
{
result = write(s_serial_fd, buf, size);
return result > 0;
}
I'm having a program on a Raspberry PI (running Debian Linux) that sends data over USB, using the profile CDC serial. The length transferred from the PI is of variable size, from a few bytes (always a multiple of 4) to about 3K max every 16 ms. From time to time the communication locks up. The TEENSY detects a timeout condition, but the PI is still stuck in transmit. I have to disconnect and reconnect the cable, and restart the transfer on the the PI. Note that I tried the same program on a PC running Windows, and I have the same problem (maybe less frequently, but I have it also).
I have a Teensy 4.1
I am using Teensyduino 1.53
The teensy never transmits data, always receive
The PI never receive data, always transmit
I noticed that every time it hangs, the PI has over 2K of data to transmit. It does not seem to hang under the 2K limit.
For the moment, I have a workaround (never transmit over 2K), but still - there seems to be a problem on the receive size of the TEENSY.
Here is the code.
Teensy (receive side)
Code:
static uint8_t buf[BUF_SIZE];
do {
if (!usb_configuration) {
return;
}
size = usb_serial_available();
if (size) {
size = MIN(size, sizeof(buf));
usb_serial_read(buf, size);
}
}
while (size == 0);
...
RASPI (or PC)
static int serial_write(void *buf, uint32_t size)
{
result = write(s_serial_fd, buf, size);
return result > 0;
}
Last edited by a moderator: