Skip to main content
Visitor II
May 14, 2025
Question

Very slow com port transmission

  • May 14, 2025
  • 1 reply
  • 323 views

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.

    This topic has been closed for replies.

    1 reply

    Super User
    May 14, 2025

    The CDC_Transmit_FS function is nonblocking. I think the problem is somewhere else.