1143451287
TRANSCRIPT
-
8/13/2019 1143451287
1/50
ST7 MICROCONTROLLER
TRAINING
1. INTRODUCTION2. CORE3. ADDRESSING MODES
4. ASSEMBLY TOOLCHAIN5. STVD7 DEBUGGER6. HARDWARE TOOLS7. PERIPHERALS8. ST-REALIZER II9. C TOOLCHAINS
-
8/13/2019 1143451287
2/50
ST7 HARDWARE TOOLS
APPLICATION BOARD
LCD Control
ST7 EMULATOR
ST7
ST7 DEVELOPEMENT KIT
PARALLEL CONNECTION
Triggers
DedicatedBoard
External clock
ENGINEERING PROGRAMMING BOARD / STICK
-
8/13/2019 1143451287
3/50
HARDWARE TOOLS OVERVIEW
Complete support of ST7 families with :
Dedicated emulatorsDevelopment kit which contains in one single board:
Low cost emulatorEPROM Programmer (DIL packages only) + ISP/ICPconnector
Engineering Programming Boards (all packages)
STICK: generic programming board used with daughtersboards
-
8/13/2019 1143451287
4/50
EMU2B EMULATOR MAIN
FEATURES Complete real time emulator up to 16MHz Dedicated to a specific MCUs family:
MDT1 for SDIP32 or SO28 packageMDT2 for SDIP 42/56 or QFP 44/64 packageMDT3 for SDIP 42/56 or QFP 44/64 package and CAN cell
MDT4 for USB or DAC with PWM cellMDT5 for Motor Control cellMDT6 for Op Amp cellMDT7 for Card Reader
Powerful logic analyser External logic probe Extended range of breakpoints Trigger outputs External clock input
-
8/13/2019 1143451287
5/50
EMU3 EMULATOR MAIN
FEATURES CPU frequency: 32 KHz up to 24 MHz Application power supply follower: 0V to 5.5V
EPLD or emuchip based Dedicated to a specific MCUs family:MDT10 for SDIP32 or SO28 packageMDT20J/M for SDIP 42/56 or QFP 44/64/80
BEM (Bus Event Machine) Performance Analysis Extended range of breakpoints Trigger input/outputs Trace 256 K cycles with records of 112 bits External clock input Timestamp in Trace window R/W on the fly
-
8/13/2019 1143451287
6/50
DEBUGGING WITH THE
EMULATOR
Debug level
Software BreakpointsBreak on a source code line execution
Always stop execution
Hardware Events/Data breakpointsTrigger outputFilter traceStop on R/W access on a variable
Real Time Trace analyser Record complex chained
internal / external eventsBreak Capabili ty
us Event MachineAdvanced breakpointsTrace filtering
-
8/13/2019 1143451287
7/50
BREAKPOINTS OVERVIEW
Software Breakpoints:Stop on a code line (on fetch), in the source orthe disassembly window
Data Breakpoints:Stop at R/W accesses of a variable
Hardware Events:Record when the HW condition is met upon:
Event ON (@ event begins)Event OFF (@ event ends)Event HIT (1 particular @ accessed)
Enables to generate an output trigger signal
-
8/13/2019 1143451287
8/50
REAL TIME TRACE RECORDER Display for each CPU cycle address and data bus value, memoryaccess type, Trace feature provides a record of application execution with
filtering, display controls, timestamp, save to file Trace buffer depth :256k with records of 112 bits (EMU3)
-
8/13/2019 1143451287
9/50
EMU3 Read/write on the fly
Change a value Double click in Value column
Type the new value (eg. 1) Press Enter
When bugCountDown reaches 0, nbOfTransitions is
overwritten with a false value.
In this case, entering 1 for enableBug sets off a countdown.
5, 4, 3, 2
Read/write on the flyallows you to watch theevolution and enter newvalues for variablesduring the execution ofyour application:
Window background isyellow
Values appear in boldas they change
-
8/13/2019 1143451287
10/50
EMU3 Advanced breakpoints What are they for ?
They permit intricate debugging by allowing user to setcomplex breakpoints and to control trace and triggers onpredefined events.
Main features:The Advanced breakpoints feature is a configurable 4-levelstate machine which is executed at micro controller speed.
Each level can specify up to 4 events, hence a user canchoose to follow a series of up to 16 logical events.
Actions may be performed upon the occurrence of the definedevent or sequence of events.
Any user configuration can be saved as a *.bem file and bere-used for any other workspace
-
8/13/2019 1143451287
11/50
EMU3 Advanced breakpoints: Definition(1/3) Events can be defined using any of the following
parameters:
a specific address or range of addresses,a specific data value with bit mask,a read, write or read/write access,
an opcode fetch,external event(s) monitored using one or all of thenine input triggers, trace full information,
a DMA memory access,an interruption,a stack operation access.
-
8/13/2019 1143451287
12/50
EMU3 Advanced breakpointsDefinition (2/3)
Actions can be defined as:a break in the execution of the program (i.e. a
breakpoint),the enabling, or disabling of trace recording,the recording of a snapshot in the trace,
continuing to another level of conditions, defined byanother event or series of events,the outputting of a waveform to one or both of the
two output triggers,a set of the above actions.
-
8/13/2019 1143451287
13/50
EMU3 Advanced breakpointsDefinition (3/3)
Levels can be defined as:The level defines the relationship between these events(i.e. specific, user-defined conditions) and the actions tobe carried out by the debugger. A counter may also beset.The definition of each level has the following structure:
IF [NOT] [[NOT] ]
THEN actions
ELSE IF [NOT] [ [NOT] ]
THEN actions
Combination operators: AND, NAND, OR, XOR, NOR,XNOR
-
8/13/2019 1143451287
14/50
EMU3 Advanced breakpoints AdvancedBreakpoints featureallows you to triggeractions based oncomplex events that youdefine:
Four levels
Events (on data,address, signal,trigger)
Actions (break, outputtrigger, filter trace)
Synoptic view forgraphic representationof breakpoint logic
and Saveconfiguration to file
-
8/13/2019 1143451287
15/50
EMU3 Advanced breakpointsExample
Break on memory accessTo set a breakpoint on memory access (either a read ora write) within a specific range of addresses . This sort ofbreakpoint is very useful if you wish to ensure that certainmemory zones are never read or written .
To set a breakpoint on the reading or writing of aparticular data value to a particular memory address orrange of memory addresses.This Break on are useful after function call
IF (opcode fetch at main.c*57)THEN Goto Level 2;
LEVEL 1:
IF (access at memory location [0x40] with data=0x05)THEN break;
LEVEL 2:
(empty)LEVEL 3-4:
ON or OFFSTART with TRACE
-
8/13/2019 1143451287
16/50
EMU3 Advanced breakpointsExample
Synchronize an external deviceSometimes it is useful to send a pulsed signal from oneof the output triggers to synchronize an external deviceupon the occurrence of a particular event. For example,say that you wish to synchronize an oscilloscope upon
the occurrence of an entry into an interrupt loop (or aspecific task in a function).
IF (opcode fetch in task,,IT,,)THEN (Trigger 1 Pulse);
LEVEL 1:
(empty)LEVEL 3-4:
ON or OFFSTART with TRACE
-
8/13/2019 1143451287
17/50
EMU3 Advanced breakpointsExample
Synchronize trace with an external eventsSometimes it is useful to observe data or code after anexternal event (ie:a signal change on the applicationboard). For example, you wish to measure the latencytime between a port (input) change and the functiontreatment.
IF (access at memory location [0x40] with data=0x05)THEN TRACE break;
LEVEL 2:
IF (Trigger in =1)THEN (TRACE
Goto LEVEL2);
LEVEL 1:
(empty)LEVEL 3-4:
ON or OFFSTART with TRACE
-
8/13/2019 1143451287
18/50
EMU3 Advanced breakpoints Saving and loading advanced breakpoints
You can store the definition for your advanced breakpoint to a file(*.bem ), which can be reloaded by any STVD7 project, so long as youare using the EMU3 emulator to debug the application. This will allowyou to save time if you have toswitch between advanced breakpointswhile debugging your application.
Help for advanced breakpoints on STVD7Open the Search window by selecting, from the main menu, Help>Search , or by clicking on (Search in Help, or Help Home Pageicons) in the Emulator toolbar, and then type bem in the keyword
field of the search folder
-
8/13/2019 1143451287
19/50
EMU3 Advanced breakpoints
Timing limitations Advanced breakpoints take time to be evaluated andtriggered.Trace timestamp counter runs at 20Mhz internal clockor user-specified external clock and hence has a timebase which differs from Advanced Breakpoints.Trace timestamp counter is a 30-bit counter (107 374182 350 ns) whose reset means a change in referencepoint for timing calculations.
-
8/13/2019 1143451287
20/50
Performance analysis
Performance Analysis featureshows you how muchtime the ST7 spends
processing a sectionof your applicationcode that you specify.
The graphic interfaceprovides a report ofstatistics and agraphicalrepresentation of the
statistics.
-
8/13/2019 1143451287
21/50
Emulator update Emulators contain firmware that may be updated When the EMU3 is initialized
STVD7 checks the firmware versions
If needed, the user is prompted for automatic update
-
8/13/2019 1143451287
22/50
EMU3 DISCREPENCIES
Emulator/Emulator discrepencies menu displays thedifferencies between the emulation system and thetarget MCU as they are different for each target andemulator type (emuchip or ELPD)
MDT10 emulator is EPLD based so parametrics aredifferent for instance (ADC conversion time, RCcalibration not feasible as emulated by a fixedfrequency from an oscillator, analog comparator not
emulated, )
-
8/13/2019 1143451287
23/50
EPB: Engineering Programming
Board OVERVIEW Hardware features:Device Read, Verify, Program for:
A given area (FLASH, EPROM, EEPROM, OPTION BYTE)
A range in a specific area All areas (FLASH, EPROM, EEPROM, OPTION BYTE) at atime
EPROM Blank Check
ISP or ICP connector on board (if feature supported by thedevice)
Software features: STVP7Epromer configuration for hardware and device
Load/Save binary files in FLASH, EPROM, EEPROM or OPTIONareaDump and modify the FLASH, EPROM, EEPROM memory image :
Read from the deviceLoaded from the binary file
Project management allows the user to configure the epromer andload a file in each area at a time
S T 7 2
Socket
ST7 MDTxPROGRAMMINGBOARD
STVP7
-
8/13/2019 1143451287
24/50
STICK OVERVIEW Hardware features:
Replace the EPB: generic board to be used with dedicated daughterboards depending on the chosen deviceParallel interface with the PCDaughter board can be plugged on the STICK (no need then tosupply it) -> called Socket BoardSTICK can be also used with any board having a ICP connector
12V power supply Software features: STVP7Epromer configuration for hardware and deviceLoad/Save binary files in FLASH, EPROM, EEPROM or OPTION
areaDump and modify the FLASH, EPROM, EEPROM memory image :Read from the deviceLoaded from the binary file
Project management allows the user to configure the epromer andload a file in each area at a time
S T 7 2
Socket
ST7 MDTxPROGRAMMINGBOARD
STVP7
-
8/13/2019 1143451287
25/50
ICP & Option Bytes Management
2 different ICP modes (for option bytes clock):1) ICP or ICP OPT Enable Programming mode:
Uses Option Bytes already programmed in the ST7Selected clock source must be provided to the
application2) ICP OPT Disable Programming mode:
Ignore Option Bytes programmed on ST7 device
Always External Clock source in this mode: NeedOSC pin to be connected from the tool HE10 connector(pin 9) to the ST7 Clock input
STVP7
-
8/13/2019 1143451287
26/50
HARDWARE & DEVICEConfiguration
STVP7
CONFIGURATION
-
8/13/2019 1143451287
27/50
SCREEN DISPLAY
-
8/13/2019 1143451287
28/50
-
8/13/2019 1143451287
29/50
PROJECT FEATURES A project is a file which may be created, loaded, edited and
executed (Program all)
Loading a project allows the user to:Set the epromer configuration (Hardware,Device and Port)
Automatically load a file in each area (Prog mem,EEPROM...)Program all the device areas at a time
Define programming options:Blank Check
Verify after programming
Implement serial numbering
Protect sectors from edition
DEVELOPMENT KIT
-
8/13/2019 1143451287
30/50
DEVELOPMENT KIT
OVERVIEW (DVP3) MDT10 supports Lite family + ST72F26x MDT20M/J supports ST72F521/32x family MDT25 support ST72F561 family Parallel or USB connection to the PC Programming features :
Under STVP7 control
ICP connector on board Emulation features:Under STVD7 control (hardware test available)Full real time emulation (data breakpoints,)
16 MHz on-board clock or external clock possibilityExtended breakpoints rangeOutput/Input Trigger, 3 analyzer probe input pinsTimer frozen capability512x32 bits of Trace with filtering capabilitiesStack overflow/underflow detection
APPLICATION BOARD
F l a
t C a b l e
S T 7 2
LCD Control
-
8/13/2019 1143451287
31/50
DVP3 TRIGGER MODES Hardware Events mode
Trigger output signal (external resource)Trace filtering
Trigin modeBreak on an external input signal (rising edge)
Trace overflow break mode
Break when trace full
Trigger output :output level changes depending on events (EVT-ON, EVT-OFF,EVT-HIT)
-
8/13/2019 1143451287
32/50
DEVELOPMENT KIT LIMITATIONS Application supply is 3.3V or 5V
No application power supply follower ADC referenced to Emulator VDD (not Appli VDD)
No Advance break, no Time stamp, no Perf analysis Clock frequency: 2MHz Fcpu 8MHz Discrepencies window available in STVD7 menu as
limitations can be different depending on the DVP3 andthe devices:
-
8/13/2019 1143451287
33/50
ST7 TOOLS BY FAMILYEMULATOR DVP EPB STICK
ST72260G1 ST7-STICKST72262G1/2ST72264G1/2
ST7Litex ST7MDT10-EPB ST7SB10-123ST7232xMx/Rx/Jx ST7-STICK
ST72521Mx/Rx ST7MDT20-EPB ST7SB20J/MST72312R4 ST7MDT2-EPBST72532R4
ST72311R6/7/9ST72331R6/7/9 ST7MDT2-EPB2
ST72272K2ST72372J4ST72371N4ST72141K2 ST7MDT5-EMU2B ST7MDT5-DVP2 ST7MDT5-EPB
ST72104G1/2ST72216G1ST72215G2
ST72254G1/2
ST72124J2/4ST72314J2/4ST72334J2/4ST72314N2/4ST72334N2/4ST72411R1 ST7MDT7-EMU2B ST7MDT7-EPB2ST72171K2 ST7MDT6-EMU2B ST7MDT6-EPB2
ST7MDT1-EMU2B
ST7MDT2-EMU2B
ST7MDT1-DVP2
ST7MDT2-DVP2
ST7MDT10-EMU3
ST7MDT20M/J-EMU3
ST7MDT10-DVP3
ST7MDT20M/J-DVP3
ST7MDT2-EMU2B
ST7MDT4-EMU2
ST7MDT1-EPB2
ST7MDT2-EPB2
OR
ST7MDT4-EPB
ST7SB10-SU0 ST7SB10-26x
Tools salestypes added at the end of the datasheets!
A Complete Set of Tools
-
8/13/2019 1143451287
34/50
A Complete Set of Tools
IN HOUSE AND THIRD PARTIES
Mcu.st.comfor more
info!
8-bit & 16-bit
-
8/13/2019 1143451287
35/50
8 bit & 16 bit3rd Party Partners
-
8/13/2019 1143451287
36/50
Large range of high-end Emulators
ST EMU3 for all ST7Flash
ST EMU2 for all ST7
Cxxx and Txxx
iSystem: Largerange of High-end
emulator iCx000
Hitex: Large rangeof high-endemulator AX-ST7,MX-ST7
-
8/13/2019 1143451287
37/50
MODULAR Emulator Once the first emulator invested, additionnal target isfrom $1500 to $2000 .
GENERIC Emulatorsfor 8 bits microcontrollers (ST and ST competition)
iSystemiSystem
HighHigh --endend EmulatorsEmulators ..
iC1000MONOLITHIC EMULATOR
iC2000MODULAR EMULATOR
iC4000
MODULAR EMULATOR
HitexHitex
HitexHitex
from $4000iSystemiSystemfrom $5000
ST7 3rd parties Emulators
Tree versions withdifferent prices & levelsof functionalities. MX-ST7-L debug ofsimple applications
MX-ST7: full features todetect complex bugs AX-ST7 : universal high-end in-circuit emulator
-
8/13/2019 1143451287
38/50
High performance and maximum flexibility:Big emulation RAM, Big trace buffer, Complexbreakpoints, Real-time Watch...
Powerful features:bus width, high speed communication
Powerful IDE :
iSystem IDE: 30 days free trial available on STweb site and in ST CD.
Non-intrusive Advanced programmable logic technology
EmulationEmulation featuresfeatures
HighHigh --endend EmulatorsEmulators ..ST7 3rd parties Emulators
ST7 In Circuit Debugging
-
8/13/2019 1143451287
39/50
RAISONANCE
Rlink-ST : USB/JTAG dongle for ST7, STR7 andPSD
Low cost tools for In Circuit Debugging
Modular demo boards system, featuring InCircuit Debugging and In Circuit Programming
1 Generic demo board, with led, potentiometer.(REVA board)
Daughter boards for selected MCU (card).
3 Mass Market starter kits (ST7):
ST7LITE-SK/RAIS (ST7FLITE3x,
ST7FLITE0x, ST72F264x) @ $149ST732X-SK/RAIS (ST72F321xBJ6) @ $149
Flasher:
-
8/13/2019 1143451287
40/50
Manufacturing In-Circuit programmer
In-circuit programming toolSerial programming supported
Engineering or Manufacturing env.:can work in stand-alone mode withoutthe need of a PC.
Can be connected to an Automatic Tester .
Read, Erase, Program and Verify, Readback.
High speed programming:app. 12 sec for 60 kB in serial modewith 16 MHz target for programming andverification
Flasher Flasher $477
Available forST72Fxxx GeneralPurpose devices
www.segger.com
-
8/13/2019 1143451287
41/50
TINY +Real Time OS
InternetDevpt.
PlatformIDE's
REALIZERGraphical
design
Complete ST designed chainCompatible with ST real t imeemulatorsSTVD7 (IDE)
Third party designed including debugger Several vendors: RAISONANCE,COSMIC
ACTUM designedGenuine ST toolsbased
CMX
Isystem: IDE for ST emulatorsKanda: IDE with Starter-kit +
Application Builder
em WARE
ST designed tools&
wide 3rd party support
ST7 SOFTWARE TOOLS
C Compilers
Assembler
Linker Debugger Simulator
TOOLS and SUPPORT - ST7 LIBRARY
-
8/13/2019 1143451287
42/50
TOOLS and SUPPORT ST7 LIBRARY
OVERVIEW BenefitsHides the Hardware Layer Standardizes the Source
codeCompactHelp getting started
Documentation makes ituser friendly.Free of charge(www.st.com/mcu)
Support14 standard peripheralsDevice
ST72F561ST72F521ST72F321
ST7LITE0Compiler
Cosmic
Raisonance (soon)Metrowerks
Other ST7 Software
-
8/13/2019 1143451287
43/50
Real time Operatingsystem
Truly pre-emptive, multi-taskingoperating system. Powerful functions: managementfor Task, Timer, Memory, Resource,Event, System, Message, Queue,Uart .
Other ST7 Software
3rd Party Tools 1/2
Real Time OS for embed-
ded applications Easy to use, Easily portable One of the smallest and fastestkernels No royalties, affordable
OS CMXOS CMXOSOS Segger Segger
Real-Time Kernel highly portable, ROMable, veryscalable, preemptive real-time,multitasking kernel (RTOS) can manage up to 63 applicationtasks.
C/OSC/OS --IIII MicrimMicrim
Other ST7 Software
-
8/13/2019 1143451287
44/50
Real-Time Architecture
3rd Party Tools 2/2
SSX5 Real-Time OperatingSystem
Architecture configuration toolTiming Analysis tool
Smallest, fastest OSEK OS
RTA supports all variants of theST7
MISRA C Compliance of all targetcode
Realogy RTA Vector Vector , IXXAT ., IXXAT .CANLINOSEK
3rd t C COMPILERS
-
8/13/2019 1143451287
45/50
Entry-level EmulatorDVP3
Triggers
DedicatedBoard
External clock
High-end Emulator
EMU3Simulator
3rd party C COMPILERS
In-Circuit Debugging
Full interoperability with ST toolsFull interoperability with ST tools
ST IDE:ST IDE:STVD7STVD7
CosmicCosmic // RaisonanceRaisonance CompilersCompilers
CosmicCosmic // RaisonanceRaisonance IDEIDE
STST Debugger Debugger ::STVD7STVD7
CosmicCosmic // RaisonanceRaisonanceDebugger Debugger
C T l Ch i
-
8/13/2019 1143451287
46/50
Compiler
Limitation (with registration on Cosmicsite):
16K bytes of C code 16K bytes of Assembly code
C Tool ChainToTo decreasedecrease development cost anddevelopment cost and time to markettime to market !!
ToTo increaseincrease DesignDesign --reusereuse !!
FREE versionFREE version
TimeTime limitedlimited Full versionFull version30 days of FREE evaluation to be
ordered directly to the 3rd party.
Available Available
FromFrom 33 rdrd partyparty
Cosmic C Tool Chain
-
8/13/2019 1143451287
47/50
Cosmic C Tool Chain
Complete & Easy to useIntuitive GUI based on the
popular Codewright Windowseditor/project manager.
IDEAIDEA
Optimized ANSI-C Compiler Reentrant stack model and static
models
Smart Linker optimizes and overlaysRAM space
In-Line AssemblyIEEE floating point libraries
C CrossC Cross
Full featured source-level debugger ZAM SIM: Debugging environment using
ST7 core simulation
ZAP ICE : Deb. env. for ST emulators(EMU2 & EMU3)
ZAP Monitor : In Circuit Debugging withST7FLITE2 starter kit
ZAPZAP
For more information:For more information:www.cosmicsoftware.comwww.cosmicsoftware.com
3 licenses:3 licenses: Full featuredFull featured FullFull limitedlimited 11 monthmonth 16Kb16Kb limitedlimited (FREE)(FREE)
RAISONANCE
-
8/13/2019 1143451287
48/50
RAISONANCEC Toolchain
Soon available (Q2 2006) Same range of price and performances as COSMIC ST7 / STM75 C Compiler
www.raisonance.com
Graphics oriented tool$150
-
8/13/2019 1143451287
49/50
Graphics-oriented tool
Project Manager under IDEEnhanced librariesSymbols for accessing all
peripheral control registers
HW interruptsReal time management
Automatic generation of codesource assembly,simulation f ilesmachine code (S19, HEX)
Simulation with graphic i/f Pin level simulation
STST Realizer Realizer IIII
STREALIZERSTREALIZER --IIII
Simply draw a diagram of theSimply draw a diagram of the application using aapplication using alibrary of library of symbols thatsymbols that represent functions.represent functions.
$150
FreeFree demodemo on STon STCDROMCDROM
Now supports:C254 / C334
LITE0xF264
Graphics-oriented tool
-
8/13/2019 1143451287
50/50
Graphics oriented tool
NoNoSupport
Silver version +Optimization
features
http://www.actum.com/actum.h
tm
Demo versionST6 + ST7equivalent to Silver
version
Features
Approx. $1500 Approx.
$800(with ACTUMsupport)
Free demo on
www.actum.comor Approx. $80
$150
Free demo on STCDROM orwww.stmcu.com
Prices
Actum Actum ActumST Availablefrom
REALIZERREALIZERGoldGold
REALIZERREALIZERSilver Silver
REALIZERREALIZERBronzeBronze
ST REALIZER IIST REALIZER II