Online ARM simulator knowledge--essential for embedded system designers

Publisher:量子启示Latest update time:2012-09-17 Source: 21IC Keywords:ARM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This article provides some information about in-circuit ARM emulators and the benefits they bring to you as an embedded system designer. Based on your needs, you will make a more appropriate choice of development tools in product development.

1. Development cycle of embedded products

The first stage of a typical embedded microcontroller development project is to use a C compiler to generate target code from the source program. The generated target code will include physical addresses and some debugging information. Currently, the code can be executed and debugged using a software simulator, a target monitor, or an online emulator. The software simulator uses its CPU (such as x86) and its system resources to simulate the target CPU (such as P51XA) on a PC or workstation platform and execute the user's target code; the target monitor downloads the generated target code to the program memory of the user's target board and adds a monitor task software to the downloaded code to monitor and control the execution of the user's target code. The user uses a desktop computer to debug the program through the serial port or other debugging port on the target board.

Program debugging is achieved by setting breakpoints and stopping the program at a specified instruction location. When the program stops, the contents of the memory and registers are checked as clues to discover program errors.

After the program is debugged and all errors are found, the source code is modified and recompiled to generate an object code file in a standard format, such as Intel HEX. This object code will be stored in the non-volatile memory of the final product, such as EPROM or FLASH.

2. Why do we need an emulator?

Software simulators and target monitors provide an economical debugging method that is sufficient for many designs. However, there are also many occasions where simulators are needed to find program errors. In any case, simulators can reduce debugging time, simplify system integration, increase reliability, and optimize test steps, making them worthwhile. More often, engineers use software simulators and emulators at the same time at different stages of the project, especially in large development projects.

Software simulators and software debuggers offer only a few features beyond breakpoints, such as displaying port contents and code coverage. There is no means of detecting events and conditions and reacting to them, nor is there a way to record the MCU's bus cycles and determine what exactly happened during program execution. If your MCU has on-chip EPROM or FLASH memory and is running in single-chip mode, only an emulator can debug the system without seriously occupying and consuming MCU resources.

In-circuit emulators can easily do these things and provide many other functions. Emulators are the bridge between software and hardware. At some stage in the project, you must run the program on the actual hardware. Emulators can easily help you understand how to make full use of the emulator during the debugging stage.

3. What exactly is an emulator?

The emulator can replace the MCU in your target system and simulate its operation. The emulator runs just like the actual target processor, but adds other functions, allowing you to observe the program and data in the MCU and control the operation of the MCU through a desktop computer or other debugging interface. The emulator is an economical and effective means of debugging embedded software. Nohau's EMUL51XA-PC emulator series is used to debug Philips P51XA series MCUs, while the EMUL51-PC series emulators support 8051 series microcontrollers from many manufacturers.

Internal and External Modes

Internal mode means that the program and data are located inside the MCU chip in the form of FLASH or EPROM. The address and data bus are not visible to the user, and the chip pins saved are provided to the user as I/O ports. Internal mode is also called single-chip mode, and all program execution occurs in the internal ROM. In order to effectively emulate this chip, the emulator is required to use bondout or enhanced Hooks chips.

External mode is when the program memory, and possibly some data memory, is located outside the MCU, and address and data buses are needed to access this memory. External mode is also called extended mode. User chips, bondout chips, and enhanced hooks chips can all generate this operating mode. In this case, the address and data bus pins of the chip cannot be used as general I/O ports. Nohau's emulator uses these three chips to achieve effective program debugging.

5. Bondout, Enhanced Hooks Chips and Standard Product Chips

These terms refer to the three types of emulation processors used by the emulator to replace the target MCU. Only Bondout and Enhanced Hooks chips can achieve single-chip debugging, while standard product chips cannot. Compared with standard product chips, bondout chips have some additional pins that are connected to the circuit nodes of the silicon inside the chip, so they are also called "super-pin chips". P51XA series microcontroller emulators all use bondout chips, and EMUL51XA-PC is a good example.

Enhanced Hooks chips use machine cycles that are not available on various chip pins to provide address and data buses. Some 80C51 series emulators use enhanced Hooks chips. Interestingly, some of these enhanced Hooks chips are also standard product chips. Using enhanced Hooks chips as emulated CPUs requires some additional special function circuits to decompose the address and data buses and some necessary control signals from the multiplexed chip pins. The user's target board does not have these circuits, so all are still in single-chip working mode. Using bondout chips and enhanced Hooks chips can achieve extremely accurate simulation, from functions to chip power consumption.

6. Make the hardware work

Software simulators are great, but they can't take into account all the variables. The simulator designer must take everything into account, especially those that only appear after the hardware is built, such as capacitors, timings, inductors, chip versions, etc., which become more and more important as CPU speeds increase.

The target Monitor is much better because it runs on actual hardware. However, in order for the Monitor program to run, the target system must be a complete and working system. This is not the case with the simulator, which can run even when the target system hardware is incomplete or even without any hardware. However, the target Monitor can be installed in the program of the final product and can be activated at any time for debugging, so this is still a certain advantage for testing and maintenance.

7. Advantages of the simulator

The simulator has all the features of the simulator and target monitor, plus the following advantages:

1. Does not use target system or CPU resources

The target Monitor kernel generally requires 10K of ROM and 10-20 bytes of RAM and a free communication port. A good emulator will not use any of the above. The emulator should be invisible to the target system, which is the so-called "fully transparent emulation".

2. Hardware breakpoints

Software breakpoints are implemented by inserting a 2-byte TRAP instruction in the user's target code to divert the normal program flow to the debugger. If the program counter happens to fall on the second byte, the program will crash. The hardware breakpoint function of the Nohau emulator uses a comparator to compare the system bus state with the preset latch content to monitor access to the specified address without modifying any program memory content. Regional breakpoints need to be implemented using hardware breakpoints, but software breakpoints are still very convenient and useful, so Nohau's emulator provides both breakpoint functions.

When the user's target program is stored in ROM, software breakpoints cannot be used because the TRAP instruction cannot be inserted. For ROM program memory systems, only hardware breakpoints can be used. [page]

3. Tracing function (TRACE)

The trace function records all processor machine cycles and optional external signal levels in time. The trace function can record all instruction fetch operations and, in microcontrollers that use pipeline parallel processing mode, such as the P51XA, distinguish between instructions that were canceled in the pipeline and those that were successfully executed. The start of the trace is achieved through a conditional trigger, which allows filtering, that is, only the instruction cycles of interest are recorded and the rest are discarded. The software simulator and target monitor do not have trace memory and cannot implement the Trace function.

4. Conditional trigger

Conditional triggering is a very powerful and easy-to-use function that allows you to perform a pre-set action when certain events occur. The trigger conditions can include address, data, clock cycle and external signal. These conditions can trigger a breakpoint, start/stop trace recording, record a time stamp, and many other actions determined by the simulator function. This powerful tool can only be realized in the simulator. The conditional trigger function and trace function of Nohau simulator are organically combined, with three levels of time triggering, and the highest level trigger has a counting function.

5. Real-time display of memory and I/O port contents

After using the emulator, you can observe the contents of the memory and I/O ports in real time, not just software simulation. You can connect your favorite peripheral chip to the lower part of the Nohau emulator feature board and access it in the debug interface. If you know all the details of the peripheral, you can simulate the system very accurately.

In many cases, we may have found that some problems only appear after the actual hardware system is connected. Using a simulator can enable you to enter this stage from the beginning, so as to find problems early and complete the debugging task faster.

Because the RAM inside the emulator can replace the ROM in the target system, you can also easily debug and modify program code and data in the ROM target system.

Similarly, when the target system has not yet installed memory, you can use the emulation memory in the emulator to debug the system. The size, resolution and image address of the emulation memory can be selected by the user.

6. Hardware performance analysis

Software simulators and target monitors can only simulate system operation and then perform performance analysis, but they already do a good job; emulators go a step further and perform performance analysis on actual hardware, which increases accuracy. In addition, using actual hardware can reveal errors that cannot be found in software simulation. False interrupts and other faults may unexpectedly consume CPU resources, causing serious performance problems that are difficult to find. Using the performance analysis of the emulator, these problems are easily exposed.

7. Connect the emulator to the target system

Connecting the emulator to the target system is easy. Most problems are solved by the emulator company and its agents. Connecting requires two steps:

First, you need to select the appropriate adapter connection method, preferably welding and socket. The P51XA series MCU simulator supports two target connection methods: PLCC socket and surface mount. Clip-on adapters are expensive and unreliable, so they are not recommended for users.

Then, the software and jumpers on the emulator must be configured correctly to match the target board and the software initialization routine. This is simple and good technical support should cover this. Nohau's emulators usually work with the default settings.

For the P51XA series MCU, just solder a chip socket (PLCC or surface mount) on the user's target board, insert the EMUL51XA-PC feature board adapter connector, and run the debugging software on a PC or laptop. Then you can test the target system with the TIme.c test program provided with the simulation!

8. Conclusion

This article provides some information about in-circuit emulators and the benefits they bring to you as an embedded system designer. Based on your needs, you will make a more appropriate choice of development tools in product development.

Keywords:ARM Reference address:Online ARM simulator knowledge--essential for embedded system designers

Previous article:STM32-F2 MCU in factory automation
Next article:Analysis and summary of problems in ARM embedded systems

Recommended ReadingLatest update time:2024-11-16 17:51

Microsoft and Arm collaborate to provide cloud-to-edge AI toolchain
The following is from Microsoft's official blog Microsoft is committed to making digital transformation easy, fast and cost-effective for our customers. We believe that software is the foundation of intelligent devices and an essential component of all intelligent devices. At the core of our strategy in the silicon
[Internet of Things]
Advice for college students on learning ARM and FPGA
  For beginners, there are many knowledge points to learn. People often feel very confused about where to start. Freshmen start with C language. In the freshman stage, because they are still very unfamiliar with computers, it is impossible to write a software with a complete graphical interface. The focus is on learni
[Microcontroller]
Synopsys + Arm: Essential solutions for automotive innovation
Self-driving cars are no longer a distant concept and are even on the road in some countries. To meet new driving needs such as convenience, safety, autonomy, and electrification, the automotive industry is moving towards software-defined vehicles (SDVs). This shift requires a more powerful new electrical/ele
[Automotive Electronics]
Design of real-time power load control management system based on ARM9 and GPRS
In today's industrial society where electricity is scarce, timely and accurate acquisition of users' electricity load information and timely control and dispatch based on it are of great practical significance for improving energy utilization. Traditional electricity settlement relies on manual on-site data reading
[Microcontroller]
Design of Reconfiguration Controller Based on ARM+FPGA
Reconfigurable technology refers to a design method that uses reusable software and hardware resources to flexibly change its own architecture according to different application requirements. Conventional SRAM FPGAs can be reconfigured. Using the principle of hardware reuse, the reconfigurable controller designed in
[Microcontroller]
Design of Reconfiguration Controller Based on ARM+FPGA
ARM Cortex M0 LPC1114 Pinout and Overview
We take LQFP48 package as an example.   From the description of the pins in the figure, we can see that almost every pin has multiple functions. For example, pin 9: PIO1_8/CT16B1_CAP0, which means that pin 9 can be used as a general input and output pin P1.8, and can also be used as a capture pin of 16-bit timer 1. (
[Microcontroller]
ARM Cortex M0 LPC1114 Pinout and Overview
ARM bare metal article--serial UART experiment
You should all be familiar with the serial port. I won’t go into the specific communication principles as there are many discussions on Baidu. Then just look at the functions directly. void Uart_SendByte(int data) //This function sends integer data, the parameter is data {     if(whichUart==0) //This is the selected
[Microcontroller]
ARM bare metal article--serial UART experiment
Rene Haas talks with Jen-Hsun Huang: Unique management philosophy, systematic innovation system, and the future of AI
"Tech Unheard" is a technology interview podcast hosted by Arm CEO Rene Haas, focusing on the forces of change in the industry and exploring cutting-edge technologies and the stories behind them. The first episode invited Nvidia's founder, president and CEO Huang Renxun. Through in-depth conversations, the two share
[Semiconductor design/manufacturing]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号