AVR in VS Code

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I struggled a bit using AVRs in VS Code, especially getting the IntelliSense running properly. Now I have finally found a way to do it, that I hope will work for any AVR, both with GCC and IAR:

https://gitlab.com/echoromeo/avr_vscode/-/tree/master

 

Anyone wants to try it out and give me some feedback?

I have only tried it on Windows, but I hope it should work on mac/linux as well.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
{
            "name": "ATtiny817",
            "includePath": [
                "${workspaceFolder}/**",
                "C:/Program Files (x86)/Atmel/Studio/7.0/toolchain/avr8/avr8-gnu-toolchain/**"
            ],
            "defines": [
                "__GNUC__=5",
                "__GNUC_MINOR__=4",
                "__ATtiny817__",
                "__AVR_ATtiny817__",
                "__AVR_DEV_LIB_NAME__=tn817"
            ],
            "cStandard": "c99",
            "cppStandard": "c++03",
            "intelliSenseMode": "msvc-x64"
        },

I also had a good go at this; primarily for ease of inspecting code posted to AVRfreaks.

I make several similar configurations with differing processor defines so named them accordingly as above.

 

I'm not sure about your "intelliSenseMode": "msvc-x64".  I went for  "intelliSenseMode": "gcc-x86".

 

Last Edited: Wed. Feb 26, 2020 - 10:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you guys aware of platformio? Its a plugin for vsc and does all the above and more - like downloading the required compiler and tools, building etc.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the input Winterbottom, I changed the names and modes in the repo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for reminding me Kartman, I have used PlatformIO for some Arduino stuff before, but I have not actually tested it for standard AVR stuff.

 

I will be a bit surprised if it supports IAR though. Initial googling does not look promising, I will have a look!