Trouble getting MCUXpresso for VS Code to work with existing project

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

Trouble getting MCUXpresso for VS Code to work with existing project

389件の閲覧回数
pcpro1789
Contributor II

I'm trying to get MCUXpresso for VS Code to work with an existing project that is currently working with the MCUXpresso IDE.  I have already installed the MCUXpresso for VS Code extension and imported the project, but when I try to build the project I get immediate CMake errors:

* Executing task: CMake: configure

Config task started...
Configure failed.

* The terminal process failed to launch (exit code: -1).
* Terminal will be reused by tasks, press any key to close it.

* Executing task: CMake: build

build failed.

When it imported the project, it created a new directory along side the exiting project directory.  Can it not just use the existing project directory?  Having duplicate source files to maintain is a nonstarter.

The existing MCUXpresso project is organized as a subdirectory within a Git repository.  Please let me know if any additional information is needed.

0 件の賞賛
返信
8 返答(返信)

203件の閲覧回数
GeorgianaBoglis
NXP Employee
NXP Employee

Hello, pcpro1789

For installing west, use the MCUXpresso installer. For more details:

https://mcuoneclipse.com/2023/08/11/vs-code-mcuxpresso-installer/

For installing you SDK archive, go to MCUXpresso for Vs Code 'QuickStart', select 'Import Repository' and in that view select 'LOCAL ARCHIVE'. Select you SDK .zip file and specify the location you want to install your repository. Finally press 'Import'.

 If you are still unable to build your project, please open a terminal in the directory containing 'CMakePresets.json' file and type: 'cmake –preset <name_of_your_build_config>'. Example: 'cmake –preset Debug'.

If you are unsure what the build configuration name, then from the 'Projects' view expand 'Build Configuration' and see the name of your default build configuration. I expect to see more details on why the build is failing, but if the command finished successfully also type in ‘cmake --build –preset <name_of_your_build_config>. If you see any errors, please let me know. 

Regards,

Georgiana Boglis

0 件の賞賛
返信

337件の閲覧回数
GeorgianaBoglis
NXP Employee
NXP Employee

Hello pcpro1789,

It looks like you are trying to convert in place a MCUXpresso IDE project to VS code.

Maybe something went wrong with this step.

Best way to do this is by going to VS code, press ctrl-shift-p and type "Import Multiple Projects", then press Enter. You should see a prompt asking to select the type of project with just one selection: "MCUXpresso IDE", press enter again. Now type in the location of your project, example : "C:/NXP/myProject", enter then type in the destination, that will be the path to you project, example: "C:/NXP". The project should now be imported to VS code.

If you haven't already, can you try importing this way?

Did you see any errors while importing?

If you are still unable to build, do you have another project with the same name in the vs code workspace?  CMake extension may fail to build in this case.

If you attempt to build more than once, do you get more information on why the build fails or do you still see the same output?

Regards,

Georgiana

0 件の賞賛
返信

289件の閲覧回数
pcpro1789
Contributor II

@GeorgianaBoglis Thanks, but I'm still getting the same error when I attempt to build.  Prior to building, but after completing the steps you suggested, these are the errors I got in the notification area.

pcpro1789_0-1729110548002.png

 

Clicking the Show Log button in the "Project(s) converted" notification only closed the notification; no log was shown.

Unfortunately, attempting to build a second time yielded the same results.

Which extensions are required or used by MCUXpresso for VS Code?  This is what I have installed:

  • C/C++ by Microsoft *
  • C/C++ Extension Pack by Microsoft
  • C/C++ Themes by Microsoft
  • Clang-Format by Xaver Hellauer
  • CMake by twxs *
  • CMake Tools by Microsoft *
  • Code Spell Checker by Street Side Software
  • Cortex-Debug by marus25
  • debug-tracker-vscode by mcu-debug
  • Doxygen Documentation Generator by Christoph Schlosser
  • File Downloader by MIcrosoft DevLabs *
  • Flake8 by Microsoft
  • Git History by Don Jayamanne
  • GitHub Actions by GitHub
  • isort by Microsoft
  • Jupyter by Microsoft
  • Jupyter Cell Tags by Microsoft
  • Jupyter Keymap by Microsoft
  • Jupyter Notebook Renderers by Microsoft
  • Jupyter Slide Show by Microsoft
  • Makefile Tools by Microsoft
  • MCUXpresso for VS Code by NXP Semiconductors *
  • MemoryView by mcu-debug
  • Partial Diff by Ryuichi Inagaki
  • Peripheral Viewer by mcu-debug
  • Pylance by Microsoft
  • Python by Microsoft
  • Python Debugger by Microsoft
  • Rainbow CSV by mechatroner
  • RTOS Views by mcu-debug
  • Serial Monitor by Microsoft *

I tried disabling all extensions, and then re-enabled only MCUXpresso for VS Code, which seems to also have re-enabled the extensions above marked with an asterisk (*).  Attempting to build at this point yields the following terminal output:

pcpro1789_1-1729111567530.png

The notification for, "Error: 'west' could could not be found," remains.

0 件の賞賛
返信

287件の閲覧回数
pcpro1789
Contributor II

@GeorgianaBoglis I discovered some artifacts in the MCUXpresso project files that were referencing an old project directory.  I fixed the artifacts, and now import of the MCU project seems to get farther along.  At least it shows me the error log now:

[2024-10-16T16:55:37.292] [proc] [info] Cmd: where python
[2024-10-16T16:55:37.312] [proc] [info] Cmd: C":\Program Files\SEGGER\JLink\JLinkGDBServerCL.exe" -listprobes USB
[2024-10-16T16:55:37.432] [proc] [info] Cmd: C:\Users\jimjf\AppData\Local\Microsoft\WindowsApps\python.exe --version
[2024-10-16T16:55:37.513] [proc] [info] Cmd: C:\Users\jimjf\AppData\Local\Microsoft\WindowsApps\python.exe -m west --version
[2024-10-16T16:55:37.597] [error] Could not read settings from mcuxpresso-tools.json for project "c:\Users\jimjf\repos\morpheus_firmware\imxrt685"
[2024-10-16T16:55:37.853] [proc] [error] C:\Users\jimjf\AppData\Local\Microsoft\WindowsApps\python.exe exited with code 1
[2024-10-16T16:55:37.853] [proc] [error]
C:\Users\jimjf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe: No module named west
[2024-10-16T16:55:37.857] [proc] [info] Cmd: where west.exe
[2024-10-16T16:55:37.893] [proc] [error] where exited with code 1
[2024-10-16T16:55:37.893] [proc] [error]
INFO: Could not find files for the given pattern(s).
[2024-10-16T16:55:37.894] [error] 'west' tool could not be found.
[2024-10-16T16:56:23.403] [proc] [info] Cmd: C:\NXP\MCUXpressoIDE_11.7.1_9221\ide\tools\bin\arm-none-eabi-gcc.exe --version
[2024-10-16T16:56:24.715] [converter] [info] Project converter: imxrt685: The 'Debug' build configuration will be excluded from conversion since the linker script file could not be found into the 'Debug' directory.
[2024-10-16T16:56:24.715] [error] Error: There are no valid build configurations for this MCUXpresso IDE project:  The 'Debug' build configuration will be excluded from conversion since the linker script file could not be found into the 'Debug' directory.
I'm still not sure what the "west" tool is supposed to be.
0 件の賞賛
返信

261件の閲覧回数
Joey_z
NXP Employee
NXP Employee

hi,pcpro1789

Can you check if west is installed at all (using the 'where' command on Windows):

C:\Users\erich>where west
C:\Users\erich\AppData\Local\Programs\Python\Python39\Scripts\west.exe
C:\Users\erich\AppData\Local\Microsoft\WindowsApps\west.exe

In addition, check if you successfully downloaded the SDK for the project.

I hope it can help you.

BR

Xu Zhang

0 件の賞賛
返信

248件の閲覧回数
pcpro1789
Contributor II

@Joey_z The west tool does not appear to be installed on my system.

pcpro1789_0-1729171743456.png

How do I install west?

I have the SDK (SDK_2_13_0_MIMXRT685S.zip).  It's installed in the MCUXpresso IDE.  How do I install it in MCUXpresso for VS Code?

0 件の賞賛
返信

186件の閲覧回数
cristiantepus
NXP Employee
NXP Employee

Hi,

For installing a zip archive SDK: https://github.com/nxp-mcuxpresso/vscode-for-mcux/wiki/Working-with-MCUXpresso-SDK#import-standalone...

For installing west: install "MCUXpresso SDK Developer" component from MCUXpresso Installer

For downloading MCUXpresso Installer and reading more info about installing dependencies: https://github.com/nxp-mcuxpresso/vscode-for-mcux/wiki/Dependency-Installation

Note: Be aware that MCUXpresso Installer will provide you a west tool installation under a python virtual environment, it will not be added for the entire host OS (so it will not be installed for system python). This python virtual environment is created on ~/<your_user>/.mcuxpressotools/.venv

This "west" version will be used for further VS Code extension operations.

One direct effect of it: after creating a project in our extension, right click on a project -> Open in Integrated Terminal: this will automatically activate the venv so you'll be able to use west in command line:

cristiantepus_0-1729240302815.png

Still, this is the default virtual environment we provide, if you have your own, read https://github.com/nxp-mcuxpresso/vscode-for-mcux/wiki/Settings#virtual-environment-setting 

Regards,

Cristian

0 件の賞賛
返信

221件の閲覧回数
Joey_z
NXP Employee
NXP Employee

Hi,pcpro1789

Please refer to the following link Getting Started with MCUXpresso for Visual Studio Code, which covers west tool installation and SDK import methods, and Debug methods.

Getting Started with MCUXpresso for Visual Studio Code | NXP Semiconductors

Hope it can help you.

BR

Xu Zhang

0 件の賞賛
返信