MCBSTM32C User's Guide: MCBSTM32C User's Guide

Keil, An ARM® Company MCBSTM32C User's Guide

The MCBSTM32C User's Guide describes the MCBSTM32C Evaluation Board and contains detailed operating instructions for the hardware.

  • Introduction gives an overview of the MCBSTM32C Board, the features, hardware and software requirements, where to find information quickly, and where to find Technical Support.
  • Setup shows the MCBSTM32C Board components, how to connect, configure, and use the board, and describes the jumpers.
  • Theory of Operation explains the components of the MCBSTM32C board in detail.
  • Writing Programs describes how to write programs, download to flash, and configure your project for debugging for the MCBSTM32C board.
  • Example Programs lists the example programs available on the installation CD and on the Keil website. There are step-by-step instructions on building and running the BLINKY example programs.

Revision History

  • Februray 2012: Revised.
  • September 2010: enhanced - Technical Data, Power Supply, USB Interface.
  • June 2009: Initial revision.

Copyright © Keil, An ARM Company. All rights reserved.


MCBSTM32C User's Guide: Debugging with ULINK

Debugging with ULINK

Follow these steps to program debugging using the µVision Debugger and the ULINK USB-JTAG Adapter. Detailed information can be found in the µVision User's Guide in the Creating Applications chapter.

  1. Connect the ULINK to the JTAG connector of the MCBSTM32C Board. Note that the red cable marks pin 1 of the JTAG-connector.

    MCBSTM32C Board with ULINK2

  2. Power up the MCBSTM32C Board.
  3. Configure the Debugger in the Project — Options for Target — Debug dialog.

    Options for Target Button Use the Options for Target toolbar button and click the Debug tab to display the Debug dialog.

    Use: ULINK ARM Debugger Select Use: and ULINK Cortex Debugger in the drop-down to choose the ULINK USB-JTAG Adapter as the debugging tool.

    Debug Load & Run Options Check the Load Application at Startup and the Run to main() options to load your application and execute code up to the beginning of your main() function when the debugger starts.

  4. Click the Settings button to open the Cortex-M Target Driver Setup dialog.

    This dialog displays the IDCODE of the ARM device on the MCBSTM32C Board.

    JTAG Interface Options Check the SWJ checkbox and select the SW option under Port to use the Single Wire mode interface. Max Clock should be set to 1MHz.

    Download Options Select the Verify Code Download option under Download Options to compare the loaded application program with the Flash ROM content. You may disable this option to speed up the debugger start.

  5. Start the Debugger.

    Start/Stop Debug Button Use the Start/Stop Debug Session toolbar button to start debugging the program.

    Or

    Use the µVision command, Debug — Start/Stop Debug Session, to start debugging the program.


MCBSTM32C User's Guide: Debugging Programs

Debugging Programs

µVision IDE offers a very powerful and comprehensive set of debugging tools designed to make program testing easier and reduce the time it takes to produce a working application.

The required steps for configuring the debugger on the MCBSTM32C board are described in the topic Debugging with ULINK.

You may debug your application software via the CoreSight debug port, for example, by connecting the Keil ULINK USB-JTAG Adapter to the JTAG interface.

Using the µVision debugger and the CoreSight debug port capability of the MCBSTM32C, you may set breakpoints and step through your code, and also view the status of on-chip peripherals using the Peripheral dialogs custom-designed for the STM32F107VC device.


MCBSTM32C User's Guide: BLINKY

BLINKY

The BLINKY example program toggles the LEDs on GPIO1 and prints the converted A-to-D value to the serial port. The toggle speed of the LEDs depend on the input voltage of the ADC1 input.

The BLINKY example project demonstrates assembling, compiling, linking, downloading, and debugging using the µVision IDE on the MCBSTM32C board. The on-board LEDs make it easy to visually verify that the program loads and executes properly. The HyperTerm terminal emulator program makes it easy to verify serial output.

Loading BLINKY

To load the BLINKY project, select Open Project from the Project menu and open BLINKY.UV2 from the following folder:

  • \KEIL\ARM\BOARDS\KEIL\MCBSTM32C\BLINKY\

Open Project dialog

Project Workspace When the BLINKY project opens, the µVision Project Workspace window displays the source files that make up the project.

  • STM32F10x.s contains the CPU startup code for the STMicroelectronics STM32F10x devices.
  • STM32F10xOPT.s configures Flash options.
  • Retarget.c configures the target-dependent low level functions for character I/O.
  • Serial.c, contains the functions to communicate to the serial port.
  • GLCD.c, contains the functions to produce text and graphics for the LCD display.
  • STM32_Init.c contains the initialization routines for the on-chip peripherals.
  • Blinky.c contain the application modules that monitors analog input, provides the text output, and toggles the LEDs.

The Abstract.txt file contains documentation about the project.

Editing BLINKY

You may edit Blinky.c or review the source code. Double click on Blinky.c in the Files page of the Project Workspace window. µVision loads and displays the contents of Blinky.c in an editor window.

Running BLINKY

Perform the following four steps to run the BLINKY Example on the MCBSTM32C Evaluation Board:

  1. Building BLINKY
  2. Downloading BLINKY
  3. Debugging BLINKY
  4. Checking Serial Output


MCBSTM32C User's Guide: Building BLINKY

Building BLINKY

Build the BLINKY example program following this procedure. The executable files are placed in an output folder, ready for downloading.

Build Target Button When you are ready to compile and link your project, use the Build Target command from the Project menu or the Build toolbar. On the Build toolbar, select the appropriate target for your program.

µVision translates and links the source files and creates an absolute object module that you may load into the µVision debugger for testing. The status of the build process displays in the Build page of the Output Window.

Once the BLINKY application is built, if you selected the STM32 Flash target, proceed with the Downloading step. If the STM32 RAM target is selected, go directly to the Debugging step.

Note

  • You should not encounter any errors when you use µVision with the provided sample projects.


MCBSTM32C User's Guide: Debugging BLINKY

Debugging BLINKY

Debug the BLINKY example program following this procedure. The debugged program is ready for the serial output check.

Start/Stop Debug Button Use the Start/Stop Debug Session toolbar button or the µVision command Debug — Start/Stop Debug Session to connect the debugger to the Keil ULINK Adapter. The CPU stops and connects to the CoreSight debug port of the STM32F107VC device. For more details on the debugging features, refer to the µVision User's Guide.

The Peripherals menu allows you to open different dialogs for Peripheral units on the STM32F107VC devices. You may view and/or change the state and configuration of on-chip Peripherals using these dialogs.


MCBSTM32C User's Guide: Downloading BLINKY

Downloading BLINKY

When the BLINKY build is complete, you may download the application to the on-chip Flash ROM using the Keil ULINK USB-JTAG Adapter.

Download to Flash Button Click the download button

When you use the Download command for the first time, you must configure the Flash options under Project — Options for Target — Utilities as described in Downloading to Flash.

After configuration, the Flash — Download command uses the Keil ULINK USB-JTAG Adapter for Flash programming.

The BLINKY application starts executing when you press RESET on the MCBSTM32C board to verify the program downloaded.

Note

  • You may enable the option Update Target before Debugging to download the BLINKY project whenever you start a Debug Session.

The downloaded program is ready for debugging.


MCBSTM32C User's Guide: Checking Program Output

Checking Program Output

To check the program output from the BLINKY program, start the program running either from the debugger via JTAG or by cycling power on the board. The LCD panel initially displays the following message:

MCB-STM32C DEMO
www.keil.com

After a few seconds, the fifth line of the LCD displays a bar graph that reflects the current potentiometer setting.

Checking Serial Output

To check the serial output from the BLINKY program, connect a serial cable from the DB9 connector labelled COM on the board to an unused COM port on your development PC. Use a terminal emulation program, such as Microsoft Windows HyperTerminal, to display the serial data on your PC monitor.

To start the Microsoft Windows HyperTerminal application, select Start — Programs — Accessories — Communications — HyperTerminal.

  1. Enter a Name for the new connection, for example: MCBSTM32.

    HyperTerm Connection Description Dialog

  2. Select the PC COM port COM1 in Connect Using.

    HyperTerm Connect To Dialog

  3. Select 115200 Bits per second, 8 Data bits, Parity None, Stop bits 1 and Flow control None.

    HyperTerm Properties Dialog

  4. Click OK. The serial message containing the measured analog value of the A-to-D converter value continuously displays in the HyperTerminal window, as shown below.

    HyperTerm screen showing AD results


MCBSTM32C User's Guide: Example Programs

Example Programs

The Keil MDK-ARM Development Tools download includes several example programs that are configured for the Keil MCBSTM32C Board.

All examples are configured for two µVision targets:

  • Simulator - where the program runs in the software simulator.
  • MCBSTM32C - where the program runs from internal Flash located on the microcontroller.

All examples use the same file structure:

  • Abstract.txt contains a short description of the example.
  • system_stm32fxxx.s contains the startup code for the microcontroller.
  • Example dependent source code.

Note

  • STMicroelectronics provides a firmware library with sample code (C sources) but the examples described here do not use this library (except LCD driver) to keep the executable as small as possible.

Each example program is stored in a separate folder in \KEIL\ARM\BOARDS\KEIL\MCBSTM32C\ along with project files that help you quickly build the project and run the program.

The following example program is installed automatically:

  • BLINKY
    The Blinky project shows the combination of configuring peripherals via STM32_Init.c and own initialization functions. GPIO, USART and timer are configured via STM32_Init.c. DMA and ADC are set up with a seperate initialisation function. The LEDs blink with a speed depending on potentiometer position. SysTimer is used in interrupt mode and ticks every 10ms. The color LCD display shows init message and bargraph depending on potentiometer position. AD value is output onto serial port USART2 (115200 baud, 8 data bits, no parity, 1 stop bit) and LCD. AD is used with DMA and 12 bit resolution.

Note

  • More example projects and programs are available for Keil MCBSTM32 Board and it is easy to port these examples to Keil MCBSTM32C Board. Main difference between the boards are the LCD, the Push Buttons which are connected to different GPIO Ports and the use of an other USART.


MCBSTM32C User's Guide: Programming Flash

Programming Flash

The MCBSTM32C board supports downloading programs to Flash memory using the ULINK USB-JTAG adapter through the JTAG connector.

MCBSTM32C Board Connected to ULINK2

The ULINK USB-JTAG interface also supports emulation and debug capabilities for the MCBSTM32C board.


MCBSTM32C User's Guide: Downloading to Flash

Downloading to Flash

Download using the Keil ULINK JTAG-Adapter. The steps to setup ULINK for Programming Flash within µVision IDE are:

  1. Connect the ULINK to the JTAG connector of the MCBSTM32 Board. Note that the red cable marks pin 1 of the JTAG-connector.

    MCBSTM32C connected to ULINK2

    Note

    • The JTAG interface could be disabled by random CPU instructions or by the power-down mode of the device. If this occurs, enable the on-chip boot loader, so the STM32F10x device can execute a valid program.
      For more information refer to the web-based Keil Support Knowledgebase, for example to the article ULINK: RECOVER STR71X WHEN JTAG DISABLE.
  2. On the MCBSTM32C board, make sure the BOOT0 jumper is set to the GND position. When BOOT0 is grounded, the position of the BOOT1 jumper does not matter.
  3. Power up the MCBSTM32C Board.
  4. Configure Flash Programming in the Project — Options for Target — Utilities dialog.

    Use Target Driver Option Set the Use Target Driver for Flash Programming option, then select the ULINK Cortex-M3 Debugger as the Flash programming tool.

    Update Target Option Check the Update Target before Debugging option to ensure that the Flash ROM gets programmed whenever the debugger starts.

    Settings Button Click the Settings button to open the Flash Download Setup dialog for the next step.

  5. Configure the Flash Download Setup dialog as follows:

    Flash Download Function Set the Download Function options by first selecting Erase Sectors used by the application, then check Program and Verify to verify the Flash contains the downloaded application.

    RAM for Algorithm Setting Set the Start location for for the flash programming algorithm to 0x2000000 in RAM and set the Size to 0x0800.

    Programming Algorithm Click the Add button and find the STM32F10x 512kB Flash programming algorithm in the list of available algorithms. Select it, then click the Add button to add it to your target.

    Finally, click the OK button to save the Flash Download settings.

  6. Download to Flash

    Download To Flash Button Click the Download to Flash toolbar button. This executes the Flash download program (Target Driver or External) selected in Project — Options for Target — Utilities and downloads the application program into the STM32F107VC device.

    Or

    Use the µVision command Flash — Download to download the application program into the STM32F107VC device.

ULINK can be also used for application code debugging in Flash ROM or RAM of the STM32F107VC microcontroller.


MCBSTM32C User's Guide: Kit Contents

Kit Contents

The MCBSTM32C kit includes:

  • The MCBSTM32C Evaluation Board.
  • A µVision IDE Quick Start Guide.
  • Example Programs for the MCBSTM32C Evaluation Board are located in the folder KEIL\ARM\BOARDS\KEIL\MCBSTM32C. All examples can be compiled and debugged using the Lite Edition.


MCBSTM32C User's Guide: Features

Features

The connectors on the evaluation board provide easy access to many of the STM32F107's on-chip peripherals.

  • Serial Port
    A standard DB9 connector is on the board for the STM32F107's built-in UART interfaces. This is a full duplex, serial port.
  • CAN Ports
    2 standard DB9 connectors for applications requiring CAN communications.
  • USB Port
    A standard USB Type B connector for USB communications applications.
  • 100/10M Ethernet Port
    A standard RJ45 connector on the MCBSTM32C board connects to an on-board Ethernet transceiver for applications requiring Ethernet communications.
  • LCD Display with Touch Screen
    A detachable, 240x320 TFT, color LCD display with 4-wire, resistive touch screen. You may use this graphic display device to show real-time debug and program status messages.
  • Stereo CODEC and Amplifier
    A low-power stereo CODEC with headphone and microphone amplifier. You may use this on-board device for audio applications.
  • Motion Sensor
    A low-power, 3-axis accelerometer via I2C/SPI interface. You may use this on-board device for applications requiring the detection of movement.
  • On-board Battery
    A removable, lithium battery is included on the MCBSTM32C to maintain power to the real-time clock when the board disconnects from the main power supply.
  • Analog Voltage Control for ADC Input
    An adjustable analog voltage source for testing the Analog to Digital converter built into the STM32F107 device.
  • MicroSD Card Connector
    A MicroSD Card connector for developing applications requiring access to MicroSD Cards.
  • JTAG and Cortex/ETM Download and Debug
    The MCBSTM32C board incorporates both a JTAG interface and a Cortex Debug + ETM interface. When coupled with the ULINK2 USB-JTAG adapter, the Serial Wire JTAG interface allows flash programming and debugging. With the ULINKPro adapter, the Cortex Debug/ETM interface allows flash programming and instruction trace debugging.


MCBSTM32C User's Guide: Hardware Requirements

Hardware Requirements

To use the MCBSTM32C Evaluation Kit, you need:

  • The MCBSTM32C Evaluation Board.
  • A PC with:
    • One USB port for downloading and debugging.
    • Another USB port to provide power to the board.

To download and debug, one of the following:

  • A Keil ULINK USB-JTAG Adapter (JTAG only — no Serial Wire mode).
  • A Keil ULINK2 USB-JTAG Adapter.
  • A Keil ULINK-ME USB-JTAG Adapter.

Plus:

  • 1 USB A-B cable for connecting the ULINK adapter.
  • 1 USB A to Micro A cable or USB A to Micro B cable to power the board.


MCBSTM32C User's Guide: Quick Start

Quick Start

Use the following table to locate important information about the MCBSTM32C board and get started quickly.

To… | See…
Connect power to the MCBSTM32C board. | Setup
Connect the MCBSTM32C via ULINK/JTAG to your PC. | Connecting the MCBSTM32C
Read about the default configuration settings. | Configuring the MCBSTM32C
Configure the tool options for the MCBSTM32C board. | Writing Programs
Learn more about µVision IDE. | µVision User's Guide
Review the MCBSTM32C schematics. | MCBSTM32C Schematics


MCBSTM32C User's Guide: MCBSTM32C Starter Kit

MCBSTM32C Starter Kit

The MCBSTM32C starter kit is the ideal way to begin working with the STM32 devices from STMicroelectronics.

MCBSTM32C Board with ULINK-ME

The starter kit includes:

  • MCBSTM32C Evaluation board
  • ULINK-ME USB-JTAG adapter
  • MDK-ARM (evaluation software)

These tools help you get started writing programs and testing the microcontroller and its capabilities. Example applications which run on the MCBSTM32C are included.

Note:

  • All references to ULINK or ULINK2 in this document apply to the ULINK-ME USB-JTAG adapter.


MCBSTM32C User's Guide: Software Requirements

Software Requirements

You must install the following required software to use the MCBSTM32C Evaluation Board:

Windows Operating System

The Keil µVision tool chain runs in these Windows Operating Systems:

  • Microsoft Windows 2000
  • Microsoft Windows XP
  • Microsoft Windows Vista

Tools and Examples

To compile, link and run applications on the MCBSTM32C Evaluation Board, you must install these Keil products:

  • The MDK-ARM which includes the µVision Debugger and provides several example programs for the MCBSTM32C Board.
  • The STM32F10x Software Library which provides a software foundation for the STM32F10x peripherals.

Optional

  • The RL-ARM Real-Time Library which includes the RTX Real-Time Kernel, TCP/IP Protocol Suite, Flash File system, CAN Driver, and USB Driver. You may use this package to implement applications that connect by CAN, or USB.


MCBSTM32C User's Guide: Introduction

Introduction

You may use the Cortex-M3 based MCBSTM32C Evaluation Board to generate and test application programs for the STMicroelectronics STM32F107x microcontroller family. With this hands-on process, you can determine the hardware and software requirements for current and future product development.

The MCBSTM32C Evaluation Board ships with the STM32F107VC device that is a superset of several other device variants of the STM32F107x microcontroller series. The MCBSTM32C Board contains all the hardware components required in a single-chip STM32x system.


MCBSTM32C User's Guide: Theory of Operation

Theory of Operation

The Theory of Operation explains the MCBSTM32C board hardware. The descriptions help you to understand the MCBSTM32C board components and how to use the available I/O interfaces.

The MCBSTM32C is designed to be a very flexible evaluation board for the STMicroelectronic STM32F10x device series. The MCBSTM32C evaluation board can be expanded to build hardware prototypes.


MCBSTM32C User's Guide: Keil MDK-ARM

Keil MDK-ARM

To use the MCBSTM32C Board download the Lite Edition of the Keil Microcontroller Development Kit (MDK-ARM). The MDK-ARM Lite Edition includes:

  • Powerful and easy-to-use µVision IDE that includes editor, project management, and make capability.
  • µVision Debugger with complete CPU, peripheral simulation, and driver for the Keil ULINK USB-JTAG Adapter.
  • ARM Compilation Tools that include ANSI C/C++ Compiler and related utilities.
  • RTX RTOS Kernel for the ARM Compiler.
  • STM32F10x Software Library ported for the ARM Compilation Tools.
  • Extensive tutorials and documentation.

The restrictions for the MDK-ARM Lite Edition are:

  • The image ROM size of the generated application is limited to 32KB maximum.
  • The base address for code/constants is restricted to 0xXX000000, 0xXX800000, or 0x00080000 whereby XX stands for 00, 01, ..., FF. This allows memory start address like 0x00000000, 0x12800000 and so on.
  • It is not possible to generate position independent code or data.
  • The compiler does not generate a listing file.


MCBSTM32C User's Guide: Application Notes

Application Notes

Keil Software provides numerous Application Notes that discuss solutions to special problems. These are available on the Keil web site at: http://www.keil.com/appnotes/

Application Notes are available for topics like CAN and Ethernet Programming, Complex Device Simulation, and many more.


MCBSTM32C User's Guide: Writing Programs

Writing Programs

The Writing Programs topics introduce you to the Keil development tools and show you, step-by-step, the process of using them with the MCBSTM32C board. You will learn how to use µVision to create, compile, download, debug, and run a program on the MCBSTM32C board.

Writing programs for the MCBSTM32C board is easy.

  1. Create the Application Program using µVision IDE and the ARM C/C++ Compiler.
  2. Download the program to the on-chip Flash of the MCBSTM32C Board.
  3. Debug the program using the µVision Debugger and ULINK.

Note

  • Use the Keil MDK-ARM Lite Edition if no other version is installed on the computer.


MCBSTM32C User's Guide: Setup

Setup

Setting up the MCBSTM32C evaluation board is easy. Explanations for the board setup and its components are presented here. Details about the connecting and configuring procedures for the MCBSTM32C board are also presented, with a separate topic for the jumper descriptions. Setup includes using the MCBSTM32C board with ULINK.

The MCBSTM32C board requires a power connection and a ULINK-USB adapter between your development PC and the JTAG connector.

Before you start, make sure you have satisfied the hardware and software requirements.


MCBSTM32C User's Guide: Board Setup

Board Setup

The MCBSTM32C Evaluation Board is a USB-powered device.

MCBSTM32C Board Connected to ULINK2

The MCBSTM32C Evaluation Board connects directly to the Keil µVision Debugger using the Keil ULINK USB-JTAG Adapter, so no additional software is required on the board.

The MCBSTM32C Evaluation Board connects to a PC via either:

  • A USB A to Micro A cable, or
  • A USB A to Micro B cable.

Either of these cables provides power to the board and USB communication.


MCBSTM32C User's Guide: Board Components

Board Components

The following illustration shows the important interface and hardware components of the MCBSTM32C board.

MCBSTM32C Board Components


MCBSTM32C User's Guide: Configuring the MCBSTM32C

Configuring the MCBSTM32C

The MCBSTM32C Evaluation Board is configured using 3 sets of jumpers. The MCBSTM32C Board ships with the following configuration:

Power Jumper

Jumper | State | Description
VDD J4 | ON1 | Provides 3.3VDC to the VDD pins of the STM32F107VC device.

Boot Config Jumpers

BOOT1 | BOOT0 | Mode | Description
---- | GND1 | User Flash | Maps User Flash to boot space.
GND | BOOT0 | System Memory | Maps System Memory to boot space.
BOOT1 | GND | n/a |
BOOT1 | BOOT0 | Embedded SRAM | Maps on-chip SRAM to boot space.

Audio Jumpers

Jumper | State | Description
J1 | ON1 | Connects selected microphone bias level to the AIN3B microphone input.
J3 | ON1 | Connects selected microphone bias level to the AIN3A microphone input
J5 | ON1 | Selects the speaker for audio output.

1 Factory setting of MCBSTM32C: User Flash Boot Mode; user code execution from on-chip Flash ROM, and USB is not detected.


MCBSTM32C User's Guide: Connecting the MCBSTM32C

Connecting the MCBSTM32C

To use the MCBSTM32C Evaluation Board with ULINK, you must:

  • Connect the ULINK adapter to the JTAG connector of the MCBSTM32C board.
  • Connect the ULINK adapter to the PC via a standard USB cable.
  • Connect power from your PC to the board using either a USB A to Micro A or USB A to Micro B cable.
  • Set the JTAG clock for your ULINK adapter.

The following picture shows how to connect ULINK to the MCBSTM32C board.

MCBSTM32C Board Connected to the ULINK2 JTAG Adapter


MCBSTM32C User's Guide: Setting the JTAG Clock

Setting the JTAG Clock

To get the best performance from your ULINK JTAG adapter, it's important to set the JTAG clock rate for the MCBSTM32C board. The following steps show you how this is done.

  1. Power up the MCBSTM32C Board.
  2. In µVision, Configure the Debugger in the Project — Options for Target — Debug dialog.

    Options for Target Button Use the Options for Target toolbar button and click the Debug tab to display the Debug dialog.

    Use: ULINK ARM Debugger Select the Use: radio button and then ULINK Cortex-M3 Debugger in the drop-down list to choose the ULINK USB-JTAG Adapter as the debugging tool.

  3. Click the Settings button to open the Cortex-M Target Driver Setup dialog.

    Target Driver Setup - ULINK2 Adapter Select the SW option from the Port: drop-down list to use the Serial Wire JTAG interface of the Cortex-M3 device.

    Since the Cortex-M3 device supports both JTAG and Serial Wire modes, check the SWJ checkbox.

    The Max Clock drop-down list sets the highest JTAG clock rate used to communicate to the target board. When using a ULINK2 or ULINK-ME adapter, the 1MHz setting works best with the MCBSTM32C board.


MCBSTM32C User's Guide: Jumper Descriptions

Jumper Descriptions

The jumpers used to configure the MCBSTM32C board are:

  • VDD J4: Connects the 5 VDD inputs on the STM32F107VC to 3.3VDC.
  • BOOT0: Either grounds or drives the BOOT0 signal high.
  • BOOT1: Either grounds or drives the BOOT1 signal (PB2) high.
  • J1: Connects a pre-set microphone bias voltage to the AIN3B microphone input.
  • J3: Connects a pre-set microphone bias voltage to the AIN3A microphone input.
  • J5: Grounds the headphone detect switch (SPK/HP_SW) enabling the on-board speaker.

The BOOT0 and BOOT1 jumpers configure the microcontroller startup (boot) mode. This setting tells the microprocessor the location (User Flash, System Memory or Embedded SRAM) of the boot code.

MCBSTM32C Board Jumpers


MCBSTM32C User's Guide: Accelerometer

Accelerometer

The MCBSTM32 board includes a low-power, 3-axis STMicroelectronics LIS302DL accelerometer at location IC11. It is controlled using an I2C/SPI serial interface connected to pins on the PB and PD ports.

MCBSTM30 Board Accelerometer


MCBSTM32C User's Guide: Block Diagram

Block Diagram

The hardware block diagram displays the input, configuration, power system, and User I/O on the board. This visual presentation helps you to understand the MCBSTM32C board components.

MCBSTM32C Block Diagram


MCBSTM32C User's Guide: Push Buttons

Push Buttons

The four push buttons on the MCBSTM32C board are:

  • The User (S1) push button connects to port pin PB7 of the STM32F107VC device and is available for general use.
  • The Tamper (S2) push button connects to port pin PC13 of the microcontroller controlling the anti-tamper feature of the STM32F107VC device.
  • The Wakeup (S3) push button connects to port pin PA0 of the microcontroller. This wakes up the microcontroller out of sleep mode.
  • The Reset (S4) push button connects to the voltage monitor and the power-up reset circuit. This resets the microcontroller.

MCBSTM32C Board Buttons


MCBSTM32C User's Guide: CAN Interface

CAN Interface

The dual CAN Interface uses the SN65HVD230 (marked as VP230) CAN driver at IC1 (CAN1) and IC4 (CAN2) and termination resistors at R2 and R4, respectively, on the MCBSTM32C board.

MCBSTM32C Board CAN Interface

The CAN DB9 connectors are wired so that Pin 2 provides the CANL signal and Pin 7 provides the CANH signal. These pins are connected to a SN65HVD230 CAN driver.

MCBSTM32C CAN DB9 Connector

Note

  • CAN termination resistors make it easy to connect the MCBSTM32C board to your CAN network but they are not always required. When connecting the MCBSTM32C Board to a CAN network, you may need to remove the termination resistor.


MCBSTM32C User's Guide: Configuration

Configuration

The MCBSTM32C evaluation board is very flexible and configures easily to suit your needs. Configuration jumpers control the built-in features such as debug interfaces, CAN driver, and Analog Input Voltages.

Refer to Configuring the MCBSTM32C and Jumper Descriptions for descriptions of the possible settings.

After changing configuration jumpers, you must reset the MCBSTM32C board.

Note

  • The STM32F107VC device provides many configuration options. Some of these settings are available using configuration resistors which are illustrated in the Schematics topic.


MCBSTM32C User's Guide: Microcontroller

Microcontroller

The STMicroelectronics STM32F107VC microcontroller (IC2) provided with the MCBSTM32C board is a high-end STM32F107x device with on-chip CAN and USB.

A 25.0 MHz oscillator provides the clock signal for the MCU.

MCBSTM32C Board MCU


MCBSTM32C User's Guide: External EEPROM

External EEPROM

The MCBSTM32C board contains an STMicroelectronics M24C64 64K-bit serial I2C bus EEPROM located at IC9. It is accessible via port pins PB8 and PB9.

MCBSTM32C Board EEPROM


MCBSTM32C User's Guide: Ethernet Interface

Ethernet Interface

The Ethernet Interface on the MCBSTM32C board uses the 10/100 Fast Ethernet 3.3V National Semiconductor DP83848 (IC5).

MCBSTM32C Board - Ethernet Interface


MCBSTM32C User's Guide: ETM Interface

ETM Interface

The ETM Interface connector provides instruction-level trace debugging support for the STRM32F107VC device.

MCBSTM32C Board ETM Connector

A 20-pin header (Samtec FTSH-120) is included at location P4 for connecting to ETM Trace hardware.

20-pin ETM Trace Connector Pin Identification


MCBSTM32C User's Guide: Joystick

Joystick

The 5-position joystick control on the MCBSTM32C board grounds one of 5 possible port pins depending on how the the joystick control handle is positioned. The control may be positioned left, right, up, down or pushed toward the board (select).

  • The Left joystick position connects to port pin PD15 of the STM32F107VC device to ground.
  • The Right joystick position connects to port pin PD13 of the STM32F107VC device to ground.
  • The Up joystick position connects to port pin PD12 of the STM32F107VC device to ground.
  • The Down joystick position connects to port pin PD14 of the STM32F107VC device to ground.
  • The Select joystick position connects to port pin PD11 of the STM32F107VC device to ground.

MCBSTM32C Board Joystick


MCBSTM32C User's Guide: JTAG Interface

JTAG Interface

The JTAG Interface connector provides debugging and emulator support for the STM32F107VC device. The JTAG Interface allows application debugging and programming of on-chip and off-chip Flash devices.

MCBSTM32C Board JTAG Connector

The standard JTAG 20-pin connector works with the Keil ULINK and many third party tool vendors. The Cortex Debug connector works with the Keil ULINK2 adapter.

Cortex Debug and JTAG Pin Identification

Serial Wire Mode Interface

The MCBSTM32C board also supports the Serial Wire Mode of Cortex-M3 based devices. In Serial Wire mode, only the pins TCLK and TMS are used. TDO is an optional trace data output pin.


MCBSTM32C User's Guide: LCD Panel w/Touch Screen

LCD Panel w/Touch Screen

The LCD-TFT color graphics display panel (AMPIRE AM240320L8TNQW) contains a 240x320 pixel screen and connects using a 16-bit interface. The LCD panel is mounted on the MCBSTM32C Display Board, and connects to MCBSTM32C Base Board via 30-pin header.

This LCD panel includes a 4-wire, resistive touch screen controlled by an STMicroelectronics STMPE811 touch screen controller (IC2).

MCBSTM32C LCD Panel


MCBSTM32C User's Guide: LEDs

LEDs

The MCBSTM32C board has the following LED indicators:

  • The VBUS LED indicates USB activity.
  • The POWER LED indicates that power is present on the board.
  • The OVC LED indicates the 500mA USB output current limit has been exceeded.
  • The 8 Port LEDs marked PE.8 - PE.15 connect to their respective port pins when jumper LED is installed. These LEDs are useful for indicating program status while testing your applications.
  • The ORANGE LED (right/lower) on the Ethernet connector indicates LAN traffic is present.
  • The GREEN LED (left/upper) on the Ethernet connector indicates a good link connection to the LAN.

MCBSTM32C Board - LEDs


MCBSTM32C User's Guide: Microphone

Microphone

The MCBSTM32C board includes a standard stereo microphone mini-connector for input to the on-board Cirrus CS42L52 CODEC. Installing jumpers J1 and J3 applies a bias voltage separately to the left and right microphone inputs (AIN3A and AIN3B). The bias voltage (MICBIAS) value is a software configurable parameter within the CODEC.

MCBSTM32C Board - Microphone


MCBSTM32C User's Guide: Potentiometer

Potentiometer

The potentiometer on the MCBSTM32C board connects to port pin PC4 (ADC12_IN14). The voltage range is 0.0-3.3 Volts.

MCBSTM32C Board Potentiometer


MCBSTM32C User's Guide: Power Supply

Power Supply

The MCBSTM32C Board can be powered through two different connectors:

  • USB: the board is supplied automatically with 5 V when connected to a PC through a USB A to Micro B cable. The STM32 microcontroller can use the USB interface as a USB device.
  • VIN: when connected through a VIN connector, a voltage between 5.0–5.5 VDC must be used. A voltage of 5.5 VDC is necessary when the USB interface is used as USB host or as USB OTG. In these cases, the USB interface can supply other USB devices with 5 VDC. The STMicroelectronics STMPS2141 power-switch at IC14 protects the USB power interface from overcurrent.

The voltage regulators IC3 and IC12 generate 3.3 Volts DC, the IC13 generates 2,5 Volts DC to supply all components on the board.

The POWER LED indicates that +5 Volts DC are present on the board.

The OVC LED illuminates when the USB interface is configured as host and an overcurrent occurs.

MCBSTM32C Board Power Connector


MCBSTM32C User's Guide: Prototyping Area

Prototyping Area

The provides blocks for connecting the address and data lines, and ports PA, PB, PC, PD, PE and VREF+, VDD, Reset, 3.3VDC and ground. It also provides an area (located under the LCD display board) for adding prototype circuits and components.

MCBSTM32C Board Prototyping Area

Note

  • All microcontroller signals are brought out to pins and are driven directly by the microcontroller. Exercise caution to avoid overloading these signal lines.


MCBSTM32C User's Guide: Schematics

Schematics

The MCBSTM32C Evaluation Board consists of a Display Board mounted to the Base Board. Detailed Base Board schematics and Display Board schematics are available in large format on the MCBSTM32C Evaluation Board information section of the Keil web site.

MCBSTM32C Base Board Schematics

MCBSTM32C Base Board Schematics
MCBSTM32C Base Board Schematics
MCBSTM32C Base Board Schematics
MCBSTM32C Base Board Schematics

MCBSTM32C Display Board Schematics

MCBSTM32C Display Board Schematics

Copyright © Keil, An ARM Company. All rights reserved.


MCBSTM32C User's Guide: MicroSD Connector

MicroSD Connector

The MCBSTM32C board supports one MicroSD memory card connector that allows you to connect MicroSD memory cards.

MCBSTM32C MicroSD Connector


MCBSTM32C User's Guide: Serial Port

Serial Port

The MCBSTM32C board connects the on-chip serial UART to the ST3232 (IC7), which converts the logic signals to RS-232 voltage levels.

MCBSTM32C Board Serial Port

The serial port (COM) is configured as a standard 5-wire interface. The DB9 connector is wired directly to the ST3232 serial UART. Refer to the figure below for details.

Serial Port DB9 Diagram


MCBSTM32C User's Guide: Speaker/Headphone

Speaker/Headphone

The MCBSTM32C board includes a speaker controlled by the low power stereo CODEC amplifier (IC6).

Jumper J5 controls speaker and headphone output from the CODEC amplifier. Installing Jumper J5 enables the speaker and disables the headphone jack. Removing Jumper J5 disables the speaker and enables the headphone jack.

MCBSTM32C Board Speaker


MCBSTM32C User's Guide: Technical Data

Technical Data

Parameter | Description
Supply Voltage | 5 Volts DC (provided by the USB bus of a PC), or VIN: 5.0–5,5 Volts DC from an external power supply. Use 5.5 Volts when the board is used as USB host or USB OTG.
Supply Current | 180mA typical, 200mA maximum
XTAL Frequency | 25 MHz
Microcontroller | STMicroelectronics STM32F107VC
Peripherals | 1 × RS232 Interface, 2 × CAN Interfaces, 1 × USB Interface, 1 × Ethernet Interface, 1 × Color graphic display (240x320), 1 × MicroSD Memory Card connector, 1 × JTAG Interface, 1 × Cortex/ETM Interface, 4 × Push buttons (Reset, Wake Up, Tampering, User), 1 × Joystick (5-position), 1 × Analog Input (connected to potentiometer), 1 × Low power, Stereo CODEC (with headphone, speaker, and microphone support)
Board Size | 120mm x 120mm (4.75" x 4.75").


MCBSTM32C User's Guide: USB Interface

USB Interface

The MCBSTM32C board can work as:

  • USB Device: In this mode, usually, a USB A to Micro B cable is used to connect to a PC. The board can be powered through the USB interface.
  • USB Host or USB OTG: In these modes, usually, a Micro A USB cable is used to connect to a USB device or a USB OTG device. A USB host or USB OTG interface must be able to supply the connected USB device. Consequently, the board must be powered through the VIN connector, which must be strong enough to supply the board and the connected USB device. The USB power supply is switched with the IC14 (STMPS2141), which also guards the maximum current consumption.

MCBSTM32C USB Connector

Note

  • The USB interface of the board can be connected through a USB Micro AB connector.


MCBSTM32C User's Guide: Building a Program

Building a Program

When the building a program function starts, you may watch the progress in µVision's Command window. The created executable files are placed in an output folder, ready for downloading. The steps and progress are:

  1. Start the build

    Build All Button Click on the Build toolbar button to generate your application program. µVision translates all your source files and links the project.

  2. Monitor progress

    The build activity progress (assembling, compiling and linking) displays in µVision's Command window. Any errors or warnings detected during the build process also display in this window.

    Target Build Output Window

  3. Program Files

    The build creates an Executable File in ELF Format which is placed in the Output folder that you designated earlier. When you use the ULINK USB-JTAG adapter, the ELF file is required to download to the MCBSTM32C board using the JTAG.

    The build creates an Intel HEX executable file which is placed in the same output folder for external program downloading through the serial port.

The program is now built and ready for test.


MCBSTM32C User's Guide: Creating a Project

Creating a Project

Follow the steps below to create a new project file and to specify and organize your source (and debug) files that are a part of this project.

  1. Select the ARM Toolset that you want to use for your project.
    The default configuration is the RealView Toolset and the information below is based on selecting the RealView Compiler.
  2. Create a New Project File with the µVision menu command Project — New — µVision Project.
    Select a microcontroller from the Device Database®. The MCBSTM32C Board comes with the ST STM32F107VC, however, you may also use it to develop code for other STM32F10x device variants, since the STM32F107VC represents a superset of several other STM32F10x devices.
  3. Add Startup Code from the folder ..\ARM\STARTUP\ST to your project. After selecting, µVision prompts with the following dialog:

    'Copy STM32F10x.s Startup Code' Dialog

    Answer Yes since this startup code works with most STM32F10x projects.

  4. Add your own Source Code to the project using the µVision editor (or any editor of your choice) by either:
    • Right clicking the mouse in the Project Window on a group and select Add Files to Group from the context menu.

    • Or

    • Opening the Project — Components, Environment and Books — Project Components dialog.
      Within this dialog, you may create and organize files into groups, or create other project targets with different tool configurations.

      Components, Environments and Books Dialog


MCBSTM32C User's Guide: Configuring Output Files

Configuring Output Files

Configure the Output Files in the Project — Options for Target — Output dialog. The steps for configuring these files are:

  1. Select Folder for Objects... this allows you to specify sub-folders for the output files.

    Options for Target — Output — Select Folder

  2. Enable Debug Information to store symbolic debug information within the executable file for source level program testing with the µVision debugger.

    Options for Target — Output — Debug Information Selection

  3. Enable Create HEX File to generate an Intel HEX file for Flash programming with external utilities.

    Options for Target — Create HEX File


MCBSTM32C User's Guide: Setting Target Options

Setting Target Options

You must select the speed and memory configurations for your target hardware. Since these features of the MCBSTM32C are fixed, copy the settings as shown below. The steps for setting the target options are:

  1. Open the Target Tab of the Project — Options for Target dialog.

    Options for Target - XTAL Type in the XTAL (MHz) of 25.0 for the oscillator frequency.

  2. Enter the memory ROM area for your target system in IROM1.

    Options for Target - IROM1 Enter the starting address of 0x8000000 in Start and the size of 0x80000 in Size.

    The MCBSTM32C has on-chip ROM from 0x8000000 to 0x807FFFF for a total of 0x80000 bytes.

    Clicking the Startup radio button assigns your startup code to this area of memory.

  3. Enter the RAM memory area for your target system in IRAM1.

    Options for Target - IRAM1 Enter the starting address of 0x2000000 in Start and the size of 0x10000 in Size.

    The MCBSTM32C has on-chip RAM from 0x20000000 to 0x2000FFFF for a total of 0x10000 bytes.

Note

  • In the licensed (non-evaluation) version of MDK-ARM, the Memory Areas parameters automatically configure the scatter file for the RealView Linker/Locator.


MCBSTM32C User's Guide: Creating Application Programs

Creating Application Programs

The required steps for creating application programs are outlined here.

µVision includes a Project Manager that makes it easy for you to design applications quickly. The topics below show you how to create a project, set the target options, configure the output files, and build an application program that is ready to download to the MCBSTM32C board.

  1. Creating a Project
  2. Setting Target Options
  3. Configuring Output Files
  4. Building a Program

Detailed information can be found in the µVision User's Guide in the Creating Applications chapter.