Giter Site home page Giter Site logo

Comments (2)

jdolinay avatar jdolinay commented on July 17, 2024

Hi,
I think Software serial internally uses interrupt for receiving data and unfortunately the interrupts are blocked by the debugger if there is one or more breakpoints set. So the Software serial cannot receive data. This is due to the implementation of the debugger. I can suggest 2 options in your situation to bypass this limitation:

  1. If you remove all breakpoints (including the automatically inserted breakpoint in main which VS code inserts - this requires executing command -exec clear main in the Debug Console, see the doc, chapter Breakpoint in main). So if you remove all breakpoints and let the program run, it should be able to receive data. The problem is that you can only stop it by the pause (suspend) button so it will stop at random moment. But maybe this can still be useful to inspect the data. Actually, you can also insert the breakpoint() function in your code at the line in code where it should stop and it should stop at this line always. Perhaps inside some condition which is true when complete data is received.

  2. If you use the "flash breakpoints" configuration (which requires replacing the bootloader in your arduino), it should work with breakpoins - you can place breakpoint and let the program run. It should then stop on the breakpoint.

Anyway, I am not sure if it will work :( The software serial may need quite precise timing of its operations to be able to sample the input pin which may be disrupted by the debugger. I think it could work as described above but maybe this is something for which the debugger is not useful.

Best regards

from avr_debug.

wanggaoteng avatar wanggaoteng commented on July 17, 2024

Hi, Jan,
Thank you very much. I test 1, but it doesn't work.
I realized that it may be the limitation of gdbstub to receiving data, so I can only close this issue.
Best regards.

from avr_debug.

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.