2
\$\begingroup\$

WHat should I do when I am sending data using USB, when the callback in my firmware gives me USB BUSY?

Once, I received USB Busy state, I could no longer send data to my host from my firmware, but my host could still send data to my firmware and I am able to read it.

What should I do to clear the USB Busy state? and why is it in USB busy?

\$\endgroup\$
7
  • \$\begingroup\$ Tim, in what situation your BUSY status will occur? Can the the PC receive the data when it's not busy? \$\endgroup\$
    – diverger
    Commented Nov 27, 2014 at 8:48
  • \$\begingroup\$ @diverger yes my PC can rcv data when it is not busy, but once it is in busy, my PC cant rcv data anymore. i am sending data of variable length, and i create a timer of 10ms, to send the data from my firmware \$\endgroup\$
    – Tim
    Commented Nov 27, 2014 at 8:53
  • \$\begingroup\$ you should check who set the BUSY state, the PC or your firmware. If you PC can't receive data, it will case the STM32 set busy, then the BUSY should come from STM's hardware status bit. Check it, see if this is a hardware status or pure firmware status. \$\endgroup\$
    – diverger
    Commented Nov 27, 2014 at 8:57
  • \$\begingroup\$ @diverger it is from STM, and it is firmware status, when I send data in my firmware, the firmware will wait for an interupt to clear the busy status, (i think the firmware did not interupt to clear this busy status, but i try to trigger manually to clear this interupt myself, and set it to USB normal state, it works OK for a while(around few mins), but then it starts to get the USB BUSY again, and my manually triger to clear the USB BUSY does not work anymore. \$\endgroup\$
    – Tim
    Commented Nov 27, 2014 at 9:03
  • \$\begingroup\$ Then who should cause the interrupt? Can you tell me the interrupt number? All the interrupt function name. \$\endgroup\$
    – diverger
    Commented Nov 27, 2014 at 9:18

1 Answer 1

1
\$\begingroup\$

I have finally solved this problem, be replacing the entire STM32 HAL driver for USB CDC back to the Standard Peripheral library for USB CDC!

and there is no more problem with it! I run into many issues using HAL driver from STM32, it is very buggy! if you encounter problem with it, try to switch back to Standard Peripheral library!

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.