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.
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
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
@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.
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:
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:
The notification for, "Error: 'west' could could not be found," remains.
@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.
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
@Joey_z The west tool does not appear to be installed on my system.
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?
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:
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
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