cancel
Showing results for 
Search instead for 
Did you mean: 

USB HS in FS problem with CDC transmission

?ukasz Gosiewski
Associate
Posted on December 14, 2016 at 09:59

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-cdc
2 REPLIES 2
shingadaddy
Senior
Posted on December 15, 2016 at 04:47

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.

?ukasz Gosiewski
Associate
Posted on December 17, 2016 at 19:59

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?