To extend and customize the STMCubeIDE (or any Eclipse-based application) you must be familiar with the Eclipse Plugin Development Environment (PDE). This is a huge topic and this guide will only scratch the surface. For more information visit eclipse page:
We will be writing a new Java plugin that will run within the STMCubeIDE application. Eventually, this will be installed in the STMCubeIDE application, but for debugging purposes it is convenient to launch the STMCubeIDE application from the debug configuration in your Eclipse development IDE. This requires :
- a Target Platform definition based on the STMCubeIDE application
- a Debug configuration to launch your plugin in the STMCubeIDE target platform
First, note where the Eclipse application is installed. This location will depend on location you chose when installing STMCubeIDE.
Below is an example of the STMCubeIDE installation directory. It contains the plugins and features directories, an executable to launch the STMCubeIDE application and a configuration file – stm32cubeide.ini. The settings in this configuration file will be used later.
- Open the Windows -> Preferences -> Plug-in Development -> Target Platform options.
- Click Add and select “Nothing: Start with an empty target definition”.
- Click Next and set a name “STMCubeIDE Platform”.
- Click Add, select “Directory” and browse to the location of the STMCubeIDE application as shown above.
- Click Finish. Switch the active target platform from “Running Platform” to “STMCubeIDE Platform” by checking the latter.
- Create a new Plug-in Project
- Give the project a name and click Next until you reach the Template settings.
- Check the “Create a plug-in using one of the templates“. Select the “View contribution using 4.x API” template
- Create a new debug configuration.
- Change the “Program to Run” selection to “Run a Product” by selecting the “com.st.stm32cube.ide.mcu.rcp.product” target platform we just added.
- Go back to the STM32CubeIDE installation directory and open the stm32cubeide.ini file.
- Copy the entire text from the file and paste it into the Program Arguments field.
- Change the Working Directory to Other and browse to the STM32CubeIDE installation directory.
- Click Debug to launch the STM32CubeIDE application with your plugin.