Keil Logo

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

command is one of the commands listed below. If no command is specified, µVision opens the project file in interactive Build Mode.
projectfile is 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.
options are additional parameters that specify the project target name or output file.

The following commands are available:

Command Description
-b Builds the last current target of a project and exits after the build process finished. Refer to option -t to change the target. For multi-projects, the command builds the targets as defined in the dialog Project - Batch Build.

Examples:
UV4 -b PROJECT1.uvprojx
-c Clean all project targets of a project. For a multi-project, the command cleans all targets that have been selected in the dialog Project - Batch Build. Refer to the note on Project Menu and Commands for details about the cleaning process.

Examples:
UV4 -c PROJECT1.uvprojx
-cr Clean all project targets and re-translate the last current target of a project. Refer to option -t to change the target. For multi-projects, the command cleans all targets and re-translates the targets as selected in the dialog Project - Batch Build. Refer to the note on Project Menu and Commands for details about the cleaning process.

Examples:
UV4 -cr PROJECT1.uvprojx
-d Starts µ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.uvprojx
-f Downloads the program to Flash and exits after the download process finished.

Examples:
UV4 -f PROJECT1.uvprojx -t"MCB2100 Board"
-r Re-translates the last current project target and exits after the build process finished. Refer to option -t to change the target. For multi-projects, the command re-translates the targets as defined in the dialog Project - Batch Build.

Examples:
UV4 -r PROJECT1.uvprojx -t"Simulator"

The following options can be used:

Option Description
-j0 Hides the µVision GUI. Messages are suppressed. Use this option for batch testing.
-i import_file.xml Creates 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 may be specified with the option -t. If a project is created from the command line without -t, the device name is used as the name of the target. The GUI is suppressed automatically when using this option.

Examples:
UV4 MyProject.uvprojx –i MyImport.xml
-n device_name Creates 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.uvprojx –n Device1234
UV4 MyProject.uvprojx –i MyImport.xml –n Device5678 -t FlashDebug
-t targetname Sets targetname as the current target. If not specified, then the last known target is used.

Examples:
UV4 -r PROJECT1.uvprojx -t"MCB2100 Board"
-o outputfile Specifies the output log file.

Examples:
UV4 -r PROJECT1.uvprojx -o"listmake.prn"
UV4 -r "C:\MyProjects\ARM\Example-mpw.uvmpw" -o "c:\temp\log.txt"
-q Re-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:\MyProjects\ARM\Example-mpw.uvmpwx" -q -o "c:\temp\log.txt"
-z Re-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:\MyProjects\ARM\Example-mpw.uvmpwx" -q -z -o "c:\temp\log.txt"
-x Enables DDE mode and returns complete command output. This option can be used only with the command -d.
-y Enables 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:

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

Examples:

  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.