µVision4 User's Guide

Command Line

µVision can be invoked from a command line to build a project, start the debugger, or download a program to Flash. The command applies to project and multiple-project files:

UV4 〚command〛 〚projectfile〛 〚options

Where

commandis one of the commands listed below. If no command is specified, µVision opens the project file in interactive Build Mode.
projectfileis the name of a project file. µVision project files have the extension .uvproj, multiple-project files the extension .uvmpw. If no project file is specified, µVision opens the project file used last.
optionsare additional parameters that specify the project target name or output file.

The following commands are available:

CommandDescription
-bBuilds the project and exits after the build process finished.

Examples:
UV4 -b PROJECT1.uvproj
-dStarts µVision in Debugging Mode. Use this command together with a debug initialization file to execute automated test procedures. Exit the debugging session with the EXIT command.

Examples:
UV4 -d PROJECT1.uvproj
-rRe-translates the project and exits after the build process finished.

Examples:
UV4 -r PROJECT1.uvproj -t"Simulator"
-fDownloads the program to Flash and exits after the download process finished.

Examples:
UV4 -f PROJECT1.uvproj -t"MCB2100 Board"

The following options can be used:

OptionDescription
-j0Hides the µVision GUI. Messages are suppressed. Use this option for batch testing.
-i import_file.xmlCreates a new project or updates an existing project using the data provided by an XML file, which has to be compliant to the schema project_import.xsd available in the directory ..\UV4. The target name can be specified with the option -t. By default, the target name is set to the device name. The GUI is suppressed automatically when using this option.

Examples:
UV4 MyProject.uvproj –i MyImport.xml
-n device_nameCreates a new project with the specified device_name. The target name can be specified with the option -t. By default, the target name is set to the device name. The GUI is suppressed automatically when using this option.

Examples:
UV4 MyProject.uvproj –n Device1234
UV4 MyProject.uvproj –i MyImport.xml –n Device5678 -t FlashDebug
-t targetnameSets targetname as the current target. If not specified, then the last known target is used.

Examples:
UV4 -r PROJECT1.uvproj -t"MCB2100 Board"
-o outputfileSpecifies the output log file.

Examples:
UV4 -r PROJECT1.uvproj -o"listmake.prn"
UV4 -r "C:\Keil\ARM\Example-mpw.uvmpw" -o "c:\temp\log.txt"
-qRe-builds the selected targets of a multiple-project. Ensure that each target has another object output folder. Use the menu Projects - Options for Target - Output - Select Folder for Objects.

Examples:
UV4 -r "C:\Keil\ARM\Example-mpw.uvmpw" -q -o "c:\temp\log.txt"
-zRe-builds all targets of a project or multiple-project. Ensure that each target has another object output folder. Use the menu Projects - Options for Target - Output - Select Folder for Objects.

Examples:
UV4 -b PROJECT1.uvproj -z -o "c:\temp\log.txt"
UV4 -b "C:\Keil\ARM\Example-mpw.uvmpw" -q -z -o "c:\temp\log.txt"
-xEnables DDE mode and returns complete command output. This option can be used only with the command -d.
-yEnables DDE mode and returns only command confirmations. This option can be used only with the command -d.

µVision sets the ERRORLEVEL after each build process to indicate the status. Refer to the Windows-help for information about ERRORLEVEL. The values are listed below:

ERRORLEVELDescription
0No Errors or Warnings
1Warnings Only
2Errors
3Fatal Errors
11Cannot open project file for writing
12Device with given name in not found in database
13Error writing project file
15Error reading import XML file

Examples: