Table of Contents

Toolchain Code::Blocks IDE Setup

  for MIOS application development on Windows



The technical jargon:
This is the Code::Blocks IDE section in a walkthrough on the process of developing MIOS Applications, on Microsoft Windows XP, primarily in C, utilising the MIOS C Wrapper but also in ASM. The IDE platform used will be Code::Blocks IDE or NotePad++ and the applications will be built for the MIDIBox Hardware Platform (MBHP) stuffed with a Microchip PIC18F. C code will be compiled with SDCC, and assembled with GPUtils, using MSYS to generate and run DOS-Console-based makefile scripts, and MIOS Studio will be used for debugging on MBHP. For PC emulation for debugging purposes, you may also use AC-Sim (AudioCommander's CSimulator) compiled with GCC from MinGW.

Enough of that.
You should have come here after the Core Tools setup. This part of the tutorial can actually be skipped completely if you wish. It contains setup instructions for an optional component of the toolchain. If you are going to be coding your apps only in C, then you only need to install this one last application, and your toolchain is complete. If you are not sure if this is you, then it isn’t…. Read on… You can always come back to this step later if you need to.

If you are not sure, and you have a few meg of diskspace to spare, I would recommend that you install this now, as Code::Blocks will automatically detect it's presence, which makes setup simple.



GDB (GNU DeBugger)

GDB is used to debug apps and is a must-have for MIOS development.




Code::Blocks IDE

Code::Blocks is a free yet powerful IDE. Highly recommended on Windows.

Install

The full Code::Blocks installer package is not recommended . We need to manually install and configure GDB (GNU DeBugger) and MinGW, which contains GCC - the GNU C Compiler. It is strongly recommended that you install these PRIOR to installing Code::Blocks If you've been following the three-part tutorial, then you're about right.

Code::Blocks

For our purposes, CodeBlocks latest nightly build version should be installed.

If there is an existing version installed, then delete the share\ dir, for example C:\Program Files\CodeBlocks\share\*.* before upgrading

:!: Note that these links sometimes change! They are usually (always!) in the first post of the thread for the Nightly Build. Get them from there!!

Configure

In order to use the GDB (GNU DeBugger) debugging features of Code::Blocks with AC-Sim (AudioCommander's C Simulator) you need to configure GCC to produce debugging symbols when compiling as follows:

This should be all that is needed to have the application itself ready to go!

Project Setup

Full instructions are below, but you may jump to the required section based on your requirements:

Project Setup - New Application

If you are creating a new application, you can simply download the MIOS SDCC Skeleton Application Template, extract it to your template directory, and start with that, and none of the below steps are necessary. This zip file does not change any of the functionality of the normal SDCC Skeleton App, so you can use it as normal, as well as with C::B. Here is a walkthrough:

You may want to visit the AC-Sim page to update your Simulator files!

Project Setup - Existing Application or Skeleton Creation

A C::B Project can be setup from either an existing MIOS C Application or the SDCC_Skeleton App as follows. You should have your application/skeleton in a dedicated folder.

Create Empty Project


Add Application files to project


#include "main.h"


Configure Build Targets

AC-SIM Build Target

You may skip this section if you do not need to use the simulator

MBHP Build Target

You should always perform the following sections to build the application for MBHP(your MIDIbox!)




At this point, I highly recommend selecting 'File… Save Project as user template', then you can use it as a quick starting point for all your awesome projects :)





AC-Sim Simulator

Setup

Follow the instructions at the AC-Sim WIKI page

Compile

Select the 'Debug' target, Click 'Build', and you're done!

Debug

Follow the instructions at the AC-Sim WIKI page

MBHP

Compile

Select the 'Release' target, Click 'Build', and you're done!

Debug

Well, that's up to you!





IDE Setup Complete

If you made it this far, you have done all you need to edit C based apps, including using AC-Sim. If you’re going to code in ASM, or you’re unsure, you may like to install another IDE like NotePad++. You won’t break anything. :)