For this tutorial you we will use an existing CMSIS compliant project, ready to compile and execute. We will guide you through the main steps towards executing a program on a microcontroller and monitoring it with the μVision debugger.
To get the best out of this tutorial you may decide to download the following support files. In exchange, we will ask you to enter some personal details. To read about how we use your details, click here. On the registration form, you will be asked whether you want us to send you further information concerning other Doulos products and services in the subject area concerned.
In order to familiarize ourselves with the basic operations and files required for the creation of a CMSIS compliant μVision project. We will start with a simple example of an 8 bit counter. In this tutorial, you will be asked to compile and run some existing code.
Two files have been added to the project to provide the bare necessities to remain CMSIS compliant. They are:
startup_stm32f10x_md.s : A template file provided by ARM and adapted by the silicon vendor to include interrupt vectors for all device specific interrupt handlers. Each interrupt handler is defined as weak function to a dummy handler. Therefore the interrupt handler can be directly used in application software without any requirement to adapt the <startup_device>.s file.
system_stm32f10x.c : A template file provided by ARM but adapted by the silicon vendor to match their actual device. As a minimum requirement this file must provide a device specific system configuration function (SystemInit) and a global variable that contains the system frequency. It configures the device and initializes typically the oscillator (PLL) that is part of the microcontroller device. The SystemInit() function does not have to be invoked manually since it is called automatically as part of the startup sequence inside the startup_stm32f10x_md.s file.
This concludes the first tutorial of the series. In the next tutorial we will look at retargeting C functions to implement our very own semi-hosting solution via the Cortex-M3 ITM.