Auto-generated JSON scripts for VSCode contain patterns PowerShell can't resolve

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaVa_2285651
Level 3
Level 3
10 questions asked First solution authored 10 sign-ins

Description of Issue

I created an Empty PSoC4 Project using the generic PSoC4 project template in ModusToolbox Project Creator (running standalone) and generated the project for Visual Studio Code.  When I open the workspace file in VSCode and try to run one of the launch configurations from the Run and Debug window, PowerShell can't resolve some of the paths in the auto-generated JSON scripts.  The scripts have a bunch of paths that look like this:

C:/Users/<me>/ModusToolbox/tools_2.3/&&CY_MODUS_SHELL_BASE&&/bin/bash.exe

Which generates an error like this:

C:/Users/<me>/ModusToolbox/tools_2.3/: The term 'C:/Users/<me>/ModusToolbox/tools_2.3/' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The `&&` pairs are understandably confusing PowerShell as it is trying to evaluate them as logical AND.  The paths are correct except for the instances of `&&[name]&&`; I'm assuming those instances should have been replaced with valid paths at some point during the generation of the JSON, but I'm not sure why they weren't or how to get the scripts to generate properly.  Any suggestions?

 

Environment

  • Windows 10 Pro x64
  • ModusToolbox 2.3.1
    • Project Creator 1.30.0
  • Visual Studio Code 1.56.2
    • Cortex-Debug extension, 0.3.12
    • C/C++ 1.3.1
  • PowerShell 7.1.3

 

Steps to Reproduce

  1. Open Project Creator from the Windows Start menu
  2. Select PSOC4-GENERIC under PSoC 4 BSPs on the left side
  3. Click Next
  4. Check the box next to "Empty PSoC4 App"
  5. Set the Application Root Path to C:/Users/<username>/mtw
  6. Select "Microsoft Visual Studio Code" from the Target IDE drop down menu
  7. Click Create
  8. In VSCode, open the workspace file generated in step 7
  9. From the Run and Debug window, click the green Play button to try to run "Launch PSoC4 CM0"
  10. Error appears.
0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @DaVa_2285651

Thank you for pointing this out! There already exists an internal ticket on this issue and our team is working on it. This should be fixed in future releases. 

As a workaround can you please try replacing all the &&CY_MODUS_SHELL_BASE&& with modus-shellin tasks.json file and let me know if that works?  

Thanks and Regards,
Rakshith M B

View solution in original post

2 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @DaVa_2285651

Thank you for pointing this out! There already exists an internal ticket on this issue and our team is working on it. This should be fixed in future releases. 

As a workaround can you please try replacing all the &&CY_MODUS_SHELL_BASE&& with modus-shellin tasks.json file and let me know if that works?  

Thanks and Regards,
Rakshith M B

Hi @Rakshith ,

Replacing the instances of &&CY_MODUS_SHELL_BASE&& with modus-shell in the project's tasks.json file resolved the issue and I can build the project.  I can use that workaround until a fix is released.

Thank you for your reply!