使用新的 Arduino IDE 2.0 调试 RTL8722
RTL8720/RTL8721/RTL8722 DN/DM/DF development board
SEGGER JLink debug probe (J-Link Debug Probes by SEGGER – the Embedded Experts)
Arduino IDE 2.0 (https://www.arduino.cc/en/software)
SEGGER JLink Software Pack (SEGGER - The Embedded Experts - Downloads - J-Link / J-Trace)
- Install Arduino IDE 2.0. Instructions on installing Arduino IDE 2.0 can be found at https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing.
Note: Arduino IDE 2.0 can coexist with the old Arduino IDE. Any changes made to boards or libraries will affect both IDE versions.
- Install SEGGER JLink Software Pack.
For Windows users: this process assumes that the 64-bit version of JLink software is installed in the default directory of C:\Program Files\SEGGER.
In Tools → Board → Boards Manager , find and install the board support package.
In the menu near the toolbar, select the board and COM port corresponding to your evaluation board.
Open the example code in File → Examples → AmebaDebugExample → ExampleDebug.
Follow the comments to add in the correct folder path into the serverArgs field of the debug_custom.json file.
Connect the evaluation board and JLink debug probe to your computer. Using jumper wires, connect the debug probe to the SWD pins on the evaluation board. SWD pins on the JLink debug probe can be found at J-Link Interface Description.
JLink Debug Probe RTL8722 Evaluation Board VTref 3.3V GND GND SWDIO SWDIO SWCLK SWCLK
Refer to https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-debugger for instructions on how to use the Arduino IDE debug interface.
Before debugging, make sure to enable Sketch → Optimize for Debugging.
Compile and upload the sketch in the same way as before, using the USB to UART COM port. Program download using the debug probe is not supported yet.
After uploading is complete, reset the board and you can start debugging by clicking on the debug icon near the upload icon. You should see program execution stop, and a yellow highlight on the first line of code in the setup function, this indicates the next line of code to be executed by the processor.
Note: The RTL872xD chip only has 2 hardware breakpoint registers. These will be used up when you set breakpoints. Trying to set too many breakpoints will cause debugging to fail, the output tab will show “WARNING: No more breakpoint resources left”. You may need to stop debugging and reset when this happens.
Note: Using any of the single-stepping functionality (step over, step into, step out) requires that both hardware breakpoint resources are free. You should remove or disable all existing breakpoints before using them.