User Tools

Site Tools


Sidebar

Modtronix.com
Sitemap

tutorials:nz32:ide:coide-with-nz32-boards

Using CoIDE with NZ32 Boards

This Wiki page contains information how to use the CoIDE Application for Modtronix boards with STM32 processors. We used V2.0.3 of CoIDE. Please feel free to register and improve this page - user contributions are greatly appreciated!

Many Modtronix example and source code downloads include a CoIDE workspace with projects. CoIDe is an Eclipse based tool, meaning projects are always part of a workspace. To see if a download has a CoIDE workspace, look for a “CoIDE” folder in the root directory. This is the CoIDE workspace folder, and will contains one or more CoIDE projects. The CoIDE application can be used to compile, debug and program the target board by following these simplified steps. See sections below for more detail:

  • Download and install the ST-Link/V2 (ST-Link/V2-1) USB Drivers (see below for details)
  • Download and install V2 of CoIDE from coocox.org.
  • After installation, start CoIDE and open the project located in the “CoIDE” folder.

Debug and Run project

To debug and run the target, it must be connected to a ST-Link/V2-1 programmer(SWD connection) like the Modtronix PGM-NUCLEO.

To program the target, simply select <Flash> <Program Download> from the menu. This will connect to the target device, and program it with new firmware.

To debug the target, select <Debug> <Debug> from the menu. This will download the current code to the target, and enter debugging mode. The project can now be debugged, using single step, step into and other debug functions.

CoIDE

CoIDE is based on the Eclipse IDE for C/C++ developers (Eclipse CDT). There is a lot of information available online if you get stuck. Installation is quite simple, and basically just involves downloading and installing the app from www.coocox.org.

The coocox user forum also contains a lot of useful information, and is located here. You will find help on their site relating to installation, debugging, programming of STM32 target, importing mbed project, importing STM32Cube(STM32CubeMX) projects and more.

ST-Link/V2 USB Drivers

The recommended programmer for Modtronix NZ32 STM32 based boards is the PGM-NUCLEO programmer. It requires the ST-Link/V2(ST-Link/V2-1) USB Drivers. Just search the net for “st link usb drivers”. At the time of writing this, they were available here.

To check if drivers are installed, plug programmer into USB port on PC and go to “Device Manager” on Windows. The following should be listed:

  • “STMicroelectronics STLink Virtual COM Port …” under “Ports (COM & LPT)” section
  • “STMicroelectronics STLink dongle” under “Universal Serial Bus devices section

Note that the USB Driver application supplied by ST will NOT install the drivers on your computer! By default, it will create a “STMicroelectronics” folder in “Program Files (x86)” directory. This folder will contain the USB drivers for 32-bit and 64-bit operating system. You will have to install the correct driver on your system (located in ”..\Program Files (x86)\STMicroelectronics“ folder) to complete the installation.

Seeing that the PGM-NUCLEO programmer is actually the programming part of a NUCLEO-F411RE board, the Nucleo documentation is also relevant. Useful information can be found here, and on the NUCLEO-F411RE page on mbed.org (“Nucleo ST-LINK/V2 driver installation and firmware upgrade” section at bottom of page).

Importing Code

Importing library

To import a new library or source code is very simple:

  • Create a new folder in the root project directory. This will be the same directory as contains the “CoIDE” folder.
  • Place all library files in this new folder, normally this will be *.h, *.c and *.cpp files. Ensure this folder does NOT contain any “non source code” files and folders, like ”.hg“ or ”.git“ repository folders for example. It should only contains files and folders with source code.
  • Drag-and-drop(or copy-paste) this new folder into CoIDE project shown in “Project Explorer”. Ensure to drop(copy) to root of project.
  • A dialog box will open asking if you are sure you want to add folder to project. Click OK.
  • A new folder will now appear in the “Project Explorer” with the new source files.
  • Additionally we have to add this new folder to the include paths of compiler:
    • This is done in project configuration » “Compile”
    • Go to the “Includes Paths” section, where you can add the new directories to the Include path
    • You can either type the paths, or use the ”…“ button to browse your project.

Adding mbed library to project

There are many free libraries provided on mbed. For example, Modtronix provides many free libraries on our mbed project page. For this example we will import the modtronix_LCD2S library into our project:

  • Go to library page, located here for this example.
  • Click on “Download Repository zip” link. This will download zipped repository
  • Create a new folder in the root project directory called “modtronix_LCD2S”. The root project directory is the same directory as contains the “CoIDE” folder.
  • Copy the contents of the downloaded file to this new folder.
  • Ensure this folder does NOT contain any “non source code” files and folders, like ”.hg“ or ”.git“ repository folders for example. It should only contains files and folders with source code.
  • Drag-and-drop(or copy-paste) this new folder into CoIDE project shown in “Project Explorer”. Ensure to drop(copy) to root of project.
  • A dialog box will open asking if you are sure you want to add folder to project. Click OK.
  • A new folder will now appear in the “Project Explorer” with the new source files.
  • Additionally we have to add this new folder to the include paths of compiler:
    • This is done in project configuration » “Compile”
    • Go to the “Includes Paths” section, where you can add the new directories to the Include path
    • For this example, enter ”../modtronix_LCD2S“ and click “Add” button
tutorials/nz32/ide/coide-with-nz32-boards.txt · Last modified: 2016/09/18 22:44 by modtronix