Resumen del contenido incluido en la página 1
MF1200-02
CMOS 32-BIT SINGLE CHIP MICROCOMPUTER
S1C33 Family
Debug Monitor Operation Manual
Resumen del contenido incluido en la página 2
NOTICE No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any liability of any kind arising out of any inaccuracies contained in this material or due to its application or use in any product or circuit and, further, there is no representation that this material is applicable to products requiring high level re
Resumen del contenido incluido en la página 3
The information of the product number change Starting April 1, 2001, the product number will be changed as listed below. To order from April 1, 2001 please use the new product number. For further information, please contact Epson sales representative. Configuration of product number Devices S1 C 33104 F 0A01 00 Packing specification Specification Package (D: die form; F: QFP) Model number Model name (C: microcomputer, digital products) Product classification (S1: semiconductor) Developme
Resumen del contenido incluido en la página 4
Resumen del contenido incluido en la página 5
TABLE OF CONTENTS Preface Written for those who develop applications using the S1C33 Family of microcomputers, this manual describes how to implement the S1C33 Family debug monitor library S5U1C330M2S and how to debug the target program. Table of Contents 1 S5U1C330M2S Package ................................................................................................1 1.1 Features ...............................................................................................................
Resumen del contenido incluido en la página 6
Resumen del contenido incluido en la página 7
1 S5U1C330M2S PACKAGE 1 S5U1C330M2S Package The Debug Monitor S5U1C330M2S is a middleware designed for S1C33 Family single-chip microcomputers. It provides program-debugging functions on the user target board or for the actual product. 1.1 Features The following lists the features of S5U1C330M2S: • It is provided as a library file that can be linked to the user program. This package also contains source codes of all the modules. • S 5 U1 C 3 3 0M 2 S u se s a pp r ox . 1 0KB R O M , a pp r ox
Resumen del contenido incluido en la página 8
1 S5U1C330M2S PACKAGE 1.2 Components of S5U1C330M2S Package The following lists the contents of S5U1C330M2S Package: When unpacking, make sure that all of the following components are included. (1) Tool disk (3.5' FD for PC/AT, 1.44MB) 1 (2) S1C33 Family Debug Monitor Operation Manual (this manual) 2 (1 English/1 Japanese) (3) Warranty 2 (1 English/1 Japanese) 1.3 Installation S5U1C330M2S needs to be linked with the user program as it is implemented. Therefore, make sure all tools of the "S1C33
Resumen del contenido incluido en la página 9
1 S5U1C330M2S PACKAGE mon33ch0.mak Make file for building mon33ch0.lib mon33ch1.mak Make file for building mon33ch1.lib mon33.mak Make file for building mon33.lib mon33ice.mak Make file for building mon33ice.lib src\ ..... MON33 source files m33_def.h S5U1C330M2S definition file m3c_brk.c C source file for break functions m3c_exe.c C source file for program execution m3c_flsh.c C source file for Flash memory operation m3c_main.c S5U1C330M2S main C source file m3c_mem.c C source file for memory
Resumen del contenido incluido en la página 10
2 IMPLEMENTING THE DEBUG MONITOR 2 Implementing the Debug Monitor This chapter describes how to implement the debug monitor and how to start it from the application program. 2.1 Resources Required for the Debug Monitor The debug monitor uses the following resources: • Approximately 10KB of ROM area for the program code of the debug monitor. • Approximately 2.5KB of RAM area for the work and stack area. • Since the debug monitor uses the debugging exception of the CPU, addresses 0x0 to 0xF of t
Resumen del contenido incluido en la página 11
2 IMPLEMENTING THE DEBUG MONITOR 2.2 Starting Up the Debug Monitor The debug monitor starts by jumping to m_mon_start( ). Normally, provide a select switch outside the S1C33 chip for selecting either starting up the debug monitor or a normal execution and create the program that can jump to m_mon_start( ) from the boot routine after an initial reset. Furthermore, start the debug monitor after initializing the BCU if necessary. In case the debug monitor is started before the BCU is initialized,
Resumen del contenido incluido en la página 12
2 IMPLEMENTING THE DEBUG MONITOR 2.3 Building an Application Program The S5U1C330M2S modules are provided as a library file "mon33*.lib" in the directory "lib\". Link this library to the user modules. When using the serial interface on the S1C33 chip and the S5U1C330MxD1 board, link "mon33ch0.lib" (Ch.0 is used) or "mon33ch1.lib" (Ch.1 is used) accordingly. When not using the serial interface on the S1C33 chip and the S5U1C330MxD1 board, create serial I/O routines separately and link "mon33.lib
Resumen del contenido incluido en la página 13
2 IMPLEMENTING THE DEBUG MONITOR 2.4 Creating Communication Control Routines For communicating with the debugger, the debug monitor calls the following four RS232C routines (1 to 4). "mon33chX.lib" that contains these routines can be used when using the serial interface Ch.0 or Ch.1 on the S1C33 chip and the S5U1C330MxD1 board. Otherwise, it is necessary to create these routines according to the system since "mon33.lib" must be used. The sample program "m3s_sci.s" that uses the serial interface
Resumen del contenido incluido en la página 14
2 IMPLEMENTING THE DEBUG MONITOR (2) void m_snd_1byte(unsigned char) This is a routine that sends 1-byte data. This routine receives 1-byte data as the argument (R12 register) and sends it via the serial interface. Return value is not necessary. Example: m_snd_1byte( ) of "m3s_sci.s" ;****************************************************************************** ; ; void m_snd_1byte( sdata ) ; 1 byte send function ; IN : uchar sdata (R12) send data ; ;*****************************************
Resumen del contenido incluido en la página 15
2 IMPLEMENTING THE DEBUG MONITOR (4) void m_dummy_rd( ) This is a dummy read routine. It reads data from the receive buffer and clears the buffer. Return value is not necessary. Example: m_dummy_rd( ) of "m3s_sci.s" ;****************************************************************************** ; ; void m_dummy_rd() ; dummy read function ; ;****************************************************************************** .global m_dummy_rd m_dummy_rd: xld.b %r4,[SRDR] ;read data ret (5) void m_ver
Resumen del contenido incluido en la página 16
3 TARGET PROGRAM AND DEBUGGING 3 Target Program and Debugging This chapter describes precautions for debugging using the debug monitor. 3.1 Notes for Creating Target Programs Follow the instructions below when creating the target program to be debugged: • Since the debug monitor uses the debugging exception of the CPU, addresses 0x0 to 0xF of the built-in RAM area are used as the vector and stack for processing debugging exceptions. Therefore, the target program cannot use this area. Furthermor
Resumen del contenido incluido en la página 17
3 TARGET PROGRAM AND DEBUGGING 3.3 Starting Up and Terminating Procedure of Debugging Follow the procedure below to start debugging. 1. Make sure the power of the target board and personal computer are off. 2. Connect the S5U1C330MxD1 board to the target board in which the debug monitor is implemented and connect the S5U1C330MxD1 board to the personal computer with the RS232 cable. 3. Turn the target board on and then start the debug monitor. 4. Turn the personal computer on and start the debug
Resumen del contenido incluido en la página 18
3 TARGET PROGRAM AND DEBUGGING 3.4 Debugging Method The following three methods are available for debugging the target program. 1. Debugging in the ROM Map the target program in the ROM after linking to the debug monitor. The target program can be executed and debugged in the ROM. Since the [Source] window of the debugger displays the disassembled content of the ROM on the target system, it is not necessary to load the target program with the lf command. To display the source, load the same abs
Resumen del contenido incluido en la página 19
3 TARGET PROGRAM AND DEBUGGING 3. Debugging in the Flash memory In the target system in which a Flash memory has mounted, the target program can be debugged by writing it into the Flash memory using the debugger. Notes: • When debugging the target program in the Flash memory, the software break function (bs command) cannot be used. • The debugger db33 ver. 1.72 or later version supports data writing to the Flash memory on the target board. To debug using the Flash memory, create Flash erase and
Resumen del contenido incluido en la página 20
3 TARGET PROGRAM AND DEBUGGING 3.5 Precautions for Debugging 3.5.1 Restriction on Debugging Command When the debug monitor is used for debugging, the following debugging functions/commands are not available or allowed to be used. When the following commands/functions are used, an error message will be displayed. Error: Command is not supported at present mode. • Trace function (tm, td, ts and tf commands) • Sequential break function (bsq command) • ICE Flash memory function (lfl, sfl and efl co