How to configure Visual Studio Code to build a project with IAR compiler? - visual-studio-code

I want to use Visual Studio Code as my main IDE, but I want to compile my code with IAR's compiler.
How could I configure VSCode ?
I found this extension but the documentation is too poor.

Yes, the extension politoleo.iar is indeed NOT good.
-> I found a better one (will try it in future by myself):
VSCode plugin: pluyckx.iar-vsc
IAR For Visual Studio Code - Visual Studio Marketplace
Good document
Welcome to IAR-VSC’s documentation! — IAR-VSC 1.2 documentation
doc's Github source: pluyckx/iar-vsc
IAR related official Technical Note
Using Visual Studio Code with IAR Embedded Workbench
Enjoy it !

There are now two official IAR plugins for VSCode which make things much easier:
For building and development: https://marketplace.visualstudio.com/items?itemName=iarsystems.iar-build
For debugging with C-Spy: https://marketplace.visualstudio.com/items?itemName=iarsystems.iar-debug
https://www.iar.com/knowledge/support/technical-notes/general/using-visual-studio-code-with-iar-embedded-workbench/

What I did is setting some environment variables in settings.json;
then in tasks.json I created shell tasks that call the IarBuild.exe & IarIdePm.exe with appropriate values (see the documentation on the command line options)...
So now, I can use VSCode for navigation & editing, but the compilation is done by the EWARM.
The only thing that I haven't figure out yet is how to make C-Spy work from within VSCode...
Currently when I want to debug, I just launch the EWARM and debug from there...
here is a screenshot:Screenshot of settings.json and tasks.json

For this, you can port you project to the custom build system (non iarbuild), e.g. a best choose is the Qbs. The Qbs support a lot of architectures and the toolchains (include IAR, KEIL and so on). In this case you can then use any IDE which support the Qbs, e.g. such as VSCode or QtCreator, and to open your project in any of these IDEs.
Both IDEs support only the GDB debugging, because the C-Spy debuger is a proptietary technology, which has not the public datasheets.

Related

Cannot find Arduino IDE path. In Visual Studio Code

I wants to use Arduino in vs code Visual Studio Code.
I installed arduino IDE on my local machine on C:\Program Files\Arduino IDE I also added arduino path my Visual Studio Code's setting .json
"arduino.path": "C:\\Program Files\\Arduino IDE",
setting .json
I am using arduino extension.
This is the pic of extension
Any suggestion or recommendations would greatly aid me. I've been struggling to find a solution for this problem for 6 hours.
This was giving me issues for the longest time, too. It seems that the Arduino 2.X IDE doesn't work well with VSCode.
To resolve, use the legacy IDE (Arduino 1.8.X). First, uninstall the 2.X version of Arduino. As of February 2023, you can download the legacy version by going to the Arduino Downloads page and scrolling down to the "Legacy IDE (1.8.X)" section. There's a few different download options. I opted for the one labeled "Windows Win 7 and Newer" since it's a neatly contained executable to install Arduino.
From here, run the executable and install normally. I also reinstalled the Arduino plugin in the Visual Studio marketplace (not sure if necessary, but it doesn't hurt). There's at least three places you could potentially enter the arduino.path:
The one in YOUR PROJECT FILEPATH/.vscode/settings.json
The one in the VS Code User Settings (File>Preferences>Settings> User tab> Search for arduino.path in the search bar)
Same as above, but on the "Workspace" tab instead of "User"
For me, leaving all three empty worked fine. I believe that's because the installer added Arduino to the Windows Path variable. Here's a related post, though, where someone had to configure the path variable in case that doesn't work for you.

NanoFramework VSCode - How to get started?

Maybe I am just missing something, but I don't get how to setup a blank solution in VSCode (Under Windows or Visual Studio, you are able to just create a new Blank NanoFramework Template, but how can I do that in VSCode :/). I would really like to work with the nanoframework instead of c/c++, but I don't know how to create a blank solution :(.
That option is not currently available.
The main goal of the VS Code extension is to allow (partially) folks on MAC or Linux to work with .NET nanoFramework.
It's not possible to debug on VS Code and you'll only have a full experience on Visual Studio. If you're on Windows, the recommendation is to use Visual Studio.

how to do map dependencies with code maps using VS code on ubuntu?

I encountered this link: https://learn.microsoft.com/en-us/visualstudio/modeling/map-dependencies-across-your-solutions?view=vs-2019, and I was thinking to follow it to generate code maps for my c++ code running on ubuntu vs code of version 1.61.2. Somehow I can not even find the tool menu and the solution explorer. I managed to install the solution explorer as my VS code extension. But I still do not know how to get started. Any comments are greatly appreciated.
Unfortunately it seems that the dependency maps are only available in Visual Studio and not in VSCode, which are two separate things

Running IBM Rhapsody animations without Visual Studio

I am relatively new to Rational Rhapsody, and SysML in general, so the errors are likely to be at my end.
I have been scouring Google (and SOF) looking for ways to run Rhapsody animations without Visual Studio. It was my impression that if Rhapsody had access to another IDE, say Eclipse, then the other IDE could deal with the animations. Is this correct, or is VS absolutely required to run animations and debugging tools in Rhapsody?
I have been getting a similar error to that of the user in How to fix Rational Rhapsody error :"Current value is "VC11", but no Visual Studio installation was not found in the directory ""."; my error is "VC10." However, I do not have, or plan to have, Visual Studio run the animations; I'd rather have the animations run using Eclipse, but this is not working either (the same "VC10" error occurs).
I also chatted with a contact at IBM and he suggested trying cygwin as a compiler, but under my circumstances, I cannot download that software.
Thanks in advance for the assistance.
The Rhapsody workflow:
Rhapsody generates code from your model. (UML => C++)
To compile the code you need a compiler. Rhapsody does not have its own compiler. If you are on Windows, you can use the VS or cygwin compiler. (C++ => EXE)
If you have enabled the animation instrumentation for your application, then if you start the application, it will connect (using TCP/IP) to a running Rhapsody instance. The animation will run in Rhapsody.
... is VS absolutely required to run animations and debugging tools in Rhapsody?
A compiler (eg. VS or cygwin) is absolutely required to compile the code that has been generated by Rhapsody. Rhapsody is required if you want to see animated state-charts or sequence-diagrams while your application is running.
See also: configure Rhapsody 8.x to use the VS 2013 compiler.
There are many different questions. I try to give you some clarifications.
To run your Rhapsody model with animation you need Rhapsody and a compiler. The compiler could be Visual Studio compiler or Cygwin gcc. Those frameworks are already provided by Rhapsody.
Visual Studio or Eclipse you only need to edit your code. This can easily be done with right klick on your configuration and change it to the corresponding IDE.
I guess you question is related to the VS Version. In the properties of your configuration you must adjust your Visual Studio version. Search for property with VCxx content. Can't remember the exact name of the property at the moment.

Scala with VScode

I started to use vscode for python development. And I really like it, does anyone know how to extend VScode so I can write scala in it as well ?
At the bare minimum I need to get syntax highlighting working.
Scala works well in VS Code 2019.
There's official syntax highlighting, and a Language Server called Metals (which replaces Ensime which is mentioned in other answers).
There is one here:
https://github.com/IliyaTryapitsin/vscode-scala
You can add it by reading the readme there which is:
Run VSCode
code --enableExtensionGallery
Press F1 then input:
for scala installation
ext install scala
for sbt installation
ext install sbt
for snippets installation
ext install scalasnippets
If your NOT using Intellij or Eclipse and want to stick to VSCode, then I highly recommend Ensime & Ensime plugin below:
https://marketplace.visualstudio.com/items?itemName=dragos.scala-lsp
Also check out, www.ensime.org
It's a bit more involved to setup ensime env but still worth it.
Discussion of two is below here:
https://www.reddit.com/r/scala/comments/5eu9if/intellij_vs_ensime/
However, Intellij has improved a lot. So, the beauty contest is a matter of judgement call.
I have been switch back & forth between many variations (Emacs, Intellij, neovim, VSCode). It's a complicated language. So, I need all the help I can get!
If you dig into the applications path it looks to me to be extensible in .js, take a look at the javascript and typescript folders for example(though I haven't tried it yet)
Visual Studio Code does not have a language extensible story yet, but it could be coming soon.
https://code.visualstudio.com/Docs/languages#_common-questions
scala has official vs code scala extension