How to Flash & Run a project in ChibiStudio

Introduction

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.

Locating the build folder

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

  1. Open your project folder
  2. Open the build folder
  3. Select the .elf file
  4. Go to External Tools menu (downward facing black arrow)
  5. Select Create OpenOCD Debug Configuration (pre-select .elf file into a project)
Configurating the debugger

Successful debugger configuration will be confirmed by the following message in the console:

Console message on successful debugger configuration

Additionally, the debug folder should now be visible under your project’s main folder (a refresh – F5 – of the Project Explorer may be required).

Launching OpenOCD

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.

  1. Click the downward facing black arrow from External Tools
  2. The menu entry to choose depends on the debugger in use, in our case OpenOCD on CMSIS-DAP (prompts for .cfg target configuration)
  3. 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
  4. 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
Creating the launch configuration

Once completed, the following message will appear in your console:

Console message on successful launch configuration

Flash & Run the project

  1. Click the downward facing black arrow from the Debug menu
  2. Select <…ProjectName…> (build-ch.elf)(OpenOCD, Flash and Run). You will be transferred to the Debug Perspective.
  3. Wait for the project to finish loading. The progress bar is located in the bottom right corner
  4. Press the Resume button
Flashing & Running a project in ChibiStudio

The project is now being flashed and running on your microcontroller.

Be the first to reply at How to Flash & Run a project in ChibiStudio

Leave a Reply