Closed Electro707 closed 2 years ago
I just loaded a standalone program for USB using ST's HAL library, and all characters gets sent over (a basic program where it loops sending back every possible characters).
Going thru ST's code for differences, while it might not be related to this issue, they call the following function after writing to the pma: PCD_SET_EP_TX_CNT(USBx, ep->num, len);
which sets counter for the tx/rx buffer.
(their code comment). I am not sure if that is important or not, but tomorrow (or whenever I get to it) I'll hack this in this library and see if it does anything.
EDIT: Nevermind, this library also adjusts the tx counter with tx->cnt = blen;
The issue actually turned out to be a bug in STMCube's LowLevel library code for the RCC. When I switched that over to HAL, USB started working.
First of all thanks for this lightweight library. ST's USB HAL was way too bloated (used up more than the flash memory availale for my application). Unfortunately I have ran into a potential issue: Using the example loopback program under an STML052 (USB CDC), if I send certain hex values (like 0xFF, 0xFE, 0xEF, etc) the device will not loopback the given characters. I am not sure if there are against the CDC spec, the library's fault, or Linux's fault (although I did try it under Windows with the same outcome). I actually noticed this when programming my ST to reply back read EEPROM, in which they were all 0xFF's (due to the lack of programming the EEPROM).
Setup Info: