2016-12-14 12:59 AM
H,
I use STM32F439 in HS in FS mode with CDC class. Apparenty even though messages are received by uC in proper fashion and sent to PC as I coded them, terminals on PC fail to receive/display them right. If there is no EOL sign in transmission, they seem to be stuck in some buffer and pushed off it late (in example I receive response to my first message after sending second or third) or lost or cut short. Same code worked perfectly fine with normal USB in FS on STM32F407 - no EOL needed to complete transmission. Switching back to normal FS is not an option for me. Does anyone knows what might cause this?
#usb-hs-in-fs #usb-cdc2016-12-14 07:47 PM
Gosh this could be multi pronged but here goes.
1. I assume you are on a new board so - Bad Connections of ANY sort?
2. Operational differences in how the parts handle partial packet or zero length packet needs?
3. Trying to transmit String buffers where sizeof reports the nul but it isn't accounted for in some other area?
4. Com port interrupt conflict on the PC side.?
Sorry such varied comments/suggestion but maybe worth mentioning.
2016-12-17 10:59 AM
I investigated further. It turns out normal transmission (sending 1024 generated bytes at a time) after some minor bug fix worked. But when I start to use cryptographic module, after few succesfull transmissions (18 bytes sent to device and returned after encryption) something goes wrong. What is put in USBx_DFIFO is not reaching PC. At least not without a delay or data loss, as it was stuck. After returning to normal transmission, all data is transferred, but incoming packets are shifted - PC receives packet, that was put in FIFO few transmissions earlier. Each initiation of encryption makes that shift longer.
Now, I've also implemented hashing (with hardware) data incoming from USB. During accumulation of data everything's ok, but when I start actual hashing, frame with code even though is put in FIFO, never reaches PC. And shift mentionded beforehand occurs. Is it possible, that it's beacause I use polling mode and not IT?