AM263Px MCU+ SDK  10.01.00
Migrating examples from package to package in AM263PX

Installing dependencies

  • Install SysConfig version 1.16.0 or above from here
  • Verify that node is installed in your system. You can check this by entering this command in your terminal/command prompt.
    $ node --version
  • If not present, download it from here. Download v14.0.0 or above.
  • Once node is installed, download yargs package using:
    $ npm install yargs

Setup

  • The migration script titled migrate.js is situated inside the "{your_sdk_path}/tools/migration_script" folder.
  • The script can take in total 8 arguments, apart from node and migrate.js:
    1. Absolute path to product.json: {sdk_path}/.metadata/product.json (--product)
    2. Device from which you are migrating: the existing sysconfig files are present for this device. (--sourceDevice)
    3. Device to which you are migrating (--destinationDevice)
    4. Package from which you are migrating (--sourcePackage)
    5. Package to which you are migrating (--destinationPackage)
    6. Part from which you are migrating (--sourcePart)
    7. Part to which you are migrating (--destinationPart)
    8. Absolute path to the examples you want to migrate (--migratePath)
  • The package and part arguments can be skipped if not required.
Note
The script is not validated for part migration yet.

Migrating examples to SIP (ZCZ_F) package

To run the script, open terminal/command prompt inside the SDK folder that has the migrate.js script.

In this case, navigate to migration_script folder using:

$ cd tools/migration_script

For example, let's say you want to switch all the AM263PX examples in the whole of SDK from package ZCZ_S to ZCZ_F. Then, enter this command in your terminal:

$ node migrate.js --product {your_sdk_path}/.metadata/product.json --sourceDevice AM263PX --destinationDevice AM263PX --sourcePackage ZCZ_S --destinationPackage ZCZ_F --migratePath {your_sdk_path}

The arguments sourceDevice and destinationDevice are same in this case, both AM263PX.

When you run this command, the migrate.js script recursively traverses through the whole SDK path, searches for all the examples that are currently in sourcePackage, and then migrates those examples to destinationPackage.

You can also use the script to switch individual examples. Let's say you want to switch only the 'mcasp' examples, than replace the last argument with:

"{your_sdk_path}/examples/drivers/mcasp"

It does in-place modification of example.syscfg, makefile, and example.projectspec files of the examples.

The list of files successfully migrated and files that failed to migrate can be observed from the log_file.txt generated inside the tools/migration_script folder of the SDK.

To understand the list of arguments, their aliases and description enter this command:

$ node migrate.js --help

Excluding examples from migration

To skip certain examples from being migrated, add the SDK relative path to those folders in the file exclude_list_am263px.js inside migration_script/soc folder.