Giter Club home page Giter Club logo

Comments (8)

benedekkupper avatar benedekkupper commented on September 24, 2024

Could you check if adding USART_vDeinit(vcp_uart); to line 141 of vcp_if.c has any effect on this problem?

from debugdonglefw.

TerribleKraal avatar TerribleKraal commented on September 24, 2024

Hi, I tried that and it did not help.
Furthermore, if I send 1 byte X, close the port, wait 1 second, open the port, wait 1 second -> all subsequent next transfer will fail with the 1st byte being X and the rest being 0 (I say the rest because it sends back the same number of bytes it received).

Edited: really only the first transfer following the re-opening of the port is wrong then if the port is not closed all transfers are good.

from debugdonglefw.

benedekkupper avatar benedekkupper commented on September 24, 2024

One more question, was the incorrect data received on the host before the port was closed (meaning that you receive it once before closing and once after reopening)?

from debugdonglefw.

TerribleKraal avatar TerribleKraal commented on September 24, 2024

Hi, thank you for taking time to look into it.

The incorrect data is received only after reopening, not before closing.

from debugdonglefw.

benedekkupper avatar benedekkupper commented on September 24, 2024

What I see as the most probable root cause is that the endpoint packet is prepared in the device peripheral, but isn't read by the host until after the reopening of the port. So the new setting of TX_COUNT register applies, but the previously loaded data isn't cleared. A possible solution could be to set TX_COUNT to 0 when the line config is set, but I can't promise any deadline for actually checking it (it's summertime after all :) ).

from debugdonglefw.

TerribleKraal avatar TerribleKraal commented on September 24, 2024

No problems.
In the meantime as I know that the first packet will be wrong I can initiate a dummy read on the COM port and discard the answer.

Enjoy the summertime :-)

from debugdonglefw.

benedekkupper avatar benedekkupper commented on September 24, 2024

I pushed updates to USBDevice and DebugDongle: CDC has a more sensible application interface for the majority use case (serial ports). The data interface is closed and reopened when the line coding parameters are set. This should resolve this issue, however I haven't tested it yet. If the set line coding message isn't sent by the host every time the port is opened then there is no way to fix this on the device side alone.

from debugdonglefw.

benedekkupper avatar benedekkupper commented on September 24, 2024

I'm closing this as it's either solved by the API change or the host doesn't resend line config when reconnecting, in which case the problem cannot be solved on the device side.

from debugdonglefw.

Related Issues (4)

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.