STM32CubeIDE from STMicroelectronics is an Eclipse-based enablement platform which supports development and debugging of code on STM32 ARM microprocessors. PEmicro hardware interfaces: Multilink and Cyclone can be leveraged for advanced debug capabilities via an Eclipse GDB plugin that is freely available for installation into any Eclipse IDE from PEmicro update site (https://www.pemicro.com/eclipse/updates). This blog demonstrates the steps needed to install and configure PEmicro Multilink and Cyclone debug support in STM32CubeIDE to the point of launching a debug session.
WORKAROUND for newer STM32CUBE IDEs with CDT version 10.6 and greater
The workaround is to disable the CDT update site. In STM32CubeIDE, go to Help->Install New Software -> Manage...
In the "Preferences" dialog, uncheck the checkbox next to CDT:
Then install the PEMICRO plugin.
1. Install the PEmicro GDB server for Arm device Plugin
2. Create a Launch Configuration
Once Per Project
Installing PEmicro GDB server for ARM devices plugin
a. Launch STM32CubeIDE and proceed to Help -> Install New Software to bring up plugin installation and update wizard.
b. Point Work with dialog to PEmicro plugin update site: http:/www.pemicro.com/eclipse/updates
c. Select GNU ARM PEMicro Interface Debugging Support and PEmicro ARM Device Expansion Plugin check boxes and click on the Next button:
d. This will install support for PEmicro’s Multilink and Cyclone hardware into STM32CubeIDE. A dialog will pop up prompting you to restart STM32CubeIDE. Click Yes.
Launching a Debug Session
a. It’s incredibly simple to launch a debug session via PEmicro’s debug probes with STM32CubeIDE. Open a project of your choice and bring up its debug configuration manager:
Figure 3. Launching Debug Configuration Wizard
b. This brings up the dialog where launch settings are configured. PEmicro interfaces require a dedicated launch debug configuration that can initially be created by double clicking on GDB PEMicro Interface Debugging category in the left pane:
Figure 4. Creating PEmicro Launch Debug Configuration
Once PEmicro launch debug configuration is created, under the Main tab, please browse to a current project as well as C/C++ Application .elf file that one is looking to debug.
c. Under Debug tab, user may wish to modify many launch settings to control the features that include:
- ITM/Printf/Power measurements via SWO
- Exception catching
- Automatically provide/switch power to the target MCU
- Memory region preservation during programming
- The application object files to be programmed and debugged
- Any additional object files to be programmed into the device (bootloaders, etc.)
- Whether to reset/program a target MCU or to attach (hotsync) to a running device
- Semihosting options allowing running code to emit debug messages
- Temporary breakpoints
- MCU device selection
- Debug probe selection via USB or Ethernet
- Initialization scripts
For full list of features please reference PEmicro plugin documentation (http://www.pemicro.com/downloads/download_file.cfm?download_id=482).
At a minimum, the user should properly configure the following settings in order to launch a debug session:
- Debug hardware interface
- MCU device part number
- Project and application binary to launch
- A link to the GDB client executable
Figure 5. PEmicro Debug Configuration Settings
When a new launch debug configuration is created, the user should begin by selecting the Debug Hardware Interface to be used. The PEmicro GDB server supports debug connections through PEmicro’s USB Multilink debug probes, as well as Cyclone programmers via USB and Ethernet.
Figure 6. PEmicro Debug Interface Selection
PEmicro’s USB and local Ethernet devices are automatically detected. Remotely networked Ethernet debug interfaces may be specified via their IP address.
Next, the user should select specific STM32 MCU device to be debugged and programmed.
Figure 7. STM32 Device Selection
When creating a new debug configuration, the user should ensure that a path to a GDB Client is specified under GDB Client Setting within debug configuration. STM32CubeIDE comes with a GNU plugin for external tools pre-installed: com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2- update.win32_220.127.116.11904181610. Therefore, please point GDB Client Setting text box with a direct path to arm-none-eabi-gdb.exe client. Please note that the actual path might vary depending on the version of the plugin as well as the location of your STM32Cube installation directory (STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_18.104.22.168904181610\tools\bin\arm-none-eabi-gdb.exe).
Figure 8. GDB Client Path
Once these debug settings are complete, a debug session can be started with a press of Debug button.
PEmicro’s Eclipse-based GDB Server plug-in allows developers to use PEmicro’s Multilink and Cyclone interfaces to program and debug ARM and PowerPC processors in many different Eclipse based IDEs. PEmicro Eclipse GDB plugins for ARM and PowerPC devices provide the ability to rapidly develop and debug code for STM32 ARM as well as SPC5 ST PowerPC devices.