Page 1 of 1

Using usb fullspeed on highspeed phy (stm32f723)

Posted: Tue Sep 29, 2020 2:23 pm
by sabdulqadir
Hi guys,
On stm32f723, I am using otg_hs controller with internal hs-phy. My application enumerates as a CDC class device (virtual com port). I am able to do highspeed transfers using chnWrite(). Recently there was a case where we need to slow the physical interface down. So I changed otg_dcfg_dspd = DCFG_DSPD_HS_FS. This would enable hs-phy to negotiate with the host to communicate using full-speed protocol. After the change, the device would not enumerate. After a bit of effort, I realized, by changing MaxPacketSize on Interrupt_request_ep to 64 (from 512), it would enumerate. The interval on that end-point is set to 0xff. So my first query

1. Would anyone know if there is any such limit of packet size on interrupt_request_ep?

After the change, the device now enumerates but still I am not able to transfer big chunks of data. ChnWrite() after a few attempts just sits idle. I have declared three serial_usb buffers. I see data is present in all three of them. 'bcounter' field in obqueue is 0.

2. What is the best way to troubleshoot this issue ?

Thanks,
AQ

Re: Using usb fullspeed on highspeed phy (stm32f723)

Posted: Tue Sep 29, 2020 3:19 pm
by Giovanni
Hi,

I never tested this scenario, probably there is something in the USB2 standard, 64 bytes could be a limit at that speed.

What is the buffers size? apparently the buffers are full and the serial_usb is not emptying them like it is supposed to do, it is like the driver does not call sduDataTransmitted().

Giovanni

Re: Using usb fullspeed on highspeed phy (stm32f723)

Posted: Mon Feb 15, 2021 9:32 am
by mck1117
sabdulqadir wrote:Hi guys,
After a bit of effort, I realized, by changing MaxPacketSize on Interrupt_request_ep to 64 (from 512), it would enumerate. The interval on that end-point is set to 0xff. So my first query

1. Would anyone know if there is any such limit of packet size on interrupt_request_ep?


You need to set the max packet size on both your CDC data descriptor and the endpoint to 64 bytes. Did you change both? If you have that set to 512 but the descriptor configured for 64, that's a recipe for undefined behavior since the buffer will never fill.

Re: Using usb fullspeed on highspeed phy (stm32f723)

Posted: Thu Mar 25, 2021 12:59 am
by sabdulqadir
Thanks mck for the help and taking time to reply.
You are right, i did finally realize that after few hit and miss trials :)
Thanks,
AQ