2023-08-29 8:59 AM
hello every one , I'm working with nucleo 144 F4, and im trying to send data via virtual com port using CDC_Transmit_FS, but in my Hterm im receiving junk data also i don't why ,,i saw online that there is zero length packet but i don't know how to implement it , im trying to test with this function with sending just 0
void sendvalue(void) {
and call it in the main function and you can see in the screenshot what i receive in my pc ,
Solved! Go to Solution.
2023-08-29 9:59 AM
That sends whatever bytes are at memory address 0. Which is probably not zero.
Perhaps you wanted:
static uint8_t buffer[8] = {0};
CDC_Transmit_FS(buffer, sizeof(buffer));Note that the call is asynchronous, so the data needs to be valid even after the function returns. Making it static or global does this.
2023-08-29 9:59 AM
That sends whatever bytes are at memory address 0. Which is probably not zero.
Perhaps you wanted:
static uint8_t buffer[8] = {0};
CDC_Transmit_FS(buffer, sizeof(buffer));Note that the call is asynchronous, so the data needs to be valid even after the function returns. Making it static or global does this.
2023-08-30 1:32 AM - edited 2023-08-30 1:44 AM
thanks for your response actually i want to transmit the ones and zeros from pdm microphone and for that i need a counter to count the ones a from the pdm data to plot in a python script but its dosent work as expected ,im giving the clock with timer using pwm and read the data with gpio in the left channel and in the output im expecting that i receive bit from 0 to 8 but in htrem i get also other value like 56 ect.. this is my code if you have a look on it thanks
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.