Essential ARM emulator knowledge for embedded system design

Publisher:真诚友谊Latest update time:2013-01-22 Source: 21ICKeywords:Embedded Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This article provides some information about the in-circuit ARM emulator and the benefits it brings 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.

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:Embedded Reference address:Essential ARM emulator knowledge for embedded system design

Previous article:Urban rail transit UPS integration application solution
Next article:UPS Uninterruptible Power Supply Maintenance

Recommended ReadingLatest update time:2024-11-17 00:05

The easiest way to install the GCC toolchain for ARM architecture in Ubuntu
1. Install the ARM-Linux-GCC toolchain   Just one command:   sudo apt-get install gcc-arm-linux-gnueabi   The premise is that your Ubuntu system version is the latest version supported by the official website. If not, please upgrade. Execute the above command. 2. Using the Toolchain   Note! You cannot use the gc
[Microcontroller]
ARM11 learning based on S3C6410 (Part 9) Light up the LED
The core initialization of S3C6410 has been completed before, but this is just completed, but whether the program is correct or not needs to be verified. The simplest verification method is to light up the LED. If we write a program to light up the LED after the core initialization is completed, it means that there is
[Microcontroller]
ARM11 learning based on S3C6410 (Part 9) Light up the LED
Design of car black box based on ARM
0 Introduction The car driving recorder, commonly known as the car black box, is an electronic device that can record the vehicle's driving speed, time, mileage and other status information. The driving recorder can record the relevant information of the vehicle operation and the driver's driving activities in
[Microcontroller]
Determination of the connection method and address between memory and ARM
       I have always had a lot of questions about the connection method and address determination of ARM peripheral FLASH and SDRAM. Today I finally understood a little bit. I will post my understanding on this.         Generally, when s3c2410 or s3c2440 is connected to NOR flash, the address lines are always offset b
[Microcontroller]
Design and application of wireless signal acquisition system using ARM and Bluetooth
For short-distance wireless transmission, Bluetooth uses fast frequency hopping technology to ensure the stability of the link and minimize the impact of interference. It is suitable for industrial test environments with a lot of noise interference. Since wireless transmission is digital, there is usually n
[Microcontroller]
Design and application of wireless signal acquisition system using ARM and Bluetooth
Linux Embedded ARM-Linux Basics
ARM Architecture 1. Please briefly describe the characteristics of ARM processors, and state at least 5 characteristics. (5 points) : low power consumption; low cost, high performance, RISC structure; fixed instruction length; support Thumb (16-bit)/ARM (32-bit) dual instruction sets; small size; 2. Please write the s
[Microcontroller]
IAR Systems is the first to support the Arm Cortex-M55 core with integrated AI technology
IAR Systems is the first to support the Arm Cortex-M55 core with integrated AI technology IAR Embedded Workbench now supports the latest Arm Cortex-M55 processor series, providing powerful tool support for continuous innovation in embedded applications Uppsala, Sweden, November 2021 – IAR Systems®, a leading gl
[Embedded]
IAR Systems is the first to support the Arm Cortex-M55 core with integrated AI technology
Key points for developing embedded system programs based on ARM (V)
Introduction As mentioned in the previous article, in many cases, applications need to switch between ARM and Thumb states. This section discusses the implementation methods of interactive work and some precautions. 1 Reasons for interaction As mentioned earlier, Thumb instructions have better performance than
[Microcontroller]
Key points for developing embedded system programs based on ARM (V)
Latest Power Management Articles
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号