Collaborative Work On Projects - nxp-mcuxpresso/vscode-for-mcux GitHub Wiki

One typical scenario on collaborative work on projects is to share them across multiple machines with various operating systems using git for versioning and storage.

Source Control Management (SCM) / Git

VS Code natively integrates source control management using Git.

When working with projects managed by MCUXpresso extension, a set of files and data are used and generated by the extension for source and tools management.

Some of these files contain machine and user independent data and these should be stored in a SCM:

  • .vscode
    • launch.json
    • mcuxpresso-tools.json
    • settings.json
    • tasks.json
    • CMakePresets.json

Exception on the "machine and user independent data" on this set of files is given by the paths to the toolchain (mcuxpresso-tools.json - toolchainPath) and SDK (mcuxpresso-tools.json - sdk - path) used by the project. These should be adjusted for a new destination machine in case the project is moved (details in the next section).

Also, some files are dynamically generated and should not be stored in a SCM. This is the case of:

  • mcux_include.json

This file can be added in the gitignore file to be intentionally ignored by the SCM tracking.

Moving the project to another machine

Two main methods are recommended to move a project between different machines:

  • Using a SCM software - Git is the typical one, natively integrated within VS Code
  • Using Project Options -> Export MCUXpresso Project Archive then, on the target machine: PROJECTS View -> Import Project -> Archive

Regardless the used method, once a project is on a new machine, two main settings should be updated:

  • the toolchain used to build the application. This can be achieved by selecting an existing one using Project Options -> Configure -> Associate Toolchain (for MCUXpresso SDK) or Project Options -> Configure -> Associate Zephyr SDK (for Zephyr project)
  • the source repository (if it is the case) integrated with the project. This can be done using Project Options -> Configure -> Associate Repository (for both MCUXpresso SDK and Zephyr projects).

Machine independent project

The above two elements (toolchain and repository paths) are typically absolute paths as they are not found inside the application project but somewhere else on disk. Still, to be able to have a "common" version on git that will not appear as modified each time the user is changing the paths, it is recommended to use variables (VS Code or environment ones). See this section for details on the variables capabilities and alternatives.

One possible example for a MCUXpresso SDK based project:

  • using the toolchain provided by MCUXpresso Installer which is located on user home path, the path in mcuxpresso-tools.json can be written as:
"toolchainPath": "${userHome}/.mcuxpressotools/arm-gnu-toolchain-13.2.Rel1-mingw-w64-i686-arm-none-eabi"
  • using an SDK source repository located in a random location on disk, can be placed under an environment variable defined on each's user machine with the proper value:
"sdk": {
    [...]
    "path": "$env{NXP_SRC_REPO}"

home