Welcome to NoICE

NoICE is a debugger for microprocessors.

Debuggers like NoICE are sometimes called "remote debuggers" or "ROM monitor debuggers". A remote debugger consists of a host program running on your PC; which provides the debugger user interface, symbol tables, etc.; and a small monitor program running on the actual target processor. The two programs communicate via RS-232 or some other mechanism. In some cases, the target processor contains BDM or JTAG hardware that can replace the target monitor.

"Remote" in this case usually means only a few feet of cable connecting the two devices. The term was coined to distinguish two-computer debugging from the case where the debugger runs on the same computer as the program being debugged.

The target monitor, or its BDM or JTAG equivalent, usually implements only a few primitive commands such as memory read and write, register read and write, and execute.

The advantage of this approach is that the target monitor can be kept simple and small, because it doesn't need to contain disassembler tables, ASCII command parsers and the like. Small size also leaves as much of the processor address space as possible for your application program. The host program can grow as fancy as required, usually without affecting the target program.

We will talk more about the target monitor later.

NoICE is not a simulator. To execute your program, NoICE must be connected to physical target hardware. For evaluation purposes, you can configure NoICE to use a "dummy target". This simulates target memory, so that you can download programs and experiment with most NoICE commands, including the disassembler, source viewer, memory editing and watch, symbols, etc. However, the dummy target will not execute programs. Read more about the pros and cons of simulators.

Target Hardware Requirements

To use NoICE, your target hardware must meet certain requirements. Select your processor below to learn about these requirements.

68HC08 using MON08, with code in Flash or RAM

Most members of the 68HC08 family contain a small ROM that holds the MON08 monitor program. MON08 contains only a few commands, but they are enough for NoICE to be able to burn Flash and debug programs.

In order to use MON08, your target hardware needs a MON08 RS-232 interface and a way to force the 68HC08 into MON08 mode. This usually means a way to apply Vtst to the IRQ pin. If you are using a commercial development board, this is probably available by proper configuration of jumpers. If you are developing your own board, you can either design in the appropriate circuitry, or cut-and-jumper a board to get what you require. Consult your processor datasheet for exact details.

NoICE allows you to select a standard baud rate from a drop-list. You can also enter a non-standard rate, should your application require it. However, be aware that a standard PC serial port can only generate baud rates that are exact divisors of 115,200. Thus, the PC can generate 9600 baud (115200/12), or 10472.73 baud (115200/11), but not 10000 baud. If you enter a baud rate of 10000, Windows will chose the closest available baud rate. Since the closest available rates are about 4 percent off, operation is not likely to be satisfactory.

Before burning Flash, you must select the appropriate processor and bus speed. Flash burning and other features vary from one variant to another. Specifying the wrong variant may cause damage to the Flash.

MON08 ROM Monitor

68HC12 using BDM, with code in Flash or RAM

Your target will need a BDM connector, MODA and MODB must be held low at reset, and you will need a BDM pod supported by NoICE.

TODO: list them.

If you are using a commercial development board, the BDM connector is probably already in place. If you are developing your own board, you can either design in the appropriate connector or cut-and-jumper a board to get what you require. Consult your processor datasheet for exact details.

Before burning Flash, you must select the appropriate processor and bus speed. Flash burning and other features vary from one variant to another. Specifying the wrong variant may cause damage to the Flash. NoICE cannot currently burn Flash on targets operating at bus speeds other than 8 MHz (16 MHz crystal). This restriction will be removed in the future.

MSP430 using JTAG, with code in Flash or RAM

Your target will need a JTAG connection, and you will need a JTAG pod supported by NoICE. If you are using a commercial development board, the JTAG connector is probably already in place. If you are developing your own board, you can either design in the appropriate connector, or cut-and-jumper a board to get what you require. Consult your processor datasheet for exact details.

Each variant of MSP430 contains identification information that NoICE uses to configure itself. As Texas Instruments introduces new variants, NoICE may indicate that it doesn't know what variant it is connected to. If this occurs, please contact us for an update.

Z80/Z180, 68HC11, 68HC12 without BDM, 65(C)02, 8080/8085, 8096/80196

On other processors, the program to be debugged must reside in RAM, and NoICE requires the presence of a small monitor in the target. You need:

If you have a development board that contains a hex monitor that permits debugging when connected to an ASCII terminal, your board probably has the resources to operate with NoICE. Examples of such monitors are Buffalo for the HC11, Twin Peaks for the HC12, or Monplus for the 8051.

However, you will need to replace any existing monitor with the NoICE monitor. Source code for the monitors may be found in the "monitors" subdirectory of wherever you install NoICE. The default location is C:\Program Files\NoICE\monitors.

Additional information is available about customizing target monitors.

Are you wondering why 68HC12 BDM users can debug programs in Flash while the monitor can only work with programs in RAM? It's because most variants of the 68HC12 contains two hardware breakpoints. In the absence of hardware breakpoints, NoICE must insert special instructions (usually software interrupts of some sort) to cause breakpoints. NoICE implements single-step using automatically inserted breakpoints. Writing to Flash generally means erasing a large segment and writing the entire segment. This is clearly not suitable for breakpoint and single-step operation. Sorry.

Are you using a soft processor core in an FPGA? You might consider adding at least two hardware breakpoints. Then contact us about the changes required to the monitor to use them.

8051

The 8051 is a special case because it has separate data space and code space. There are instructions to read and the write the data space, and to read the code space, but there is no instruction to write into the code space. Thus, your hardware must provide a mechanism to allow the program space to be read and written by the processor.

If you need only 64K of address space, the simplest hardware is circuitry to OR together /PSEN and /RD. TODO from help file targets.htm

If your needs are more complex, you may need to use a port bit and external hardware to control writing into code space.

TODO;;; from previous section

Interrupts

As provided on the distribution disk, the monitors run with interrupts disabled. This is generally the best way to run a monitor, as it essentially "freezes time" when the user program is stopped and the monitor is running. User code can use interrupts by enabling them as appropriate. Interrupts will be disabled by the monitor upon breakpoint or other entry, and will be restored to their pre-entry states before the user code is resumed. Some users have modified the monitors to run with interrupts enabled. This can be useful in special cases, but can also make debugging very difficult and is not recommended for general use.

When using MON08, BDM, or JTAG, interrupts are always disabled when the user program is not running. This is intrinsic to the debug method, and cannot be changed.

Configuring the Target Monitor

Should this be replicated for each processor? Could then refer to the monitor source(s) and exact symbol names. Mention the assembler to be used.

Running NoICE for the First Time

In most cases, you will be debugging programs at source level, using symbols rather than addresses. However, as an introduction to NoICE we recommend that you get some experience with the interface first. This will also allow you to verify your target monitor or connections.

Select Target Communications. The first time you run NoICE after installing it, a dialog will appear asking you to choose a method of communications. If you don't have appropriate target hardware available, you may wish to select "Dummy Target". This will let you use many NoICE commands, but will not allow you to execute programs.

You can change Target Communications at any time by selecting Options, Target Communications.

When you start NoICE, it will send messages to the target to determine the target state. If NoICE cannot communicate with the target, an error message will be shown. If this occurs, verify that your target is powered up and that the cable is connected. The most common faults are incorrectly wired cables (no you need a null modem?) and mismatched baud rates.

If you are using the serial monitor, NoICE can show you a hex dump of the serial traffic between the PC and the monitor. Select Options, Show Target Communications. Then see TODO for information on deciphering the byte strings.

When NoICE starts up, it will disassemble instructions beginning at the initial PC address. If you are using the serial monitor, PC will be set to whatever value the monitor sets it to. If you are using BDM of one of the other built-in interfaces, PC may be set to the contents of the reset vector, or it may contain a garbage value. You can disassemble at any address by selecting View, Disassemble At..., and entering an address. Or use the "U" command in the command edit box in the NoICE toolbar. To continue disassembly, just click in the disassembly window and press the PageDown key.

Registers. The top window of the NoICE screen shows the values of the processor registers. You can click on a register to change its value. Or use the "R" command in the command edit box in the NoICE toolbar.

Memory Dump. Select Memory, Dump. Then enter an address and size to dump. NoICE will show the contents of memory in hex and ASCII. To dump the next portion of memory, select Memory, Dump Next; or press F2 or the "hex dump" button on the toolbar.

Memory Edit. Click the "Memory" tab at the bottom of the NoICE window. Enter an address into the edit box and press "Read". NoICE will show the contents of memory in hex and ASCII. To change the contents of memory, click on a byte and type hex characters. To edit the ASCII, click on a byte and type the desired characters. Values are written to the target as you change each byte. Note that the memory window may not be suitable for use on I/O addresses, as extra reads and writes of I/O locations may cause undesired actions.

In addition to the Memory tab, you can edit memory using the EDIT, IN, and OUT commands. EDIT is most useful in conjunction with symbols and datatypes. IN and OUT are designed for access to I/O devices.

Mini-assembler. You will develop your code using an assembler or compiler. However, NoICE includes a simple assembler so that you can enter assembly programs directly into RAM. This is useful for patching programs, and for entering short test sequences. Select "Memory", "Assemble...". Then enter the address and instructions. Let's try a simple example: a program that increments a register and loops

	1000	lda #5
	1002	inca
	1003	bne 1002
	1005	bra 1000

Single-step. Set PC to the start of the program: "R PC 1000" (or click on the PC, and enter 1000). Now enter "U PC" to disassemble beginning at the address in the PC. You should see the instructions you just entered, plus a few lines of whatever was in memory. Press F7, or click the Step Into button on the toolbar. PC should change to 1001, A should change to 5, and the PC arrow in the disassembly window should move. Note that the PC and A are shown in red to indicate that they have changed. Press F7 again. PC should change to 1002, and the A register should increment to 6. You can continue stepping around the loop until you get bored.

Breakpoints. Double-click on the address (1005) to the left of the bra instruction. A red target should appear, indicating a breakpoint. Now press F5, or the "Go" button on the toolbar. The program should stop almost immediately at the breakpoint. A should have a value of 0, having incremented until overflow.

At this point, you can do debugging of programs at the disassembly level. Use the LOAD command to load Motorola/Freescale or Intel hex files, rather than assembling them in NoICE.

Hex files contain only program data. NoICE can let you debug at the source level - stepping through and setting breakpoints in your source code. You can specify variable and symbol names instead of typing hex values. However, to do this you will need to generate debugging information from your program. The means by which this is done are specific to the compiler or assembler that you are using. Please read the following section in conjunction with the documentation for your compiler or assembler.

Assembling or Compiling a Program for Debugging

ImageCraft Open your project using the ImageCraft IDE. Select Project, Options from the menu to open the Options dialog. Select the Compiler tab. For a Motorola/Freescale processor, set Output Format to "S19 with source level debugging". For the MSP430, set Output Format to "Intel HEX w/ DBG Debugging". This will generate a file with a .DBG extension. This is required for source-level debugging. The .S19 file contains only program data. The .DBG file contains the debugging information. If you have the professional version of the compiler, select ImageCraft debug format "V1.1". If you are using expanded memory on the 68HC12, select the Target tab. Select "Linear" for S2 Record Type. Build your project. Run NoICE. If you have a recent version of the IDE, this may be an option on the Tools menu. In NoICE, select File, Load (or use the Load button on the toolbar). If you have previously loaded the same file, you can select it again from the Most-Recently-Used list on the File menu. If the Load File dialog shows, select File Type "ImageCraft DBG files". Then choose the file you built above. NoICE should load the file into target memory. If necessary (and if available on your processor), the file will be burned to Flash memory. When loading is complete, NoICE should disassemble beginning at the first instruction of the program. Why don't you see the code at main? The answer is part geek and part philosophy: main is the first C code of your program, but it is not the first instruction executed by the processor after reset. That honor rests with the C startup code, which initializes the stackpointer, clears memory, and does assorted I/O initialization. After all that, it calls main. Some debuggers hide all the low-level stuff from you and execute until main before showing you anything. My opinion is that hiding low-level stuff is not a good thing when working on embedded systems: there are times when you want to step through the startup code, or set a breakpoint in the midst of it. So, NoICE loads the code and sets the PC to the first instruction of the startup code. If you were running without NoICE, this is where the reset vector would point. If you want to skip over this, you could set a breakpoint at main, and then execute 'til there: B main G This should stop at main and show you the source code there. Since you are Loading an ImageCraft DBG file, NoICE can do this automatically for you. Select Run, "Go until main after LOAD". The next time you load a DBG file, NoICE will run from the start location until main (presuming that your program ever gets there...). IAR Please note that the free versions of the IAR compilers, including the MSP430 Quick Start, do not produce correct UBROF per the IAR documentation. The output of these compilers cannot be used with NoICE. Open your project with the IAR Embedded Workbench. Select Project, Options from the menu to open the Options dialog. Select the Compiler, and select the Debug tab. Check "Generate debug information", and choose "file references". Select the Assembler, and select the Debug tab. Check "Generate debug information", and choose "file references". Select XLINK, and select the Output tab. Under Format, choose the "debug info". Notice the output file name (and override it if you desire). XLINK can produce a wide variety of debug formats. The default is the IAR proprietary UBROF format. NoICE includes a utility program, IAR_NOI.EXE, which converts UBROF information into a format understandable by NoICE. Build your project. Now you need to run the NoICE utility program IAR_NOI.EXE, which may be found in the \bin subdirectory of wherever you installed NoICE (usually c:\Program Files\NoICE\bin). At your option, you can add this directory to your Windows PATH, copy IAR_NOI.EXE into a directory on your current path, or specify the location when you run IAR_NOI. Suppose that the IAR project produced an output file called demo.d43. You would then run IAR_NOI demo.d43 Specifying program and file paths as necessary. You will probably find it most convenient to place this in a batch file. It may be possible to integrate this with the Embedded Workbench build process, but I have not been able to get enough "help" from the IAR help files to figure out how to do it. IAR_NOI will produce a file called demo.noi. Run NoICE. Select "File", "Play", then chose "demo.noi" as the file. NoICE will play the commands contained in the file, including symbol definitions, line number information, and a command to load program code from demo.mot. Keil IEEE 695 Assemblers Using NoICE We previously looked at NoICE's ability to disassemble and dump memory, to single-step and set breakpoints. Now that we have symbolic debug information available, we can try some more advanced features. If you are debugging a C program, you may wish to enable one or both of the following options - If you are Loading ImageCraft DBG or IEEE-695 files, Select Run, "Go until main after LOAD". When you Load a DBG or IEEE-695 file and this option is checked, NoICE will run from the start location until main (presuming that your program ever gets there...). - - Select Memory, "Watch all Locals". When this option is checked, NoICE will automatically set Watches on all variables local to the function (presuming that they are defined in the debug information). When the function exits, the Watches are automatically removed. These automatic watches have no effect on any Watches that you may have manually created.

NoICE (tm) Debugger, Copyright © 2005 by John Hartman

Using NoICE - Contact us - NoICE Home