Comments (2)
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:
-
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.
-
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.
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)
- Missing avr-gdb.exe in Arduino IDE version 1.8.13 HOT 4
- Linker error HOT 2
- Provide `Print` implementation instead of `debug_message` HOT 8
- debug_message() is needlessly restrictive in only sending 47 chars HOT 2
- Stuck in initializing I2C LCD display HOT 5
- wont install in latest vs code HOT 1
- visual studio code: undef ref to debug_init HOT 1
- no elf HOT 1
- including avr debug breaks Serial.println etc in VC HOT 1
- Strange Memory Address HOT 2
- a method for mcu debugger only using UART ports HOT 2
- Impossible debugging VSCode PlatformIO avr-debug and Apple Silicon M1 HOT 3
- Skipped lines and jumps in Arduino Code and No debugging in function HOT 4
- Is there a problem with using COM port bigger than 9? HOT 2
- Global objects init won't allow a call for debug_init() HOT 5
- debugger hangs on char [] ? HOT 1
- Flash mode debugging does not work with optiboot.hex bootloader. HOT 1
- Help me with problem of debugging in Pio, plsssss HOT 2
- Can't debug on Mac HOT 3
- Custom Atmega1284p Board Bootloader Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avr_debug.