Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    "As a development tool the debugger is essential for testing code and execution states in a sterile and controlled environment." No, it's not essential, one can certainly trigger test sequences through any sort of I/O port, with a UART being very popular. In fact it's not clear that a debugger is even useful for testing, sure it lets you look at variables that you didn't preplan to read, but structured output is far better for capturing, performing further analysis, and creating records of the test results. Commented Nov 4, 2019 at 14:42
  • @BenVoigt how would you develop or validate the UART driver? UART irq change the device state, a SWD just pauses it. The debugger and SWD/ICE is what the manufacturer validates to read out the internal state of your device, any external tool or firmware capacity for doing readouts would need to be verified and benchmarked, likely using the debugger . Depends on your requirements and tolerance for issues of course. GPIO is also useful for fantastic timing measurements, but it's hard to read out a lot of data, a UART requires CPU time to read out any significant data (115200bd is 100us a byte). Commented Nov 5, 2019 at 16:00
  • I develop a UART driver based on the microcontroller documentation. I validate it by counting errors from incoming invalid packets, and reading them using commands in valid packets. Way too much repetitive work to do that in an interactive debugger. The debugger really is only useful for debugging. Commented Nov 5, 2019 at 16:09
  • @BenVoigt But if the error count is not what you expect, what will you do to interogate the system? What if there is a cpu error? The swd will let you examine all status registers. I am not suggesting you step through to understand your code I am saying that hardware errors can exist too. Even CPU errors where documentation is wrong and errata is needed. I believe you may be misinterpreting my answer or I didn't understand the question Commented Nov 5, 2019 at 16:13
  • It definitely is valuable as a debugging and diagnostic tool. It's a horrible test and validation tool. Commented Nov 5, 2019 at 23:16