Very slow com port transmission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-14 5:57 AM
Hi everyone,
I need your advice because I think the delays I'm getting are incorrect, but I'm not sure.
In my tests, I transmitted data like this via USB (COM port) a total of 34 times:
BODY1=00 BODY2=00 BODY3=00 SW=9000
I'm sending data in Python via USB. The STM32H755 interprets it and returns the frame shown above.
I've measured the time, and it takes 5.1 seconds to receive my 34 data points (with 34 responses). Of the 5.1 seconds, I spend 5.04 seconds in this function:
uint8_t CDC_Transmit_FS(uint8_t* Buf, uint16_t Len)
This isn't normal, but I don't know how to improve this transmission time. I'm not experiencing any data loss, it's just extremely slow.
Here's how I send my data:
snprintf(data, sizeof(data), "%sSW=%04X\r\n", body_str, apdu_res.SW);
CDC_Transmit_FS((uint8_t *)data, strlen(data));
Do you think this is normal?
Thank you in advance for your advice.
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-05-14 7:12 AM
The CDC_Transmit_FS function is nonblocking. I think the problem is somewhere else.
