cancel
Showing results for 
Search instead for 
Did you mean: 

Very slow com port transmission

Gregory_1
Associate

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.

1 REPLY 1
TDK
Super User

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

If you feel a post has answered your question, please click "Accept as Solution".