USB Buffer Over run STM32L432
Posted: Mon Sep 01, 2025 5:10 pm
I started (as a non programmer) with Thomas Roell and the Ladybug board. I used his board files and library forever.
Now Im porting to the STM32duino Core. Got through most porting issues with Generic L432KCUx series setting. But I used to write from a PC to my board through USB a large chunk of product calibration data all at once with no issues. (Maybe 256 bytes at least) using a basic Serial.read(); loop to bring it in.
Now it seems the buffer must be overflowing at > 64 bytes and I cant find where to set the USB buffer to higher values. Thats if the STM receive buffer even is causing the issue. Could it be the Windows USB transmit buffer? (I did not install any specific driver and using default ST PID/VID, so the PC is not using my driver which has different pid/vid - still basic CDC though).
This code below works for a max of A < 15. Filterxo[A] is a float and getdouble(); returns a conversion of serial characters to a floating number. Anything more than A>15 starts to screw up the values in the array. (I do increase the variable array size with this test).
for (uint16_t A = 0; A < 15; A++) {
Serial.println(A);
filterxo[A] = getdouble();
Serial.println(filterxo[A], 3);
Serial.read(); // get rid of spacer/term char x
}
I still need to make a variant of my board so I can use my own PID/VID, but it doesnt seem like there is a great step by step nube tutorial for the latest STM32 on Arduino 2.x available. Ive tried for a few hours with no luck but I think this is a secondary issue Ill post on a different topic.
Thanks for looking.
David
Now Im porting to the STM32duino Core. Got through most porting issues with Generic L432KCUx series setting. But I used to write from a PC to my board through USB a large chunk of product calibration data all at once with no issues. (Maybe 256 bytes at least) using a basic Serial.read(); loop to bring it in.
Now it seems the buffer must be overflowing at > 64 bytes and I cant find where to set the USB buffer to higher values. Thats if the STM receive buffer even is causing the issue. Could it be the Windows USB transmit buffer? (I did not install any specific driver and using default ST PID/VID, so the PC is not using my driver which has different pid/vid - still basic CDC though).
This code below works for a max of A < 15. Filterxo[A] is a float and getdouble(); returns a conversion of serial characters to a floating number. Anything more than A>15 starts to screw up the values in the array. (I do increase the variable array size with this test).
for (uint16_t A = 0; A < 15; A++) {
Serial.println(A);
filterxo[A] = getdouble();
Serial.println(filterxo[A], 3);
Serial.read(); // get rid of spacer/term char x
}
I still need to make a variant of my board so I can use my own PID/VID, but it doesnt seem like there is a great step by step nube tutorial for the latest STM32 on Arduino 2.x available. Ive tried for a few hours with no luck but I think this is a secondary issue Ill post on a different topic.
Thanks for looking.
David