As of this writing, the new Arduino IDE is still in beta, features and functionality may be changed or removed without warning, and is not indicative of the final release version.
RTL8722 development board
SEGGER JLink debug probe (J-Link Debug Probes by SEGGER – the Embedded Experts)
Arduino IDE 2.0 beta (https://www.arduino.cc/en/software)
SEGGER JLink Software Pack (SEGGER - The Embedded Experts - Downloads - J-Link / J-Trace)
- Install Arduino IDE 2.0 beta. Debugging has been tested with the Arduino IDE 2.0.0-beta.8. Older versions may not work properly. 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. Debugging has been tested with JLink software V7.50.
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 the Arduino IDE 2.0 menu, in File → Preferences → Additional boards manager URLs , copy and paste the following address: https://raw.githubusercontent.com/Aurical/ambd_arduino/master/Arduino_package/package_realtek.com_amebad_early_index.json
In Tools → Board → Boards Manager , find and install the board support package for Realtek Ameba RTL8722DM/RTL8722CSM. Debugging has been enabled in version 3.0.9-build20210708. Note that this will overwrite any existing installs, back-up any modified files that you want to keep.
In the menu near the toolbar, select the board and COM port corresponding to your evaluation board.
Open the example code in File → Examples → AmebaDebug_Example → 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. The RTL8722 does not support program download using the debug probe 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 RTL8722 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”, and you may see a red bar across the code as shown. 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.