Keil Logo

µVISION DEBUGGER: Creating Targets for Flash and Monitor


Information in this article applies to:

  • C166 Version 4.20
  • µVision Version 2.20
  • MCB167 Evaluation Board
  • MCB167-NET Evaluation Board

QUESTION

I'm developing an application with Keil Monitor-166 on a Phytec Evaluation Board. For production, I want to run my program from Flash memory. How can I create a project that allows me to run the application from Flash or with the Monitor-166?

ANSWER

µVision allows you to use project targets with different project settings. With this feature, it is possible to create a project that builds a target for use with the Phytec board and monitor and another target for Flash download.

The User's Guide "Getting Started and Creating Applications" (GS166.PDF) describes in "Chapter 4. Creating Applications" how you create project files for µVision2. In "Chapter 11. Using Monitor-166" read the section "Target Options when Using Monitor-166". Study these chapters to learn how to create applications that can be tested under µVision with Monitor-166.

The Keil 166 development tools come with sample applications in the folder Keil\C166\Examples\Boards. These examples are already configured for the debugging with Monitor-166.

When you run a program under Monitor-166, the complete program code must be located in RAM space. For the Flash Version, the program code and the constants need to go into the Flash ROM space and the data area of your application needs to go into the RAM space of your board. Typically, a 166 program contains a configured version of the startup code (START167.A66) which specifies the address ranges of the Chip Select (CS) lines of the 166 controller. You will need a different version of the startup code for Monitor debugging and for the Flash version of your application.

In reality, you must create a version of the startup code for the Flash project. You should make a copy of the START167.A66 and rename it for your Flash project (START167_FLASH.A66 for example).

If you have already created an application that runs well with the Keil Monitor-166, you may then create an additional target for the Flash variant of your software.

  1. Add the new START167_FLASH.A66 file to your target. Open the Context Menu in the Project Window with a right mouse click in the Project Window on the File Group that contains the file START167.A66. Then use Add Files to Group ... and select the new START167_FLASH.A66 file.
  2. The file START167_FLASH.A66 is not required when you debug with the monitor. So, right-click on START167_FLASH to open the context menu and select Options for File .... This opens the Options - Properties dialog. Un-check Include in Target Build and START167_FLASH.A66 will be not used in this target.
  3. The next step is to create a new target for the Flash Version. Add a new target using the Targets, Groups, and Files item from the Project Menu. In the dialog, enter a new target name under Target to Add (Flash Version, for example) and select Copy all Settings from Current Target. Click Add. Select Flash Version from the Available Targets and click Set as Current Target. Close this dialog. You have now created two targets for your application that can be quickly changed with the Select Target drop down box in the build toolbar.
  4. Now you must modify the settings for the new target Flash Version. You can do this with the Project - Options for Target dialog. You will probably need to modify the settings under External Memory since the Flash variant of your software needs program code and constants in ROM and the data area needs to stay in RAM.
  5. The last step is to exclude the monitor version START167.A66 from the target Flash Version and to include the START167_FLASH.A66 version that was added in earlier. This is done in the Options - Properties dialog with the Include in Target Build selection.

Now you can generate the Flash variant of your application using the Project - Build command.

MORE INFORMATION

  • Refer to the "Getting Started and Creating Applications" user's guide that is provided with the µVision Software Installation.
  • Application Note 157: Using the ST10 FLASHER Tool with the MCB167-NET Board

SEE ALSO

Last Reviewed: Wednesday, December 9, 2020


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.