Command Line Execution

This section describes the Command Line Interface (CLI) commands supported by the S32 Configuration Tools application inside S32 Design Studio.

S32 Configuration Tools can be executed on command line with these parameters:

s32ds.exe -noSplash -application com.nxp.swtools.framework.application [tools commands]

To have the build output written to stdout/stderr and therefore see the progress in the console while the command is executed, use -consoleLog and -noExit options like:

s32ds.exe -noSplash \
     -consoleLog -noExit \  
     -application com.nxp.swtools.framework.application [tools commands]

OR

the recommended way, use eclipse console executable directly like:

eclipsec.exe -noSplash \
        --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini 
        -application com.nxp.swtools.framework.application [tools commands]

On Linux host, replace s32ds.exe or eclipsec.exe from above commands with s32ds:

s32ds -noSplash -application com.nxp.swtools.framework.application [tools commands]

Notes regarding command line execution:
  • [tools commands] are all options that follow -HeadlessTool and are described in the next tables.
  • Command -HeadlessTool is used as a separator of each command chain.
  • Each command chain works independently.
  • Every chain starts with -HeadlessTool command and continues to the next -HeadlessTool command, or end. (only exception are commands from framework which doesn´t need the -HeadlessTool command).
  • Commands which don´t need the -HeadlessTool command, can be placed before the first -HeadlessTool if chained, or without -HeadlessTool when not chained.
  • Commands from each tool are executed in given order.

  • Commands from framework are not executed in given order.

  • The following commands are not executed in given order:

    • ImportProject
    • Export MEX
    • ExportAll
  • The application can exit with following codes when unexpected behavior occurs:
    • When parameter is missing: 1
    • When tool error occurs: 2

[tools commands] example:

-HeadlessTool Clocks -MCU S32S247TV -SDKVersion s32sdk_s32s_rtm_100 -ExportSrc C:/exports/src -HeadlessTool Pins -MCU S32S247TV -SDKVersion s32sdk_s32s_rtm_100 -ExportSrc C:/exports/src -HeadlessTool Peripherals -MCU S32S247TV -SDKVersion s32sdk_s32s_rtm_100 -ExportSrc C:/exports/src

The complete command in S32 Design Studio would be:

eclipsec.exe -noSplash \

        --launcher.ini C:\NXP\S32DS\eclipse\s32ds.ini \
        -application com.nxp.swtools.framework.application \
        -HeadlessTool Clocks -MCU S32S247TV -SDKVersion s32sdk_s32s_rtm_100 -ExportSrc C:/exports/src \
        -HeadlessTool Pins -MCU S32S247TV -SDKVersion s32sdk_s32s_rtm_100 -ExportSrc C:/exports/src \ 
        -HeadlessTool Peripherals -MCU S32S247TV -SDKVersion s32sdk_s32s_rtm_100 -ExportSrc C:/exports/src  

This will create a configuration for S32S247TV processor and s32sdk_s32s_rtm_100 SDK version, will generated code for each specified tool, and the files will be saved at the provided location.

Processor and SDK names can be easily found by going to /path/to/S32DS/installation/eclipse/mcu_data location:
  • For processor name, find inside processors folder all available processor names
  • For SDK version, find inside /path/to/S32DS/installation/eclipse/mcu_data/processors/<processor_name> all available versions for that specific processor name
If the given names do not exist in the current installation, the tool will generate no files as data associated with them is not found.

The following options are supported in the framework:

Table 1. Commands supported in the framework
​​Command name Definition and parameters Description Restriction ​​Example
​Force language ​​-nl {lang}

​Force set language

{lang} is in ISO-639-1​ standard

​Removal of the '.nxp' folder from home directory is recommended, as some text might be cached

Only 'zh' and 'en' are supported
-nl zh
​​Show console ​​-consoleLog ​Log output is also sent to Java’s System.out (typically back to the command shell if any) None
​​Select MCU ​​-MCU ​MCU to be selected by framewor​k ​Requires –SDKversion command -MCU MK64FX512xxx12S32S247TV
​Select SDK version ​-SDKversion ​Version of the MCU to be selected by framework ​Requires ​​-MCU command ​-SDKversion test_ksdk2_0amp_sdk1_0
​Select part number ​-​PartNum ​​Select specific package of the MCU ​Requires -MCU and -SDKversion commands ​-PartNum MK64FX512VLL12S32S247TV
​​​Configuration name ​​​-ConfigName ​Name of newly created configuration - used in export ​​Name is used when new configuration is created by -MCU and -SDKversion commands ​​-ConfigName "MyConfig"
​​Select tool ​-HeadlessTool ​Select a tool that should be run in headless mode ​None ​-HeadlessTool
​Load configuration ​-Load ​​Load existing configuration from (*.mex) file ​None ​​-Load C:/conf/conf.mex
​​Export Mex​ ​-ExportMEX​ ​Export .mex configuration file after tools run

Argument is expected as a folder name​

​None ​​-MCU xxx -SDKversion xxx​ ​​-ExportMEX C:/exports/my_config_folder
​​Export all generated files ​-ExportAll ​​Export generated files (with source code and so on. Code is regenerated before export

Includes -ExportSrc and in framework -ExportMEX​

Argument is expected as a folder name​

​​Requires -HeadlessTool command ​​-HeadlessTool Pins ​-ExportAll C:/exports/generated​
Import ECU Configuration files -ImportEcuConf

Import ECU Configuration file(s) (*.arxml, *.*) into configuration.

Importing is done after loading mex or creating a new configuration and before generating outputs.

Requires -HeadlessTool Peripherals -ImportEcuConf c:\test\myproject\ecuConfFile.arxml -HeadlessTool Peripherals
Disable the version checking -DisableEcuVersionCheck Constant used to skip the ECUC module version checking when it is imported. Requires -ImportEcuConf -ImportEcuConf c:\test\myproject\ecuConfFile.arxml -DisableEcuVersionCheck
Export given arguments via scriptApi -ExportArgs {list with arguments} Export given arguments to javascript via scriptApi. The exported arguments can be retrieved in javascript by calling: scriptApi.getUtils().getExportedArgs()

Internal usage.

Requires -HeadlessTool command -HeadlessTool Peripherals -ExportArgs epc epd
Export given component ids via scriptApi -ExportComponentIds {list with component ids} Export given component ids to javascript via scriptApi. The exported component ids can be retrieved in javascript by calling: scriptApi.getUtils().getExportedComponentIds() This should be used in combination with -ExportArgs flag to export certain files for the given list of component ids.

Internal usage.

Requires -HeadlessTool command -HeadlessTool Peripheral -ExportArgs epc epd -ExportComponentIds eth_43_gmac adc_16

Examples:

  • Create a new configuration, import an ECU Configuration file and export all files for Peripherals Tool:
    eclipsec.exe -noSplash \
            -application com.nxp.swtools.framework.application \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            -MCU /processor/name \
            -SDKVersion /sdk/version/name \
            -ImportEcuConf /path/to/ECU/Configuration \
            -HeadlessTool Peripherals \
            -ExportAll /path/where/to/save/files
  • Import configuration from existing .mex file, choose to disable the ECU version checking when it is imported, and export all the files for Peripherals Tool:
    eclipsec.exe -noSplash \
            -application com.nxp.swtools.framework.application \
            --launcher.ini /path/to/S32DS/installation/eclipse/s32ds.ini \
            -Load /path/to/mex/file
            -ImportEcuConf /path/to/ECU/Configuration \
            -DisableEcuVersionCheck \
            -HeadlessTool Peripherals \
            -ExportAll /path/where/to/save/files