March 2012 Doc ID 11472 Rev 6 1/30
UM0151
User manual
STVP programming toolkit
Introduction
The STVP programming toolkit provides a set of C++ source and header files that can be
used to design a customized programming application for any ST programming hardware
that is supported by STVP.
The provided files contain the source code for functions that allow your programming
application to access STVP’s low level DLLs.
With access to these STVP DLLs, you can program ST7, STM8 and STM32
microcontrollers using any supported programming hardware (ST7-STICK, ST socket
boards, EPB, DVP3, EMU3, STice, ST-LINK, ST-TSLINK and Raisonance STX-RLINK) and
programming methods (socket, in-circuit or in-situ programming).
Figure 1. Programming application schematic
Note: Creating a programming application with the STVP programming toolkit requires the
installation of ST Visual Programmer version 1.9.1 or later.
Your programming application
Programming toolkit
- PtkApi.ccp
- PtkToolBox.ccp
Programming DLLs (from STVP)
Configuration files (from STVP)
1. ST7 Flash STICK: In-circuit programming (ICP)
2. DVP3 series emulator: In-circuit programming (ICP)
3. EMU3 series emulator with ICC Add-on (ICP)
4. ST7SB socket board: Programming sockets for all ICP capable hardware
5. EPB series programmer:
- Programming sockets
- ICP depending on version and target ST microcontroller
6. STice advanced emulation system (ICP)
7. ST-LINK in-circuit debugger/programmer (ICP)
8. STX-RLink in-circuit debugger/programmer (ICP)
9. ST-TSLINK programming dongle (ICP)
www.st.com
Contents UM0151
2/30 Doc ID 11472 Rev 6
Contents
1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 About the user manuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Getting assistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Programming toolkit contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Understanding the STVP DLLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Designing a custom programming application . . . . . . . . . . . . . . . . . . . 7
4.1 Setting up the DLL environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Configuring the device and the programming hardware . . . . . . . . . . . . . . . 8
4.3 Accessing the memory image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4.3.1 Loading a file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.3.2 Writing in the memory image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4 Connecting to the device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4.1 Blank checking the device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
4.4.2 Programming the device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.4.3 Verifying the programming of the device . . . . . . . . . . . . . . . . . . . . . . . . 11
4.4.4 Reading the device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
5 DLL supported functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.1 DLL environment functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Hardware and device configuration functions . . . . . . . . . . . . . . . . . . . . . . 17
5.3 Image area access functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.4 Device connection functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6 Programming toolkit helper functions . . . . . . . . . . . . . . . . . . . . . . . . . 23
Appendix A Product support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29