Page 1
F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01 Doc. No. 002-04828 Rev. *B Cypress Semiconductor 198 Champion Court San Jose, CA95134-1709 http://www.cypress.com...
Page 2
Cypress hardware or software products, Cypress does not assume any liability arising out of any security breach, such as unauthorized access to or use of a Cypress product. In addition, the products described in these materials may contain design defects or errors known as errata which may cause the product to deviate from published specifications.To the extent permitted by applicable law, Cypress reserves the...
1. Introduction This document will help you how to debug an emulation system with the MB2198-01 Emulation with the Softune Workbench V30L33R11. For in-depth information please refer to the following manuals: MB2198-01 Hardware Manual (Emulator) MB2198-01 Getting Started Application Note (MCU-AN-300217) ...
(here: “Emulation_Test”) and start the Softune Workbench Software. “Main.c” The following program, based on the standard template project, is used for demonstrating emulation and debugging. Please change “Main.c” to the following: F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Then compile the project by clicking on or selecting ProjectBuild, or pressing “Ctrl-F8”. Watch for error messages. If all is ok, you will get the following message: F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 8
Sample Program Now building... --------------------Configuration: Template.prj - Debug-------------------- Start.asm Main.c vectors.c Mb96348hs.asm Now linking... <Your path>\Emulation_Test\ABS\Template.abs Now starting load module converter... <Your path>\Emulation_Test\ABS\Template.mhx ------------------------------ No Error. ------------------------------ F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
MCU, open “Main.c” (close it first, if it is open) and then click on right mouse button and select “Mix Display”. Your generated code should look like the following. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
With the bookmark arrow buttons it can be stepped through the code stopping at bookmarked lines. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Reset MCU Reset MCU To reset the MCU, clock on or select DebugReset of MCU. Note: This works only if the application is stopped (e.g. breakpoint, etc.) F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Monitoring and Manipulating CPU Registers To display the CPU Registers window choose in the debugging mode: View -> Register. A new window will occur and look like this: F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 13
(beginning with “D’”), binary values (beginning with “B’”), or octal values (beginning with “O’”). Registers can be added or removed by right clicking on Register window and selecting setup… F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
To manipulate the value just double-click on the entry and enter in the pop-up window Edit variable a new value. The radix can be chosen via “D’”, “H’”, “B’”, or “O’”. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Type for instance H’2530 (or just 2530) for the RAM area. Following window occur which is something like a “Hex-Editor”: F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 16
In this window one can specify the address (default is the address of the clicked byte) and the new value. The value can be entered in hexadecimal, decimal, binary or octal format. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
View -> Symbol. Then unfold the sub list Project_name.abs/Global Symbol. Click with the right mouse button to the variable you want to get information about and select Property… . The Symbol sub window shows then the address: F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Local variables of functions can be displayed via View ->Local. A new window will open. Note, that this window only shows contents if the debugger is in stop mode (e.g. breakpoint reached) and the actual function has local variables. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Setting code break point through editor window Each assembler line in the mixed mode display of the source code has a blue arrow and a green circle symbol F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 20
Clicking to this circle again or right clicking into the circle and clicking on Break Point Set/Reset, releases the break point. Alternately, break point can be disabled by right clicking and on popup menu clicking Break Point enable/Disable. The symbol will change to F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
A code break point can also be set using Dialog box Open break point dialog box by clicking on Breakpoints… on Debug menu. On code tab, select software or Hardware type breakpoint. Type desired break address F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 22
When you select Hardware code breakpoint it is also possible to select Address Mask and Pass count. These features can be used by clicking Details button on a break dialog box. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 23
For example, if we set code break point at Break AddressH’DE1015 and select Pass count equal to D’5. When program is run, it halts due to hardware code break point when value of variable ‘i’ equal to D’5 F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 24
Breakpoints Breakpoint can be released by selecting breakpoint from Break list, and clicking on Delete button, alternately it can also be disabled by clicking Disable button F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
On Data tab, clicking on Details button will open Data break point details dialog box. Address Mask and Pass count feature work same as that of Hardware code break point. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 26
Further, comparison condition can be selected among Disable, Data agreement or Data not. Note, that the Data and Data mask text boxes are only available if either Data agreement or Data not is selected. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 27
And if we set if we set breakpoint as shown in below figure, program execution will halt every time when data H’ 05 is read from or written to location H’002538. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 28
For example, if we set the attribute is set to read, comparison condition is set to Data agreement, data is set to H’000F and Data Mask is set to H’FFF3. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Break point will be set to the same source code line number If it is not possible to meet above condition, it will be set to the same address location For example, F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 30
Breakpoints F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 31
Softune malfunction. Consider following example, Breakpoints are set as shown below F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 32
Breakpoints And now if code is modified and rebuild, break points will change its position F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 33
For Hardware breakpoint 4, this was at source code line no. 56, since after build there is valid instruction at that line; breakpoint is maintained at same source code line no. 56 F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
In-depth analysis of a program execution history can be performed using the data recorded by real-time trace. Trace Window Trace window can be opened by clicking Trace, on View pull down menu. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 35
Every time, after program run, to refresh a trace window right click on Trace Window, on a popup menu click on Refresh. To clear previous data, right click on Trace Window, on a popup menu click on Clear. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
For Instruction view, right click on Trace window, on a popup menu click on Instruction. Instruction view show instruction cycles using assembler mnemonics For raw data view, right click on Trace window, on a popup menu click on Raw Data. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
To move cursor to particular frame in trace window, right click on trace window, click on Jump…, on Jump dialog box, select frame under type option and desired frame number under Position option and click OK F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 38
To view assembly instruction at particular memory location, right click on trace window, click on Jump…, on Jump dialog box select Address under Type option and memory location under Position option and than select either Source or Assembly under window option. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Source code at particular frame number will be highlighted by pink background while traversing. In figure below, trace window shows address and instruction at frame number -D’2 and F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
To find particular memory location in trace window, one can use find feature. Right click on Trace window, on a popup menu click on Find. Search trace dialog box will appear. The line having information about searched memory location is highlighted with black background. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 41
(Memory location read by debugger) & (Address Mask) = (Search address) & (Address Mask) For the trace search, configured as shown in the figure below, F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Break radio button under Buffer full break option. MB2198-01 Emulator has 64K frames internal trace buffer and 256M frames External trace buffer. When program is halted by trace data buffer full break, corresponding line will be highlighted with yellow back ground and at status bar following message will be displayed Break at (<file name><Line no.><Memory location>) by trace buffer full...
To make effective use of the limited trace buffer capacity, a trace filter function is incorporated to provide a means of acquiring information about code fetch and data accesses to a specific region. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 44
When selected, code No acquire, only data read/write access will be acquired in trace data buffer. Similarly when selected data No acquire, only code fetch will be acquired in trace data buffer F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 45
Loop Compress function can be used so that sampling of redundant frames occupying two or more trace framescan be reduced to sampling of one frame. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 46
When it is selected No compress, total number of frame captured is 8775. And when it is selected Compress,total number of frame captured is 7975 As seen in below diagram, several frames are replaced by one frame F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Trace trigger can be configured to start trace data buffering or to stop trace data buffering in trace buffer, by selecting Start or Stop, under Trace control option. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 48
Similarly, an event set previously can be modified by clicking on Change button, Select an event from the List and click on Change button, Trace trigger details dialog box will appear F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 49
Acquire or No acquire under Trace state established before the trace trigger hit option A trigger event related to code can be set by selecting a Code under type option and clicking on Details button F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 50
H’F802D5, that event is marked by tag ===<< Trace OFF>> =====andno further data is acquired. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 51
And if we select, No acquirethanno data before trace trigger will be acquired A trigger event related to Data can be set by selecting a Data under type option and clicking on Details button F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Please enter negative numbers due to negative trace frames. The save dialog is available by right-clicking in the trace window and choosing Save file … . F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Data: Defined data is written to or read from a defined address Setup Sequence To use the sequence function, click Sequenceon Debug pull down menu. The sequence window will open and looks like this: F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 54
Setting must be performed in sequence starting with LEVEL1. When correctsetting is not performed or when the setting is deleted, the subsequent setting will beentirely deleted. Following Flowchart explains behavior of Sequencer F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 55
LV2 occurs, sequencer will reset to Level 1 and will wait till event defined at Level 1 occurs. At Level 3, it can be either configured to halt the program execution or to stop trace data buffering. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 56
Let us consider the following example, in the following code; sequence break is set as described below… At the beginning the sequencer starts in level 1. While execution, when PC pass through address H’F8032A, the sequencer jumps to level 2. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 57
Since we have selected to stop program execution, when the program execution halts, in a status bar message displayed is “Break at \multiply <Memory address>, by Sequential break” and corresponding line is highlighted by yellow background. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 58
Same can be verified from trace window as shown below In the above example, instead of selecting program execution halt, if we select to stop trace data buffering… F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 59
10, every time when variable ‘b’ is incremented. It is incremented by 100, every time when variable ‘a’ is incremented. Variable ‘out_count’ is incremented every time when count variable counts 1000. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 60
As seen in watch window, program execution is halted when variable ‘a’, ‘b’, and ‘c’are equal to 2. Accordingly variable count is incremented 111 times (since instruction count++ is not executed it is not showing the value 112 for variable count). F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 61
When the program execution starts, it halts due to Sequence break, in a status bar message displayed is “Break at <Memory address>, by Sequential break” and corresponding line is highlighted by yellow background. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 62
‘b’ is read as 0x000B, value of variable ‘a’ is updated. Notice the value of variable ‘count’ when event at Level 1(Event 1) is triggered. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 63
When the program execution starts, it halts due to Sequence break, in a status bar message displayed is “Break at <Memory address>, by Sequential break” and corresponding line is highlighted by yellow background. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 64
The set Sequence break can be enabled or disabled by clicking Enable or Disable under Status option. Or alternately it can be deleted by selecting the event from List and clicking on Delete button F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Memory area from external code and data memory can also be defined and guarded. Memory Map Setup Memory map setup dialog box can be opened by clicking on Setup and than Memory Map… on pull down menu F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 66
For example, to set a guarded read access to memory sector DF, enter H’DF0000 in Start address field and H’DF1FFF in End address field. Select Read option under Guarded attribute field. Click on Append. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 67
Break at <address> by guarded access/code If we want delete the set guarded access to a memory area, one need to select it from Map list and click Delete F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Now, take a look at example as shown below, in a main() function, two breakpoints are set. In a wait() function PORT00 is set to high when entered in function and then set to low when left the function. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 69
As can be seen, readings are closely matching with each other (difference in time is because of the time taken by MCU for executing instruction for calling and returning from function wait()) F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
When a check mark is set to Parameter, an argument value is displayed after each function name, as shown in above figure. When no check mark is set, only parentheses "( )" are displayed after each function name. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
The PC then returns to the value before the function was called. To understand the function, let us consider following example code F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 72
Result of call function dialog box as shown below opens. The PC then returns to the value before the function was called. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Change the address set in a vector in the following procedure: Select a vector table number and then click the Editbutton. The vector edit dialog box shown below opens. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
The jump function merely displays the jump destination program; it does not update the program counter to move control to the address set in the vector table. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
If it is a Mix mode code view, step will pass through disassemble source line no. Source Line Executes the step in units of source lines. Instruct Executes the step in units of machine languages. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
They are accessed by size of the top variable. Disable In case of variables as arrays or structures, the memory of each variable is read. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Sets the default base number for numerical value. Display Source Line Switches source line display to source line non display or vice versa for Trace- Instruction view. 13.4 Emulation F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Page 78
When this feature is enabled and if EMCSTPX (on MB2198-500 adapter Board) is pull down to ground, main clock is stopped. Similarly if ESCSTPX (on MB2198-500 adapter Board) is pull down to ground, Sub Clock is stopped F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
UART or CAN during program halt. 13.5 Setting Breakpoint while Running During program execution a break point can be set if the following set up is done: 13.6 Monitoring F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Directory 13.7 Display path information Specifies the path information to be displayed. Append path Sets the path to be added. Directory Displays the currently set directory. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Specifies where to output an error at GUI operation. In Command Operation Specifies where to output an error at command operation. In Batch Operation Specifies where to output an error at batch operation. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Softune one can debug the application program. The restriction in this scenario is one can use only hardware breakpoint for debugging. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Set maximum CPU frequency. (Lower value results in higher responsiveness of emulation system.) 13.12 Break Default break point Selects default code break point (i.e. Software or Hardware) F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
14. Trigger-Input and Emulator-Output How to Use the Two BNC Connectors 14.1 The BNC Connectors The MB2198-01 emulator has two BNC connectors. The left one is the “TRIG”-Input and the right one the “EMUL”-Output. 14.2 Trigger-Input With this input an execution can be stopped. The Trigger-Input is a hardware “break point”.
The BNC-Output “EMUL” goes logical “high” (= 3.3V) if a program is executed and is “low” (= 0V) if the program is stopped or a break point has occurred. This signal can be used for controlling external hardware. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
AN205555 - F2MC-16FX Family, Emulator System MB2198-01 AN205547 - F2MC-16FX Family, Emulator System MB2198-01 Installation Guide Information about Cypress Microcontrollers can be found on the following Internet page: http://www.cypress.com/cypress-microcontrollers F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Updates due to Softune version V30L34R05 done 12/24/2015 MKEA Migrated Spansion Document from MCU-AN-300240-E-V13 to Cypress format 01/22/2018 NOFL Update logo and links. Updated Copyright information. F²MC-16FX Family, Emulating and Debugging with Softune and MB2198-01, Doc. No. 002-04828 Rev. *B...
Need help?
Do you have a question about the MB2198-01 and is the answer not in the manual?
Questions and answers