Import a Zephyr project

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Import a Zephyr project

ソリューションへジャンプ
1,459件の閲覧回数
nskartoredjo
Contributor II

I've created a Zephyr project similar in structure as in the example provided by Zephyr. I've been able to successfully import it on one of my machines using the MCUXpresso extension, however I wasn't able to do the same on another machine. If I attempt to import the project, it will provide me with the error message: Error: Selected file or folder is not a valid MCUXpresso project

My question is, how can I import the project on the other machine? Consequentially, I would like to know what the extension searches for to determine whether a project is a Zephyr project or not.

Below is an example of how I expect it to work:

image.png

And below her is how I don't expect it to work:

nskartoredjo_0-1698249086013.png

 

0 件の賞賛
返信
1 解決策
1,423件の閲覧回数
nskartoredjo
Contributor II

If you want your project to be recognised as a Zephyr project, you need at least the following files inside the .vscode directory:

  • cmake-kits.json
  • cmake-variants.json
  • mcuxpresso-tools.json
  • launch.json

For some operations, the extension expects one of these files to exists, and tries to change them according to the changes you make through the extension. If the file doesn't exist, it will complain. To generate those files, you can use the Import Example from Repository feature, and use the workspace application type. From the newly generated project, copy the .vscode directory to your own project.

The downside is that some fields inside these config files are personalised per machine. For example, the toolchainPath will be equal to something like X:/Users/your-name/zephyr-sdk-0.XX.X/arm-zephyr-eabiLuckily, these fields only need to exist to a certain extend. If you use the import project feature, the extension will automatically append these fields with proper values; just state them with empty ones:

Inside cmake-kits.json

  • "ZEPHYR_BASE": ""
  • "ZEPHYR_SDK_INSTALL_DIR": ""

Inside mcuxpresso-tools.json

  • "toolchainPath": ""
  • "toolchainVersion": ""
  • "sdk.path": ""

I've added an blank .vscode directory setup in the attachments. Note that the settings.json file states that the cmake source directory can be found at ${workspaceFolder}/app; feel free to change it if this is not the case for your project.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,451件の閲覧回数
nskartoredjo
Contributor II

To reply on myself, it turns out that you need the mcuxpresso-tools.json file inside the .vscode directory; I'll keep this post up to date to see what all is required inside it to make it work

0 件の賞賛
返信
1,424件の閲覧回数
nskartoredjo
Contributor II

If you want your project to be recognised as a Zephyr project, you need at least the following files inside the .vscode directory:

  • cmake-kits.json
  • cmake-variants.json
  • mcuxpresso-tools.json
  • launch.json

For some operations, the extension expects one of these files to exists, and tries to change them according to the changes you make through the extension. If the file doesn't exist, it will complain. To generate those files, you can use the Import Example from Repository feature, and use the workspace application type. From the newly generated project, copy the .vscode directory to your own project.

The downside is that some fields inside these config files are personalised per machine. For example, the toolchainPath will be equal to something like X:/Users/your-name/zephyr-sdk-0.XX.X/arm-zephyr-eabiLuckily, these fields only need to exist to a certain extend. If you use the import project feature, the extension will automatically append these fields with proper values; just state them with empty ones:

Inside cmake-kits.json

  • "ZEPHYR_BASE": ""
  • "ZEPHYR_SDK_INSTALL_DIR": ""

Inside mcuxpresso-tools.json

  • "toolchainPath": ""
  • "toolchainVersion": ""
  • "sdk.path": ""

I've added an blank .vscode directory setup in the attachments. Note that the settings.json file states that the cmake source directory can be found at ${workspaceFolder}/app; feel free to change it if this is not the case for your project.

0 件の賞賛
返信