博文

目前显示的是标签为“VS Code”的博文

How to use breakpoints, watch variables, and single-stepping?

图片
  Debugging embedded systems or software often involves   breakpoints, watch variables, and single-stepping   to analyze code execution. Here’s a step-by-step guide for popular IDEs (Keil, IAR, STM32CubeIDE, Arduino , VS Code, etc.). 1. Setting Breakpoints Breakpoints  pause code execution at a specific line, allowing inspection of variables and registers. Steps: Open your project  in the IDE (e.g., STM32CubeIDE, Keil, Arduino). Navigate to the desired line  in your code. Set a breakpoint  by: Clicking the left gutter (most IDEs). Pressing  F9  (VS Code, Keil). Using  Ctrl+Shift+B  (some IDEs). Run in debug mode  ( F5  or click the debug button). Execution stops  at the breakpoint. Types of Breakpoints: Hardware Breakpoints  (limited, used in MCUs). Software Breakpoints  (more flexible, modifies code temporarily). Conditional Breakpoints  (pause only if a condition is met). 2. Watching Variables Watch v...

What is an IDE, and which one should I use (e.g., STM32CubeIDE, MPLAB X, etc.)?

图片
  1. What is an IDE? An  Integrated Development Environment (IDE)  is a software suite that combines essential tools for coding, debugging, and compiling into a single interface. Key components include: Code Editor  (syntax highlighting, auto-completion) Compiler/Assembler  (converts code to machine instructions) Debugger  (step-through execution, breakpoints, variable inspection) Project Management  (file organization, build configurations) Hardware Integration  (flashing code to microcontrollers) 2. Top IDEs for Embedded Systems A. STM32 (ARM Cortex-M) Development 1. STM32CubeIDE (Recommended for Beginners & Pros) Pros: Free, official STM32 IDE (based on Eclipse) Built-in  STM32CubeMX  for pinout configuration & code generation Supports HAL/LL libraries Integrated debugger (ST-Link, J-Link, etc.) Cons: Can be resource-heavy Limited for non-STM32 chips 2. Keil MDK (Commercial) Pros: Industry-standard for ARM development Optimiz...

How to move Arduino IDE dev work to VSCode?

图片
 To move your Arduino development work from the Arduino IDE to Visual Studio Code (VS Code) , you can use the Arduino extension for VS Code developed by Microsoft. This allows you to write, compile, and upload Arduino code directly in VS Code, with more powerful editing and debugging tools.  Step-by-Step: Move Arduino Projects to VS Code Install VS Code Download and install VS Code from: https://code.visualstudio.com/ Install the Arduino Extension Open VS Code Go to Extensions ( Ctrl+Shift+X ) Search for “Arduino” (by Microsoft) Click Install  This extension provides: Syntax highlighting IntelliSense Uploading/flashing support Serial monitor Install Arduino IDE (if not already installed) VS Code uses the Arduino CLI under the hood, so make sure the Arduino IDE is installed and accessible in your system path. Or install the Arduino CLI directly from: https://arduino.github.io/arduino-cli/ Configure Arduino Extension Press ...