Configuration and debugging of Pb-based Windows CE simulation environment

Source: Internet
Author: User
Tags configuration settings

 
Embedded systems are used in more and more scenarios, not just PDAs and handheld computers. Many mobile phones, game consoles, digital players, digital cameras, and on-board computers are also using standard CE embedded systems, even a conservative traditional AV device, DVD and MPEG-4 player, is no exception. For example, if your phone is installed with a Windows SCE system, you can not only use mobile phones, manage contacts, send and receive emails, but also run Windows software to access ICQ, play games, and play digital music. It is not hard to imagine that the thick monochrome LCD screen will soon disappear from the counter and replace it with colorful colors, inforware is equipped with Ce, palm, and other standard operating systems.

However, because of the wide variety of WindowsCE devices, it is inconvenient to compile and test the software. No software company can own all types of Ce devices. This problem is particularly prominent in the Development of Ce 2.0 and 3.0. For example, a CE software producer develops an application software on a handheld computer, but soon after the release, it was found that the software was almost unusable on CE's PDA, because the screen of the handheld computer was 640x240 pixels, And the PDA was indeed 240x320, the program menu cannot be displayed at all.

To solve this problem, Microsoft Windows CE. NET provides an all-around, inexpensive simulation environment. He can simulate various ce devices on the PC, customize CE software for different environments, and share the vast majority of source code, which can be directly downloaded from the Internet. Software companies can debug CE software on different platforms without having all types of Ce devices, or even rewrite the CE Kernel on their own to fully open the CE of code. net, not only the ease of use of windows, but also the high plasticity of Linux, so that Ce development is handy.

Compared with other simulators, Windows CE. Net does not have a high requirement on computers: We recommend that you configure a CPU of over MHz, MB of memory, and up to GB of hard disk space. However, in actual development, I found that the recommended configuration is far from enough, especially when the Rom is created, and the simulation terminal can easily eat up 1 GB of memory. I feel that 1 GHz CPU, 1 GB memory, and 5-10 Gb hard disk space can meet the requirements. I believe most of my friends still have this condition.

1. Configure the simulation platform (take Windows CE. Net 4.2 as an example, the same below)

With Windows CE. net, we can "make" various ce devices. The procedure is as follows:

1. Start Windows CE. NET platform Builder (PB), open the File menu, and select new platform (new platform). The new platform Wizards (creation wizard) appears, and select next.

2. Select the simulation processor. The default value is emulator: x86, that is, x86 compatible type. Use your x86 processor to simulate the CE processor. After the selection, click Next.

 

 

3. Select the device type to be simulated. CE can run on many devices. The simulator can simulate these devices. Here, select mobile handheld. Then give your platform a name, such as emulatordemo, and click Next.

 

4. Configure the software environment to be integrated. If you need a web browser or inbox or something, select the environment and click. Next.

 

 

5. Add the required network protocol and click Next.

6. There are some precautions in the following window. After reading the notes, click Next.

7. Click Done to create the environment.

 

Ii. Generate ce OS Rom

As we all know, devices using Windows CE and other systems generally store ce in ROM, ce. in net, platform builder also places the generated ce in a ROM image file. The default file name is (nb. BIN), The creation steps are as follows:

1. Select set Active configuration from the build menu.

2. In the simulation platform list, select emulatordemo-emulator: x86 Win32 (wce emulator) debug and click OK.

 

3. Select Settings from the platform menu.

4. In the build options tab of settings, make sure that the enable full Kernel Mode option and other options are selected. This is very important for debugging programs.

 

5. You can select some options (such as support for MFC or USB mouse) in the catalog as needed to add them to your customized platform.

6. Select build platform from the build menu.

 

7. Some warnings will appear during the creation process and click OK.

It takes some time to create a Rom. It may take 10 minutes or dozens of minutes for a 32 m Rom. After the Rom is created, 0 error (s), XX warning (s) will appear in the output window).

Iii. Use the simulator to run the CE operating system ROM

After creating a Rom, you can establish a connection with the simulator and transfer the Rom to the simulator for running:

First, you must configure the simulator.

1. Select configure remote connection from the target menu.

2. Select the services tag. In the download option box of services for active named connection, select emulator. Click Configure.

3. Set the screen size (wxhxd) of the terminal you want. For example, a typical PDA has a size of 320x240x16. Or you can simply customize your own comfort, such as 800x600x16.

 

 

4. Input 64 in memory size memory (MB.

5. In the kernel transport option box, select emulator.

6. Select the settings tab. Click Download/initialize device to ensure that download image, initialize (jump to image), connect to device are selected, and click OK to continue.
  
Now that the simulator has been configured, you can call the Rom to run it.

7. Click Download/initialize in the target menu.

8. The kitl security warning dialog box and some prompts will appear. Select Yes for all.

9. Wait for a while and then the simulator terminal named emulatordemo-emulator for Windows CE appears.

 

 

The WindowsCE on the simulator is exactly the same as the real windwosce device. It can run software, listen to music, access ICQ, view webpages, and send and receive emails.

The debug toolbox that appears at the same time can also debug ce.

4. Use the debug program

There are two running modes for the simulator terminal: Release and debug. Release is used to test the Rom to be released. In debug mode, you can use kernel debugger to debug the core of CE. For example, debug the mouse event:

1. Select break from the Debug menu.

2. Select open from the File menu. Find the ps2mouse in the path % _ winceroot % \ platform \ emulator \ drivers \ kbdmouse \ emulkbms. CPP, select open. This is the source code about the mouse driver.

3. In the edit menu, select find. In find what, enter _ move and select find next.
Now you can modify the code for the move event.

4. Press the F9 key to insert a breakpoint code. A red dot is displayed on the side.

5. Select go from the Debug menu.

6. On the taskbar, select emulatordemo-emulator for Windows CE to display the emulatordemo-emulator for Windows CE window.

7. Place the mouse pointer in the emulatordemo-emulator for Windows CE window. At this time, you will find that the running of the simulator is paused at the breakpoint just set, so that you can modify and write code in real time.

* I strongly recommend that you back up the data before rewriting the source code. Otherwise, it will not be good if it is modified.

8. Select breakpoints from the edit menu.

9. Remove all breakpoints, select Remove all, and select OK.

10. In the Debug menu, select stop debugging to end debug.

In the Debug menu, select go. For other parts, such as the keyboard and serial port, debug is similar.

V. customize different languages for the simulation terminal environment

Windows CE. Net can generate ce for interfaces of different languages, just like the region settings in Windows XP. It is not only the interface language, currency symbol, but also the usage habits. For example, a Japanese Rom is generated.

1. Select disconnect from the target menu and click OK.

2. In the emulator menu of the simulator terminal, select shut down.

3. In the shut down dialog box, select turn off emulator and select OK to completely close the simulator terminal.

4. Select Settings from the platform menu. Make sure that the EMULATOR-X86 Win32 (wce emulator) debug under settings for is selected.

5. Select the locale tag. Select Japanese from the default language list. Disable platform settings and select OK.

6. Select rebuild platform from the build menu. During the creation process, you will see some warning and click OK. (Figure 13)

 

7. After re-creating the CE Rom, select download/initialize from the target menu. Open the simulator and you will see the Japanese version ce.net 4.1.

* Note: ce.net supports multiple languages. The Ce on the Japanese interface can also display simplified and traditional Chinese characters.

6. Create a simple "Hello World" program

Next, we will create a simple ce program for testing and run it on the simulator.

1. In the IDE in the target menu, select disconnect and click OK.

2. In the displayed warning, click OK to return to the integrated development environment.

3. In the emulator menu of the simulator terminal, select shut down.

4. In the shut down dialog box, select turn off emulator and select OK to completely close the simulator terminal.

5. select new project or file from the File menu.

6. Select the projects tab and select wce application.

7. In the Project Name text box, enter hello and select OK.

8. Select a typical "Hello world! "Application, select finish.

 

 

9. In the build menu, select build hello.exe to create a program.

When the creation is complete, you will see: hello.exe-0 error (s), 0 warning (s ). Message, indicating that the creation is successful.

7. Run the program in the simulation environment

Run the user-created program. You do not need to re-establish ce Rom.

1. In the IDE in the target menu, select download/initialize to open the simulation terminal. Click OK on the kitl security warning.

2. Select Run programs from the target menu.

3. In the available Programs list, select hello.exe, and select Run.

4. hello.exe will be downloaded to the terminal for running.

5. On the taskbar, select emulatordemo-emulator for Windows CE and you will see that "Hello World" has already appeared on the terminal.

 

 

8. Create an Embedded Visual C ++ SDK

After learning how to create and configure the simulation platform, generate the CE operating system ROM, use the debug program and run the program in the simulation environment, we can create the Embedded Visual C ++ SDK for development.

1. Select disconnect from the target menu and click OK.

2. In the emulator menu of the simulator terminal, select shut down.

3. In the shut down dialog box, select turn off emulator and select OK to completely close the simulator terminal.

4. Select configure SDK from the platform menu.

5. When the Export SDK wizard appears, click Next to continue.

6. In the product name for MSI installation text box, enter emulatordemo_sdk.

* Note: Do not use spaces in the names of Rom, source code, programs, and object devices.

7. In the manufacturer name text box, enter emulatordemocompa.

 

8. Select Embedded Visual C ++ 4.0 support and click Next to continue.

9. On the congratulations page, click customized SDK and select modify the SDK configuration settings.

10. Select the license file tag and append End User License Agreement.

11. In the End User License Agreement path text box, enter the file name you want to use as the End User License Agreement (EULA. -

12. Select OK to close the window.

13. Select build SDK from the platform menu.

14. There are some precautions in the following window. After reading this article, click next and then click done to start creating the SDK.

The generated SDK emulatordemo_sdk.msi will be placed in the % _ winceroot % \ public \ myplatform \ SDK folder.

  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.