Developer World Spresense
日本語 中文
Table of Contents

1. Introduction

This chapter explains the installation and setup procedures for developing Spresense SDK applications on Visual Studio Code (hereafter called as VS Code) provided by Microsoft.

Spresense VSCode IDE is an extension of VS Code specializing in Spresense SDK application development. This extension adds the following functions to support development with a unified interface from project creation to ICE debugging.

vscode overview en
  • Automatic creation of settings for building and debugging applications

  • Create application templates, including multi-core applications

  • Configuring builds with the GUI

  • Serial terminal to check Spresense operation

Using the above functions, here is an example of adding a simple sample application myapps to a project called myproject, and explains how to run the application by Spresense.

vscode sample overview en

2. Setup the Spresense VSCode IDE

Install the Spresense SDK application development environment using the following procedure. As a result, a series of development environment from project creation to debugging is prepared on VS Code.

If you already have a GUI development environment that is setup by default to Spresense SDK Getting Started Guide (CLI), you do not need to execute the Development environment section steps.

2.1. Development environment

You can develop Spresense SDK on Linux/Windows/macOS. Please setup development environment for your appropriate OS.

Supported Operation System

  • Linux (64bit)

    • Ubuntu 16.04 or later

  • Windows (64bit)

    • 8.1/10

  • macOS

    • High Sierra (10.13) or later

Does not support 32bit version OS

2.1.1. Setup for Linux

  1. Serial Configuration

    Add user to dialout group

    sudo usermod -a -G dialout <user-name>
    

    Please logout and login after running the above command.

  2. Install development tools

    wget https://raw.githubusercontent.com/sonydevworld/spresense/master/install-tools.sh
    bash install-tools.sh
    

    If you run wget command and install-tools.sh via proxy server, set your proxy server as below.

    export http_proxy=http://<your proxy server>:<port number>
    export https_proxy=http://<your proxy server>:<port number>
    

    And run this command to activate installed tools.

    source ~/spresenseenv/setup
    

    This command must run in every terminal window. If you want to skip this step, please add this command in your ${HOME}/.bashrc.

    The tool chain is installed in spresenseenv/usr/bin under the home directory.
  3. Clone the Spresense SDK with submodule

    git clone --recursive https://github.com/sonydevworld/spresense.git
    

2.1.2. Setup for Windows

  1. Install MSYS2

  2. Install development tools

    Run MSYS2 MSYS from start menu, and run following commands.

    MSYS2 MinGW 64-bit and MSYS2 MinGW 32-bit is not supported. Please use MSYS2 MSYS.
    curl -L https://raw.githubusercontent.com/sonydevworld/spresense/master/install-tools.sh > install-tools.sh
    bash install-tools.sh
    

    If you run curl command and install-tools.sh via proxy server, set your proxy server as below.

    export http_proxy=http://<your proxy server>:<port number>
    export https_proxy=http://<your proxy server>:<port number>
    

    And run this command to activate installed tools.

    source ~/spresenseenv/setup
    

    This command must run in every terminal window. If you want to skip this step, please add this command in your ${HOME}/.bashrc.

    The tool chain is installed in /opt/spresenseenv/usr/bin.
  3. Clone the Spresense SDK with submodule

    git clone --recursive https://github.com/sonydevworld/spresense.git
    
  4. Install USB serial driver

    User must install before connecting Spresense board to the PC.

    Please download and install from below.

2.1.3. Setup for macOS

  1. Install development tools provided by Apple

    Open the Teminal and run following command.

    xcode-select --install
    
  2. Install Python3

  3. Install wget (Necessary to build some of NuttX application tools)

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    brew install wget
    
  4. Install development tools

    curl -L https://raw.githubusercontent.com/sonydevworld/spresense/master/install-tools.sh > install-tools.sh
    bash install-tools.sh
    

    If you run curl command and install-tools.sh via proxy server, set your proxy server as below.

    export http_proxy=http://<your proxy server>:<port number>
    export https_proxy=http://<your proxy server>:<port number>
    

    And run this command to activate installed tools.

    source ~/spresenseenv/setup
    

    This command must run in every terminal window. If you want to skip this step, please add this command in your ${HOME}/.bash_profile.

    The tool chain is installed in spresenseenv/usr/bin under the home directory.
  5. Clone the Spresense SDK with submodule

    git clone --recursive https://github.com/sonydevworld/spresense.git
    
  6. Install USB serial driver

    User must install before connecting Spresense board to the PC.

    Please download and install from below.

    On High Sierra (10.13) and later, the installation of the driver may be blocked. Please allow this driver from System Preferences Security & Privacy pane. See Apple Technical Note TN2459 "User-Approved Kernel Extension Loading" for more information.

2.2. Installation of VSCode

  1. Download the VSCode installer from the following site.

  2. Run the downloaded installer

    • For Windows

      1. Start the installer (VSCodeUserSetup.exe).

      2. Proceed with installation according to the dialog.

    • For macOS

      1. Unzip the installation file (VSCode-darwin-stable.zip).

      2. Move the unzipped Visual Studio Code to the application.

    • For Ubuntu

      1. Install from the downloaded file (code_1.37.1-xxx.deb) with the following command.

        $ sudo dpkg -i code_1.37.1-xxx.deb
  3. Launch the installed VS Code

    vscode vscode installed en

2.3. Installing the Spresense extension

If you have installed the Spresense Extension α version , please uninstall it. If you do not uninstall, the Spresense extension will not work properly.
  1. Search Spresense on the extension screen.

  2. Spresense VSCode IDE will appear in the list and click on it.

  3. Click Install button on the details displayed on the right side of the window.

    vscode spresense install en
  4. The installation is complete when the message Installation is complete appears as shown in the screen below.

    vscode spresense installed en
    The Spresense VSCode IDE will automatically install these extensions for use with C/C++ for Visual Studio Code and Cortex Debug.

2.3.1. Setting Msys2 Installation Path (Windows only)

In this section, we will set the MSYS2 on VS Code.

  1. Press F1 to display the command palette.

  2. Input spresense msys to filtering commands, and select MSYS2 path(Windows only): Location for Msys install path.

    vscode msys2 search en
  3. When the folder selection screen appears, select the MSYS2 path and click Open.

    vscode msys2 folder en
  4. This completes the environment for developing Spresense applications on VS Code.

3. Creating an application project

This chapter explains the procedure for creating the application project myproject in the VS Code workspace.

3.1. Creating a workspace

To start developing your application, create a workspace for Spresense by adding an Spresense SDK folder and a project folder in the workspace. When creating a project, you can create an empty folder and add it to this workspace to create a project.

Here, create a workspace with the following configuration using the "Workspace Setup Wizard".

Setting items Setting details

Spresense SDK folder

C:\msys64\home\user\spresense

Project folder

C:\msys64\home\user\myproject

Workspace file

C:\msys64\home\user\myproject.code-workspace

vscode wizard create workspace overview en
  1. Press F1`key to open command palette and choose `Spresense: Workspace setup wizard .

    To create a new workspace, the workspace (folder) on the window must be closed.
  2. Select the Spresense SDK folder that use for project into Spresense SDK path form.

  3. Select the newly created project folder into Project folder path form.

  4. Click Create to complete the wizard.

  5. If Spresense setup: Setup complete. is displayed, setup is complete.

    vscode setup workspace complete en
  6. Select Save Workspace As…​ from File to save a created workspace.

    vscode menu save workspace en
    You can reopen the newly created workspace by opening the saved workspace file from “File”→ “Open Workspace …​”.
  7. If the workspace is completed as shown below, it is complete.

    vscode workspace complete en
You can also create a workspace by adding folders to the workspace in the order of the Spresense SDK, project folder without using the above workspace setup wizard.
To add multiple project folders to the workspace, right-click on the source tree and execute Add folder to workspace…​.

3.1.1. About files included in the project folder

The project folder contains the following 4 types of files.

  1. Project configuration file

    Files saved in .vscode directly under the project folder. Basically, the files inside are automatically generated, so there is no need to create a new one.

  2. Application commands (created in the following chapters)

    Contains programs to be executed with commands available on the NuttShell console. By implementing the program in this, you can create original commands. For example, the command myapps can be executed with NuttShell for the following.

    NuttShell (NSH) NuttX-8.2
    nsh> myapps
    <<Output result>>
  3. ASMP worker program (created in the following chapter)

    A program that uses the multi-core feature of Spresense . By creating this program and using it from the above application commands, you can add multi-core applications.

  4. Makefile (LibTarget.mk, Make.defs, Makefile) (created in the following chapter)

    This file is required to build the entire project. If this file is changed, it may not build correctly.

3.2. Enabling shell settings

Spresense VSCode IDE has a special shell configuration to build and debug Spresense SDK. In order for the setting to take effect, you need to display the terminal once to allow changes to the shell settings.

vscode terminal setting en
  1. Select New Terminal from Terminal .

  2. Choose folder in Select current working directory for new terminal dialog.

  3. Click Allow in opened Do you allow this workspace to modify your terminal shell? dialog.

    If you do not select Allow in this dialog, Spresense VSCode IDE feature such as build and serial terminal display will not work properly.

4. Create and run application "myapps"

The environment for developing applications in the previous chapters is in place. Here, the procedure to actually create the application "myapps" on VS Code is explained in the following flow. "myapps" is a simple application that only displays "Hello Spresense !!!"

4.1. Adding application commands

This section describes the procedure for adding the application command myapps that only displays Hello Spresense!!!.

Setting items Setting details

Target project folder

C:\msys64\home\user\myproject

Application command name

myapps

vscode new item creation en
  1. Right click on the project folder created in the previous chapter (myproject) and select Spresense: Add to project folder…​.

  2. In the opened Add to Project Folder dialog, select the project folder to which you want to add application commands and click Next.

  3. Select Application Command from the item type and click Next.

  4. Enter the name of the application command you want to add to Application command name. (In this example, it is myapps.)

    vscode wizard item application created en

4.1.1. About added files

File(Folder) Detail

myapps

This folder contains the command program and the Makefile for building application command.

myapps_main.c

The main source file for the command. Simply edit this file after creating a new application.

Make.defs

Makefile for building commands.

Makefile

Makefile for customizing commands. You can describe new added files and flags used for building.

4.2. Application implementation

In this chapter, we will implement the application command program to display Hello Spresense !!!.

4.2.1. Edit the main source code

The main source code (myapps_main.c in this example) is created when an application command is added and displayed in the editor. Edit the main source code as follows:

myapps_main.c
#include <sdk/config.h>
#include <stdio.h>

int myapps_main(int argc, char *argv[])
{
  printf("Hello Spresense!!!"); (1)
  return 0;
}
1 Implement the process you want to add.
vscode edit main code file en

4.3. Build configuration

In the previous chapter, you added an application to the project folder and implemented the program. In order to build these programs properly, it is necessary to configure the build according to the function.

This section describes the configuration and steps required to build myapps.

There are no special features other than running Spresense this time, so the following will configure the kernel and SDK.

In SDK v1.5 or earlier, it is necessary to perform kernel config separately from SDK config. Please refer to How to build SDK with SDK v1.5 or earlier for kernel configuration and build methods.
For details of the configuration tool, refer to About Build configuration.
Configuration Detail

SDK

Save default configuration(No selecting presets.)

4.3.1. SDK configuration

Create a new configuration without selecting a preset.

vscode sdk config en
  1. Right click on the project folder and select Spresense: SDK Config from the project menu.

    If another 'Kernel config' or 'SDK config' is already open, please close it beforehand. Only one config window can be open at a time.
  2. Click New to open the SDK preset list.

  3. Click OK.

  4. Click Save to save.

  5. If Configuration has been saved. is displayed, SDK configuration is complete.

    It may take some time to save depending on the environment. Please wait for a completion message.

4.4. Build the project

Up to the previous section, you have created a project, added a program, and configured it.

This section explains how to build the created program into a binary(.spk file) that can be flash into Spresense.

Build application with the NuttX kernel of Spresense SDK. Since various functions are included, it takes considerable time. (Depending on your environment, it may take over ten minutes.)

In SDK v1.5 or earlier, it is necessary to perform kernel build separately from application build. Please refer to How to build SDK with SDK v1.5 or earlier for kernel configuration and build methods.

4.4.1. Building the application

vscode build application en
  1. Right click on the project folder you want to build and select Spresense: Application build from the project menu.

  2. The application build will start, so wait for it to complete.

  3. If Terminal will be reused by tasks, press any key to close it. is displayed, the Application build is complete.

4.4.1.1. About build output files
File(Folder) Detail

out

The folder where the build output files are copied.

myproject.nuttx.spk

This file is written to SPI-Flash on the Spresense board.

myproject.nuttx

An ELF file containing debugging information. Load this file into Spresense for ICE debugging.

4.5. Flashing the application into Spresense board and Check operation

In the previous sections, we explained everything from creating a project to creating a binary that is flashing into Spresense.

This section describes the procedure from flashing the actually created binary to Spresense to checking the operation.

4.6. Setting the serial port

  1. Connect the PC and Spresense via USB.

  2. Press F1 key to display the command palette.

    vscode serial port menu open en
  3. Input spresense serial port to narrow down the command.

  4. Choose Spresense: Serial port selection.

    vscode serial port menu select en
  5. Choose serial port for Spresense from list.

    vscode serial port select en

4.6.1. Flashing build binaries

If you are using Spresense SDK for the first time or updating the version, you need to update the boot loader. Please refer to here to update the boot loader.
vscode flash application en
  1. Right click on the project folder you want to flash the built binary and select Spresense: Build and Flash from the project menu.

  2. The application build will start and wait for completion.

    You can also skip the previous section’s command Spresense: Application build by using this command.
  3. As soon as the build is over, flashing to Spresense will start.

  4. After flashing to Spresense, the serial terminal will open.

4.6.2. Operation check

Enter the myapps command created on the open serial terminal and type the Enter key." Hello Spresense!!!" will displayed.

vscode execute application command en
  1. Type myapps on the opened serial terminal and press the enter key.

  2. The execution result of the created command is displayed.

5. Appendix

5.1. How to build SDK with SDK v1.5 or earlier

Kernel configuration and build are required for building systems for SDK v1.5 and earlier before an application configuration and build.

This section describes how to configure and build the kernel required to develop using SDK v1.5 or earlier.

5.1.1. Kernel configuration

This is the procedure to configure using the preset release.

vscode kernel config en
  1. Right click on the project folder and select Spresense: Kernel Config from the project menu.

    If another 'Kernel config' or 'SDK config' is already open, please close it beforehand. Only one config window can be open at a time.
  2. Open the New menu and display the list of kernel presets.

  3. Select release from the preset and click OK.

  4. Click Save to save.

  5. If Configuration has been saved. is displayed, kernel configuration is complete.

    It may take some time to save depending on the environment. Please wait for a completion message.
  6. Close the configuration.

5.1.2. Build the kernel

vscode build kernel en
  1. Right click on the project folder you want to build and select Spresense: Kernel build from the project menu.

  2. Wait until the kernel build is complete.

  3. If Terminal will be reused by tasks, press any key to close it. is displayed, the kernel build is complete.

After these configurations and builds are done, you can configure and build the application in the same way as in SDK v2.0 or later.

5.2. Creating a multi-core application "myasmp"

This section explains how to create a multi-core application "myasmp". In this example, the main core program (supervisor) starts a program (worker) that runs on the sub-core, and creates an application that receives the string "Hello ASMP!" From the sub-core. This example use the workspace that created in "myapps" section.

5.2.1. Adding ASMP worker program

This section describes the procedure for adding a multi-core application in which the sub-core sends Hello ASMP! to the main core and displays the characters received by the main core.

Setting items Setting details

Target project folder

C:\msys64\home\user\myproject

ASMP worker name

myapps

Creating a sample application

Yes

Sample application name

asmpApp

vscode new asmp item creation en
  1. Right click on the project folder created in the previous chapter (myproject) and select Spresense: Add to project folder…​.

  2. In the opened Add to Project Folder dialog, select the project folder to which you want to add ASMP worker program and click Next.

  3. Select ASMP worker program from the item type and click Next.

  4. Enter the name of the ASMP worker you want to add to ASMP worker name. (In this example, it is myasmp.)

  5. Since we will also create an application that starts ASMP workers with main core application, check Create a sample application command for using this ASMP worker.

  6. Enter the command name to be created in Sample application name. (In this example, it is asmpApp.)

  7. Click the Create button to add the program file as shown below and the main source file is displayed in the editor.

    vscode wizard item asmp created en
5.2.1.1. About added files
File(Folder) Detail

myasmp_worker

This folder contains worker programs and Makefiles for building them.

myasmp_worker.c

The main source file for the worker. Implement a program that runs on a sub-core.

Makefile

Makefile for customizing workers. You can describe new added files and flags used for building.

include

This is a header file folder for sharing definitions with the main core application.

asmpApp

This folder contains a sample application for using the created worker.

5.2.2. Build configuration

To build a multi-core application, you need to enable feature/asmp in the SDK config preset. Here, configure to enable ASMP.

vscode sdk config asmp en
  1. Right click on the project folder and select Spresense: SDK Config from the project menu.

    If another 'Kernel config' or 'SDK config' is already open, please close it beforehand. Only one config window can be open at a time.
  2. Click New to open the SDK preset list.

  3. Click on the Feature category to switch categories and select asmp.

  4. Click OK.

  5. Click Save to save.

  6. If Configuration has been saved. is displayed, SDK configuration is complete.

    It may take some time to save depending on the environment. Please wait for a completion message.

5.2.3. Build the project

You can build in the same way as the main core application. The ASMP worker will built after the main core application is build.

  1. Right click on the project folder you want to build and select Spresense: Application build from the project menu.

  2. The application build will start, so wait for it to complete.

  3. If Terminal will be reused by tasks, press any key to close it. is displayed, the Application build is complete.

5.2.3.1. About build output files
File(Folder) Detail

myasmp_worker

myasmp_worker.debug

Debug ELF file for ASMP workers.

out

The folder where the build output files are copied.

worker

This is the folder where the ELF file for ASMP workers written to SPI-Flash.

myasmp

ELF file for ASMP worker myasmp.

myproject.nuttx.spk

This file is written to SPI-Flash on the Spresense board.

myproject.nuttx

An ELF file containing debugging information. Load this file into Spresense for ICE debugging.

5.2.4. Flashing the multi-core application into Spresense board and Check operation

You can flash binary into Spresense board in the same way as the main core application. After the main core binary is flashed, the worker ELF file is written to SPI-Flash.

5.2.4.1. Flashing build binaries
  1. Right click on the project folder you want to flash the built binary and select Spresense: Build and Flash from the project menu.

  2. The application build will start and wait for completion.

  3. As soon as the build is over, flashing to Spresense will start.

  4. After flashing to Spresense, the serial terminal will open.

5.2.4.2. Operation check

Enter the asmpApp command created on the opened serial terminal and type the Enter key. Then the Worker said: Hello ASMP! Is displayed.

vscode execute multicore application command en
  1. Type asmpApp on the opened serial terminal and press the enter key.

  2. The execution result of the created command is displayed.

5.3. About Build configuration

Build configuration (kernel config/SDK config) is a tool for configuring the build for application to be developed. It has presets for each purpose.

In SDK v1.5 or earlier, build configuration is divided into two parts, kernel and SDK, and in v2.0 or later, they are integrated and configured using SDK config.

Keyword completion and parsing syntax functions provided by Microsoft’s C/C++ extension will not work correctly unless this configuration is complete. Make sure to complete the configuration before creating the program.

5.3.1. For SDK v1.5 or earlier

  • Kernel configuration

    This is the configuration of NuttX a Realtime OS used in Spresense SDK . Configure OS level settings for programs that run on Spresense.

    For normal use, save with the release preset.

    Preset Detail

    release

    This is a default setting which is the functions of the Spresense SDK basic work through.Use this preset for normal usage.

    debug

    This preset includes settings such as debug log in addition to release.

  • SDK configuration

    Configuration of features specific to Spresense SDK. Audio, camera, GPS, and other features that run on Spresense are configured here. You can also configure the Examples application and system tools here.

    Category of preset Detail

    Device

    Presets for using devices such as sensors and SDcard. Depending on the preset, you may need to connect the device.

    Feature

    Presets for using Spresense functions and system tools.

    Examples

    This is a preset for using the sample application provided in the Spresense SDK.

5.3.2. For SDK v2.0 or later

  • SDK configuration

    Configuration of overall functions in a Spresense SDK (includes a NuttX). Audio, camera, GPS, and other NuttX features that run on Spresense are configured here. You can also configure the Examples application and system tools here.

    Category of preset Detail

    Device

    Presets for using devices such as sensors and SDcard. Depending on the preset, you may need to connect the device.

    Feature

    Presets for using Spresense functions and system tools.

    Examples

    This is a preset for using the sample application provided in the Spresense SDK and NuttX.

5.3.3. Configuration save menu

The functions of the configuration save menu are as follow:

Menu Function

New

You can select a preset configuration provided by Spresense SDK.

Save

Save the build configuration with the set contents.

Load

Open the saved backup configuration file.

Save as

Save the settings to any location. Since it is saved separately from the configuration file used for the build, it is not reflected in the build.

5.4. Installing the boot loader

To use the functions of Spresense and Spresense VSCode IDE, you need to install the latest boot loader. Otherwise, Spresense and Spresense VSCode IDE will not work properly.

This section explains the boot loader installation procedure.

Install the boot loader the first time you use it or when the SDK version is updated.
  1. Type a F1 key to display the command palette.

    vscode bootloader open en
  2. Input spresense bootloader to narrow down the command and choose Spresense: Flash bootloader.

    vscode bootloader select en
  3. Click OK on dialog that showing the message To install the bootloader, you must download the bootloader archive with a web browser…​..

    Download the boot loader from the web site.
    vscode bootloader web confirm en
  4. As the web browser opens, download according to the instructions on the page.

    vscode bootloader webpage1 en
    vscode bootloader webpage2 en
  5. Click on the dialog box to confirm the continuation of the installation.

    vscode bootloader zip confirm en
  6. In the file dialog that appears, select the downloaded ZIP file.

    vscode bootloader zip open en
  7. After selecting the ZIP file, the boot loader installation will begin.

    vscode bootloader flash start en
  8. If the task is completed normally as shown below, the installation of the boot loader is complete.

    vscode bootloader flash finished en

5.5. ICE debugging

5.5.1. Preparing the debugger

5.5.1.2. Mounting the SWD connector

Refer to the hardware documentation for how to mount the SWD connector.

5.5.1.3. OpenOCD settings (Ubuntu only)

In the case of Ubuntu, it is necessary to grant the authority to connect to ICE with the following command. Please do it before connecting ICE

sudo cp ~/spresenseenv/usr/contrib/60-openocd.rules /etc/udev/rules.d/
sudo udevadm control --reload

5.5.2. Debugging the main core with ICE

This section explains how to load the built binary directly into Spresense SRAM and check (debug) the operation.

You can debug by setting a break at a specified location and stopping the program at the specified location, or by writing a Watch statement and stopping at the specified condition.

5.5.2.1. Setting Break points
  1. Open the source code where you want to set the Break point (eg: if you want to set it on the 6th line).

    vscode debug break point en
  2. Click the left edge of the line you want to set (next to the left of the line number) and mark it red.

    vscode debug break point set en

This completes the setting of the Break point.

5.5.2.2. Starting Debug
  1. Click the debug icon from the icon on the left of the window.

    vscode debug open en
  2. elect the debug menu for the created project from the debug configuration list.

    vscode debug select en
  3. Click the Start debugging button.

    vscode debug start button en
  4. Wait for the completion of the debugging process.

    vscode debug prepare en
  5. When the debug control button icon changes as shown below, the preparation is complete.

    vscode debug started en
    At the start of debugging __start(void), a Break is performed.
  6. Click Continue on the icon above and Spresense will start running.

    vscode debug executed en
  7. When processing that passes through the set break point (eg: command execution), the break will occur at the set point.

    vscode debug breaking en
  8. Click Continue button again to release from Break.

    vscode debug continue en

6. Limitations

6.1. Cannot build a application that is created with SDK v1.5 or earlier by using SDK v2.0 or later

Since Spresense SDK v2.0, the build system is integrated with the kernel, so the configurations are not compatible with SDK v1.5 or earlier.

When building with SDK Version 2.0 or later, delete .vscode in the project folder first and reconfigure the SDK. (We recommend that you make a backup of the entire project.)

6.2. Spresense VSCode IDE may not be used depending on the folder name/path used

Spresense VSCode IDE has the following restrictions depending on the type of characters used in the path of the folder used due to the specifications of some build systems.

  • Restrictions common to all operating systems

    • Case of the folder path contains a space(Example: C:\Users\Sony Taro\project)

      All functions do not work.

If you using on these conditions, we recommend to create new account for using Spresense VSCode IDE.

7. Troubleshooting

This section explains the problems that may occur when using VS Code and how to deal with them by category. See here if the VS Code does not work well.

7.1. Setup

7.1.1. Terminal does not open correctly (Windows)

In Windows environment, VS Code uses MSYS2 bash as a terminal. If this bash does not open and PowerShell or cmd (command prompt) opens as shown in the following figure, the terminal settings of the workspace may not be reflected correctly. In that case, try the following steps:

  • Allow terminal shell changes

    For Visual Studio Code Version 1.37.1 or earlier

    1. Press F1 to open the command palette.

    2. Type terminal allow to narrow down the command and select Terminal: Allow to Workspace Shell Configuration.

    For Visual Studio Code Version 1.38.0 or later

    1. Press F1 to open the command palette.

    2. Type terminal manage to narrow down the command and select Terminal: Manage Workspace Shell Permissions.

    3. Select Allow Workspace Shell Configuration from list.

  • Reopen the workspace

    1. Select FileClose Workspace from window menu.

    2. Select FileOpen Workspace…​ from window menu.

    3. Open the saved workspace file.

    4. Waiting to display Spresense setup: Setup complete.

7.2. Build a project

7.2.1. Build does not progress

If the build does not proceed, the load on your PC may have increased, or there may be a problem with the terminal settings. Check the terminal status by following the steps below.

  1. Select TerminalNew Terminal from window menu.

  2. Run the`echo ${SHELL}` command on the terminal opened in the previous step.

  3. If the result is not /bin/bash or /usr/bin/bash, perform the Terminal does not open correctly (Windows).

7.2.2. Build fail

7.2.2.1. "application.mk: No such file or directory" shows in build logs

If the build fails with a message like the one shown below, your project configuration file does not match the installed Spresense VSCode IDE version. In this case, execute Spresense: Update project folder settings from the command palette to update the project setting file.

Makefile:30: /home/user/myproject/.vscode/application.mk: No such file or directory
make[2]: *** No rule to make target '/home/user/myproject/.vscode/application.mk'.  Stop.

or

Makefile:12: /home/user/myproject/.vscode/worker.mk: No such file or directory
make: *** No rule to make target '/home/user/myproject/.vscode/worker.mk'.  Stop.