MCUXpresso IDE Command Line User Guide

Transcription

MCUXpresso IDE CommandLine User GuideRev. 11.6.0 — 13 July, 2022User guide

NXP SemiconductorsMCUXpresso IDE Command Line User Guide13 July, 2022Copyright 2022 NXP SemiconductorsAll rights reserved.MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.ii

NXP SemiconductorsMCUXpresso IDE Command Line User Guide1. MCUXpresso IDE command-line tools . 11.1. Introduction . 11.2. Parameters . 11.3. Running the MCUXpresso IDE command line on Windows, Linux and Mac . 21.4. Runtime commands supported by MCUXpresso IDE command line tool . 31.5. Runtime command properties . 31.6. Runtime commands exit value . 42. Build examples from one or more SDKs or from an examples XML definition file –example.build . 62.1. Steps to run the command . 62.2. Property file parameters . 72.3. Command output . 83. Create/build new projects – project.build . 93.1. Steps to run the command . 93.2. Property file parameters . 103.3. Command output . 114. SDK check dependencies – check.dependencies . 124.1. Steps to run the command . 124.2. Property file parameters . 134.3. Command output . 135. SDK examples options validation – example.options . 145.1. Steps to run the command . 145.2. Property file parameters . 155.3. Command output . 156. SDK package validation – sdk.validate . 166.1. Steps to run the command . 166.2. Property file parameters . 176.3. Command output . 177. Install IDE part support from one or more SDKs – partsupport.install . 187.1. Steps to run the command . 187.2. Property file parameters . 187.3. Command output . 188. Display information about the current SDKs – list.info . 208.1. Steps to run the command . 208.2. Property file parameters . 208.3. Command usage and parameters . 208.4. Command output . 219. List all installed MCUs parts – list.parts . 239.1. Steps to run the command . 239.2. Property file parameters . 239.3. Command output . 2310. Print all available toolchain settings options – toolchain.options . 2410.1. Steps to run the command . 2410.2. Property file parameters . 2410.3. Command output . 2410.4. Related manifest toolchain settings example . 2410.5. Related project build options in MCUXpresso IDE . 2511. Legal information . 26MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.iii

NXP SemiconductorsMCUXpresso IDE Command Line User Guide1. MCUXpresso IDE command-line toolsThis guide will show you the steps to use MCUXpresso IDE in headless mode (command lineinterface) to perform a variety of SDK related tasks including: Creating and building SDK example projects Creating and building new project based on SDK Validating an SDK Listing information regarding one or more SDKs1.1 IntroductionBasic command line support is integral part of Eclipse CDT applications derived from the CDT.Documentation of the command line support in CDT can be found here.Only basic operations like import and build of existing project from command line (also known as“headless build”) are supported. Examples how to use headless builds can be found here: Eclipse Embedded CDT Building Eclipse and MCUXpresso IDE Projects from the Command LineMCUXpresso IDE extends the basic command line support with additional features allowing tocreate and build new MCUXpresso SDK projects, import example projects from SDK package,validate SDK package and others.1.2 ParametersTo use the MCUXpresso IDE in headless mode, you have to use the following parameters:MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.1

NXP SemiconductorsMCUXpresso IDE Command Line User GuideTable 1.1. eadless.applicationrun command path to properties file help command DescriptionUse the application id to run MCUXpresso IDEcommand line tool. Run MCUXpresso IDE withthis parameter to get help about MCUXpresso IDEcommand line tool.Parameter specifying the runtime command tobe executed and properties file containing buildproperties needed to run the command. See list ofruntime commands supported by MCUXpresso IDE.You can use -help attribute to generate all propertiesneeded to run the command.Prints documentation of the command includingtemplate with all properties used by the command.Path to the workspace directory. Mandatoryparameter if runtime commands related to projects arerun, e.g. project.build or example.build.Opens a separate console window with MCUXpressoIDE log. The window is automatically closed after thejob is finished. Use -noExit to keep the window afterMCUXpresso IDE finishes. NOTE: Please be awarethat the log may contain additional entries related tothe internal IDE logging mechanism (errors, warnings,exceptions) that are not necessarily related to thecommand result.Used together with -consoleLog to keep the logwindow opened.Use this parameter to suppress the MCUXpresso IDEsplash screen shown when the command line toolruns.Use this parameter to suppress popup window incase that the MCUXpresso IDE command line toolencounters an error.data path/to/workspace mple: This will print basic help for the MCUXpresso IDE command line tool in a new consolewindow that will be preserved after MCUXpresso IDE finishes.mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -consoleLog -noExitNOTE: There is a difference between the way that MCUXpresso IDE is run in headless modeand the way that standard Eclipse headless build is. For standard Eclipse headless build use:mcuxpressoidec.exe -application com.nxp.mcuxpresso.headless.application -consoleLog -noExit For MCUXpresso IDE use:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -consoleLog -noExit1.3 Running the MCUXpresso IDE command line on Windows,Linux and MacThe command line interface usage is the same for all OSes, except for the executable to run:MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.2

NXP SemiconductorsMCUXpresso IDE Command Line User Guide Windows: use mcuxpressoide.exemcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -run list.parts-consoleLog -noExit -noSplash Linux and Mac: use mcuxpressoide./mcuxpressoide -application com.nxp.mcuxpresso.headless.application -run list.parts -consoleLog-noExit -noSplashAll the examples from this documentation use the Windows OS.1.4 Runtime commands supported by MCUXpresso IDE commandline toolTo get list of runtime commands supported by MCUXpresso IDE run:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -consoleLog -noExitFollowing is list of runtime commands supported starting with MCUXpresso IDE 11.0.x.Table 1.2. Runtime commandsRuntime ject.buildexample.buildlist.infoDescriptionList all installed MCUs.Show the supported options in the MCUXpresso IDEtoolchains.Check examples options.Validates content of one or more SDKs.Check components dependencies from one or moreSDKs.Install (and replace) IDE part support from one or moreSDKs.Create/build projects from one or more SDK.Create/build examples from one or more SDKs or froman examples XML definition file.Display information about the current SDKs.General notes:We can test the SDKs in two main modes:1. Pointing to a folder that contains all the SDKs and run the tests on ALL the SDKs.2. Pointing to a folder that contains all the SDKs and run the tests on one SDK at the time.We can produce verbose output to know everything about the command being executed. Errors encountered during the running are signaled by the word “ERROR:” followed by theerror message. Warnings encountered during the running are signaled by the word “WARNING:” followed bythe warning message.1.5 Runtime command propertiesTo run the runtime command, you need to provide a file which contains a list of parametersrequired by the specific command. MCUXpresso IDE has a built-in list of the properties requiredMCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.3

NXP SemiconductorsMCUXpresso IDE Command Line User Guideby each command with their description. To obtain the list use the -help command parameteras show in the following example:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -help project.build-consoleLog -noExitThis will print the list of properties required to run the project.build runtime command in a consolewindow and will keep the window opened. You can print the properties required by a runtimecommand into a file, edit it for your purpose and pass them to run the command. In order togenerate the property file, use the below command:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application --noSplash -helpproject.build path to folder /build.propertiesIn order to pass this file to the run command please see the below example. This command willcreate a new project using the parameters from the file generated before. The project will becreated in a location specified by -data parameter and the log will be displayed in the openedconsole.mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application --noSplash -runproject.build path to folder /build.properties -data path to workspace folder -consoleLog-noExit1.6 Runtime commands exit valueEach runtime command exits with one of the following error codes: 0 – No errors. 1 – No application has been found (i.e. -run parameter is wrong – the runtime command orproperty file does not exist). 2 – A hard internal error has occurred. 3 – The command line -run option returned with errors (e.g., validation, project creation, projectbuild, etc.). 4 – The command line -run option returned with warnings (e.g., validation, etc.).When runtime command exits with a non-zero result, a pop-up window with Java error report isshown. To disable this report, include --launcher.suppressErrors parameter into the commandline.MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.4

NXP SemiconductorsMCUXpresso IDE Command Line User Guide -User GuideMCUXpresso IDE Command Line User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.5

NXP SemiconductorsMCUXpresso IDE Command Line User Guide2. Build examples from one or more SDKs or from anexamples XML definition file – example.buildIn order to create/build examples from one or more SDKs or from an example XML definition fileyou should use -run example.build path/to/property/file -data path/to/data/folder .2.1 Steps to run the command Generate the property file using the command:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -help example.build path to prop file /example build.properties Open the generated file and complete all the required parameters Parse the file to the final command and print the output in the console or a different file usingthe below commands:- print the output in console:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -run example.build path to prop file /example build.properties -data path to data folder -consoleLog -noExit- redirect the output to a specified file:mcuxpressoidec.exe -consoleLog -application com.nxp.mcuxpresso.headless.application -runexample.build path to prop file / example build.properties -data path to data folder path to output file / output file name .txtMCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.6

NXP SemiconductorsMCUXpresso IDE Command Line User Guide2.2 Property file parametersTable 2.1. Property file suse.io.consoleMCUXpresso IDE Command Line User Guide -User GuideDescriptionThis is the location where your SDK have beendownloaded. You can use either zip or foldercontaining the SDK but if you want to create linkedresources into your project you need to use a folderinstead of a zip.This is a report automatically generated with all thefinal results that the command returns.If true, all the examples from all the SDK will bechecked, otherwise you need to specify the SDKname.This is an optional parameter. If you use it all theexamples are retrieved from that specific file and shallvalid against the used SDK. If you comment thisparameter and chose not to use it, you must specifythe SDK name. The example.xml can be the one fromthe SDK itself or the user can import the SDK intothe MCUXpresso IDE and generate the example.xmlfile using the Generate example.xml file option fromTools.This represents the nature of your project (i.e. Cor C ). It can be: org.eclipse.cdt.core.cnature forC projects or org.eclipse.cdt.core.ccnature for C projects.If true, it will copy the files from the SDK, otherwise itwill link them.If true, the project will be compiled, otherwise theproject is only created.The configuration to be built, use ‘all’, ‘debug’ or‘release’.True, if you want to clear the workspace used, falseotherwise.If true, all the examples from all the SDK will becreated, otherwise you need to specify the SDK name.If true, skip the default SDK packages folder and allits content.The SDK id as for the manifest definition.The board id as for the manifest definition.If true, more info will be provided using stdout.If true, enable the CDT indexer, false otherwise.If true, show the CDT build log, false otherwise.If true, other files listed in the SDK components and/or example.xml will be imported.If true, IO Console console will be used, otherwiseUART Console will be used.All information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.7

NXP SemiconductorsMCUXpresso IDE Command Line User GuideTable 2.2. Property file parameters nIf true, internal flash driver will be used, otherwise theflash driver provided by the SDK.use.semihost.hardfault.handlerIf true, include HardFault handler to preventsemihosting operations blocking when no debuggerattached.If true, the SDK parts database is deleted on eachrestart.Currently, in an SDK there are different manifests. Thecommand line tool uses by default the manifest withthe highest version, matching the highest supportedformat. This behavior is the ‘head’ option. You canchoose the all option and the test is performedidentically to all the other manifest versions containedin an SDK or you can specify the exact version of .3 Command outputCommand output contains: Detailed report for each example that was build.Total number of errors or warnings found.The total number of successfully created examples.The total number of not created examples.The total number of successfully build examples.The total number of unsuccessfully build examples.Also, if any error or warning is reported, command returns with one of following error code: 3 – errors were detected. 4 – warnings were detected.MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.8

NXP SemiconductorsMCUXpresso IDE Command Line User Guide3. Create/build new projects – project.buildTo create and build SDK project, use -run project.build path to prop file -data path to data file .3.1 Steps to run the command Generate the property file using the command:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -help project.build path to folder /project build.properties Open the generated file and complete all the required parameters Parse the file to the final command and print the output in the console or a different file usingthe below commands:- print the output in console:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -run project.build path to prop file /example build.properties -data path to data folder -consoleLog -noExit- redirect the output to a specified file:mcuxpressoidec.exe -consoleLog -application com.nxp.mcuxpresso.headless.application -runproject.build path to prop file /project build.properties -data path to data folder path to output file / output file name .txtMCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.9

NXP SemiconductorsMCUXpresso IDE Command Line User Guide3.2 Property file parametersTable 3.1. Property file CUXpresso IDE Command Line User Guide -User GuideDescriptionThis is the location where your SDK have beendownloaded. You can use either zip or foldercontaining the SDK but if you want to create linkedresources into your project you need to use a folderinstead of a zip.This is a report automatically generated with all thefinal results that the command returns.This represents the nature of your project (i.e. Cor C ). It can be: org.eclipse.cdt.core.cnature forC projects or org.eclipse.cdt.core.ccnature for C projects.If true, it will copy the files from the SDK, otherwise itwill link them.If true, the CMSIS component is added. If false, theproject might not build (default is true).If true, the default board component is added (defaultis false).If true, the project will be compiled, otherwise theproject is only created.The configuration to be built, use ‘all’, ‘debug’ or‘release’.True, if you want to clear the workspace used, falseotherwise.If true, all the examples from all the SDK will becreated, otherwise you need to specify the SDK name.If true, skip the default SDK packages folder and allits content.The SDK id as for the manifest definition.The board id as for the manifest definition.The device id as for the manifest definition, if notspecified, all devices contained in the SDK are usedone by one.The package id as for the manifest definition, if notspecified, the first available package is used.If true, more info will be provided using stdout.If true, enable the CDT indexer, false otherwise.If true, show the CDT build log, false otherwise.If true, all NPW user visible components will be addedin the project(default is false).If true, middleware components will be used wheneither “use.all.components” or “use.components” isset to true(default is true).If true, multiple projects will be created for each uservisible component: this means that all the componentswill be added one by one and a project will be createdfor each of them.(default is false).All information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.10

NXP SemiconductorsMCUXpresso IDE Command Line User GuideTable 3.2. Property file parameters cont’dParameteruse.other.filesDescriptionIf true, other files listed in the SDK components and/or example.xml will be imported.use.io.consoleIf true, IO Console console will be used, otherwiseUART Console will be used.If true, internal flash driver will be used, otherwise theflash driver provided by the SDK.If true, include HardFault handler to preventsemihosting operations blocking when no debuggerattached.If true, the SDK parts database is deleted on nsCurrently, in an SDK there are different manifests. Thecommand line tool uses by default the manifest withthe highest version, matching the highest supportedformat. This behavior is the ‘head’ option. You canchoose the all option and the test is performedidentically to all the other manifest versions containedin an SDK or you can specify the exact version of themanifest.Usage notes:1. Projects are automatically created in the path specified by the -data parameter from thecommand line.2. Project creation will fail if project of a same name is already present in the workspace.To automatically remove from workspace any project of the same name you can useclean.workspace true property in command properties file. If you are removing projects fromworkspace manually, it’s required to remove project also from workspace Eclipse metadata.3. Project name is automatically created as Project device package on board board .4. For each project, multiple build configurations can be compiled and build. To control testedconfigurations, you can use build.config property from the generated properties file.3.3 Command outputCommand output contains: Detailed report for each project that was build.Total number of errors or warnings found.The total number of successfully created projects.The total number of not created projects.The total number of successfully build projects.The total number of unsuccessfully build projects.Also, if any error or warning is reported, command returns with one of following error code: 3 – errors were detected. 4 – warnings were detected.MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.11

NXP SemiconductorsMCUXpresso IDE Command Line User Guide4. SDK check dependencies – check.dependenciesIn order to check components dependencies from one or more SDKs use -runcheck.dependencies path to property file . This command checks that the components haveall the files needed in order to be built properly.4.1 Steps to run the command Generate the property file using the command:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -helpcheck.dependencies path to folder /check dependencies.properties Open the generated file and complete all the required parameters Parse the file to the final command and print the output in the console or a different file usingthe below commands:- print the output in console:mcuxpressoide.exe -application com.nxp.mcuxpresso.headless.application -run check.dependencies path to prop file /check dependencies.properties -consoleLog -noExit- redirect the output to a specified file:mcuxpressoidec.exe -consoleLog -application com.nxp.mcuxpresso.headless.application -runcheck.dependencies path to prop file / check dependencies.properties path to output file / output file name .txtMCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.12

NXP SemiconductorsMCUXpresso IDE Command Line User Guide4.2 Property file parametersTable 4.1. Property file parametersParametersdk.locationDescriptionThis is the location where your SDK have beendownloaded. You can use either zip or foldercontaining the SDK but if you want to create linkedresources into your project you need to use a folderinstead of a zip.This is a report automatically generated with all thefinal results that the command returns.report.fileclean.workspaceTrue, if you want to clear the workspace used, falseotherwise.If true, skip the default SDK packages folder and allits content.The SDK id as for the manifest definition.If true, shows potential error of include directivesdisabled by compilation flags (warning message).If true, more info will be provided using stdout.If true, the SDK parts database is deleted on eachrestart.Currently, in an SDK there are different manifests. Thecommand line tool uses by default the manifest withthe highest version, matching the highest supportedformat. This behavior is the ‘head’ option. You canchoose the all option and the test is performedidentically to all the other manifest versions containedin an SDK or you can specify the exact version of 3 Command outputCommand output contains: Total number of errors or warnings found during the validation for each SDK. Total number of errors or warnings found during the validation for all the SDK’s.If any error or warning is reported, command returns with one of following error code: 3 – errors were detected. 4 – warnings were detected.MCUXpresso IDE Command Line User Guide -User GuideAll information provided in this document is subject to legal disclaimersRev. 11.6.0 — 13 July, 2022 2022 NXP Semiconductors. All rights reserved.13

NXP SemiconductorsMCUXpresso IDE Command Line User Guide5. SDK examples options validation – example.optionsIn order to validate SDK examples, use -run example.options path to property file .Command runs validation of SDK examples options stored in example definition XML file.This command verifies:1. That the option is supported in MCUXpresso IDE.2. Option type is specified correctly.3. Values of enumeration options are correct.4. Warning if option is setting default value (intended to remove unnecessary options).5. Warning if internal option is used (intended to prevent using internal options).6. Error if option usage requires some additional related option which is missing (used mainlyto test usage of librarie

Basic command line support is integral part of Eclipse CDT applications derived from the CDT. Documentation of the command line support in CDT can be found here. Only basic operations like import and build of existing project from command line (also known as "headless build") are supported. Examples how to use headless builds can be found here: