How to Flash & Run a project in ChibiStudio
This article is a step-by-step guide showing how to reliably flash and run a project in ChibiStudio.
This guide assumes the project has already been built and the build folder already exists in the project’s main folder. You can check this by looking into the Project Explorer menu, under the project folder, as shown below.
If the project has been freshly imported, you need to build it by pressing the hammer button.
Step by step procedure
You will need the build folder to create the debugger configuration, which is required for flashing and running the project.
Creating the launch configuration
- Open your project folder
- Open the build folder
- Select the .elf file
- Go to External Tools menu (downward facing black arrow)
- Select Create OpenOCD Debug Configuration (pre-select .elf file into a project)
Successful debugger configuration will be confirmed by the following message in the console:
Additionally, the debug folder should now be visible under your project’s main folder (a refresh – F5 – of the Project Explorer may be required).
From this step onwards the microcontroller must be connected to your PC. In this example we are going to use an Analog Devices SDP-K1. The board comes with the CMSIS-DAP debugger and an STM32F4 microcontroller.
- Click the downward facing black arrow from External Tools
- The menu entry to choose depends on the debugger in use, in our case OpenOCD on CMSIS-DAP (prompts for .cfg target configuration)
- An Explorer window will open and you will have to follow this path: C:\ChibiStudio\tools\openocd\scripts\target. If you did not install ChibiStudio under C:\, you will need to first locate your ChibiStudio installation folder and follow the rest of the path
- Select the configuration source file. Essentially, this is the microcontroller you are working on. For example, if you are using an Analog Devices SDP-K1, the file you are looking for is stm32f4x.cfg
Once completed, the following message will appear in your console:
Flash & Run the project
- Click the downward facing black arrow from the Debug menu
- Select <…ProjectName…> (build-ch.elf)(OpenOCD, Flash and Run). You will be transferred to the Debug Perspective.
- Wait for the project to finish loading. The progress bar is located in the bottom right corner
- Press the Resume button
The project is now being flashed and running on your microcontroller.