Giter Site home page Giter Site logo

Comments (3)

GrantMTG avatar GrantMTG commented on June 10, 2024

Maybe you could copy the result to a local variable and see the reason (the value at *reg):

volatile uint16_t *reg = EPR(ep);
switch (*reg & (USB_EPTX_STAT | USB_EP_T_FIELD | USB_EP_KIND))
   :

from libusb_stm32.

EmbeddedMagic avatar EmbeddedMagic commented on June 10, 2024

The mask (USB_EPTX_STAT | USB_EP_T_FIELD | USB_EP_KIND) is 0x0730.
reg is pointing to adr. 0x40005C04 which is I guess is register USB_EP1R, ep is 0x81.
In good case (case (USB_EP_TX_NAK | USB_EP_BULK):) reg is 0x7061 when entering the case and 0x70A1 when leaving the case.

In bad case (default:) reg is for example 0xA0A1 or 0xE0A1 (breakpoint at return statement)
FYI: I use a jLink debugger and can therefore inspect these values.

I also tried resending after -1 is returned in a do-while-loop. This didn't work either, but I need to deep dive more into it. This seems to be the obvious solution.

So Dmitry is from Ukraine? I really hope he is safe. I am of course not in the position to expect any answer from him.

from libusb_stm32.

GrantMTG avatar GrantMTG commented on June 10, 2024

Well, FWIW, I never wrote at that level, I always used usbd_ep_write().

I'm going to hazard a guess that the endpoint isn't ready, try again later... you could implement that and see if the situation resolves if you do retry.

It's probably the middle of the night where Dmitry is and/or the war might be affecting him or his locale.

from libusb_stm32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.