Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12687 Discussions

VSCode Nios II command shell

qwk000
Nouveau contributeur I
3 506 Visites

Has anyone tried and successfully enabled the Nios II Command Shell in Microsoft VSCode?

0 Compliments
1 Solution
qwk000
Nouveau contributeur I
3 494 Visites

I'm back!  Ok, to get the build environment (somewhat) integrated into VSCode, the secret is: Launch "code" from the Nios II Command Shell. That way, the path to "make" is known, and the right shell is launched during the build. 

I think these items are needed in the settings for the "Makefile Tools" extension:

qwk000_1-1678401511646.png

If the Makefile is not in the root of the folder, you'll have to tell the extension where it is using setting in the same section shown in the image above.

Now I have clickable links:

qwk000_2-1678401846681.png

 

Voir la solution dans l'envoi d'origine

0 Compliments
10 Réponses
qwk000
Nouveau contributeur I
3 501 Visites

qwk000_0-1678397906167.png

That was pretty easy. Just needed better googling skils.

Next, anyone know how to integrate the "make" build into VSCode? Just the simple terminal integration doesn't provide clickable links to errors/warnings.

0 Compliments
qwk000
Nouveau contributeur I
3 495 Visites

I'm back!  Ok, to get the build environment (somewhat) integrated into VSCode, the secret is: Launch "code" from the Nios II Command Shell. That way, the path to "make" is known, and the right shell is launched during the build. 

I think these items are needed in the settings for the "Makefile Tools" extension:

qwk000_1-1678401511646.png

If the Makefile is not in the root of the folder, you'll have to tell the extension where it is using setting in the same section shown in the image above.

Now I have clickable links:

qwk000_2-1678401846681.png

 

0 Compliments
qwk000
Nouveau contributeur I
3 484 Visites

To get Intellisense working decently in VSCode, in addition to the steps above, follow these steps:

Configure IntelliSense for C++ cross-compilation (visualstudio.com)

 

0 Compliments
GavinPaterson
Débutant
2 502 Visites

 

Hi qwk000,

Apologies for bothering you but thought you might have some advice regards debugging in VScode? I am able to "Build target" using "code ." from my NIOS II command shell in Microsoft Windows 11.  I am unable however to run or debug my application though as I see there are "No launch targets identified"

 

I receive a message "Cannot 'debug' because there is no launch configuration set and the list of launch targets is empty. Double check the makefile configuration and the build target."

I have checked in the "settings.json" and have "launch.json" populated as follows:

 

 

{
    "version": "0.2.0",
    "configurations": [
      {
        "name": "Myapp",
        "type": "cppdbg",
        "request": "launch",
        "program": "${workspaceFolder}/Myapp.elf",
        "args": [],
        "stopAtEntry": true,
        "cwd": "${workspaceFolder}",
        "MIMode": "gdb",
        "miDebuggerServerAddress": "localhost:2334",
        "miDebuggerPath": "/mnt/c/intelFPGA_lite/22.1std/nios2eds/bin/gnu/H-x86_64-mingw32/bin/nios2-elf-gdb.exe",
        "debugServerPath": "/mnt/c/intelFPGA_lite/22.1std/quartus/bin64/nios2-gdb-server.exe",
        "debugServerArgs": "--tcpport 2334 --reset-target --tcppersist",
      }
    ]
  }

 

 
for some reason the build executable isn't getting picked up when I go to launch? Do you have any ideas/advice?

 

0 Compliments
G5P7
Débutant
93 Visites

This configuration works for me:

It's based on Zapho's answer to a related question:
N.B. this particular solution also needs the Command Variable extension that you can read about further here

I have the following in the User's settings.json :

"makefile.configurations": [
{
"name": "Nios-user-settings",
"buildLog": "",
"makeArgs": [],
"makeDirectory": "/home/user/fpga_projects/hw_proj/software/sw_proj",
"makefilePath": "/home/user/fpga_projects/hw_proj/software/sw_proj/Makefile",
"problemMatchers": [],
"postConfigureArgs": [],
"preConfigureArgs": [],
"makePath": "/home/user/intelFPGA_lite/21.1/quartus/linux64/gnu/make",
}
],
 

 

This is all that's needed to use the Makefile-Tools extension to build the software project using make. All that's necessary is to be able to build the "current target"

The following can then be added to the project's .vscode/launch.json:

{
"configurations": [
{
"name": "(nios-gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/home/user/fpga_projects/hw_proj/software/sw_proj/program.elf",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "CWD",
"value": "${workspaceFolder}"
},
{
"name": "PATH",
"value": "/home/user/intelFPGA_lite/21.1/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/scripts"
},
{
"name": "PWD",
"value": "${workspaceFolder}"
},
],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"miDebuggerServerAddress": "localhost:${input:randomPort}",
"miDebuggerPath": "/home/user/intelFPGA_lite/21.1/nios2eds/bin/gnu/H-x86_64-pc-linux-gnu/bin/nios2-elf-gdb",
"debugServerPath": "/home/user/intelFPGA_lite/21.1/quartus/bin/nios2-gdb-server",
"debugServerArgs": "--tcpport ${input:rememberRandomPort} --reset-target --tcptimeout 5",
}
],
"inputs": [
{
"id": "randomPort",
"type": "command",
"command": "extension.commandvariable.number",
"args": {
"name": "randomPort",
"range": [1500, 60000],
"random": true,
"uniqueCount": 10
}
},
{
"id": "rememberRandomPort",
"type": "command",
"command": "extension.commandvariable.remember",
"args": { "key": "number-randomPort" }
}
]
}



The vscode built-in Run & Debug button on the left hand panel (Ctrl + Shift + D)  can then be used to Debug the application.
This doesn't allow all functionality of Eclipse but allows for making and debugging the software project..
There's some further reading here

It's not clear if there's likely to be more configurability in the Makefile Tools soon.

 

0 Compliments
EBERLAZARE_I_Intel
3 464 Visites

Hi,


May I know your windows version you're working on?


0 Compliments
qwk000
Nouveau contributeur I
3 402 Visites
0 Compliments
EBERLAZARE_I_Intel
3 431 Visites

Hi,


May I know also the Quartus/Nios II version that you used?


Also, do you have any further questions/help needed?


0 Compliments
qwk000
Nouveau contributeur I
3 401 Visites

Quartus Prime Version 18.1.0 Build 625 Standard Edition

 

No further assistance needed.

 

0 Compliments
EBERLAZARE_I_Intel
3 392 Visites

Hi,


Thanks for the update and the information.


I’m glad that your question has been addressed, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.



p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or you may also select your own best answer for other user's experience or rate 4/5 survey.


0 Compliments
Répondre