Forum Rule: Always post complete source code & details to reproduce any issue!
Page 7 of 9 FirstFirst ... 5 6 7 8 9 LastLast
Results 151 to 175 of 211

Thread: Compiling Teensy Sketches with VisualCode (Win10)

  1. #151
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130

    Workaround for non standard Arduino installations

    @turbok: I did a quick workaround and uploaded it to GitHub: https://github.com/luni64/VisualTeen...ases/tag/0.9.1. Can you give that a try? (please follow the instructions on GitHub). As soon as I find some time, I'll improve the first startup behavior.

    @WMXZ: Due to a bug, the last version didn't start up if it didn't find an Arduino installation. So turbok had no change to set the correct location in the settings tab.

  2. #152
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,754
    luni,
    with the introduction of vtCore, I cannot anymore compile VisualTeensy
    gives me vtCore(unavailable) in the solution explores
    maybe because I'm using net4.7.2 (I use also the 4.7.2 dev pack)
    any advice?

  3. #153
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    I separated the GUI (project VisualTeensy) from the logic (vtCore.dll). vtCore.dll parses board.txt and generates makefiles, vscode.json etc.). Since vtCore doesn't contain a GUI it can easily be built platform independently. Therefore, it must not be linked against the full dotNet (which is Windows only) but against ".Net Standard 2.0" which is platform independent.

    For testing purposes the solution also contains a quick test app (project "DotNetCore Tester"). This app should run under Linux, Max and Windows without recompiling (to be tested).

    So, if you want to compile VisualTeensy you need to add the dotNetCore package to your VS2017 installation: In the VisualStudio Installer, go to workloads and add the "dotNet Core" package ("Plattformübergreifende .NET Core-Entwicklung", don't have a English installer). Make sure that dotNetCore 2.1 is selected in the details section.

    Let me know if this doesn't work.

  4. #154
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,754
    Quote Originally Posted by luni View Post
    Let me know if this doesn't work.
    reinstalled VS2017 with .net core and got it compiling
    Get still some error in execution from VS2017 (e.g Arduino15 not found).
    In my case "C:\Users\Walter\AddData\Local\Arduino15\packa ges"
    Last edited by WMXZ; 12-26-2018 at 06:13 PM.

  5. #155
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,920
    It's not "Arduino15", maybe? Take a look at C:\Users\Walter\AddData\Local\

  6. #156
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,754
    completely missed that directory but the file seems not be there. Continue debugging
    edit:
    it seems VisualTeensy is looking for two directories in Arduino15: packages and hardware.
    both are not in my installation.
    from date of file it seems only preferences.txt is recently accessed
    all other files 'package_index,...' are over one year old.
    may it be that I download only Arduino.zip and do use installation?
    Last edited by WMXZ; 12-26-2018 at 07:10 PM.

  7. #157
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    The IDE BoardManager creates that directory maybe only if some device is pulled down. Looking at mine there is only one thing there relating to nRF52 I pulled the other week (15Nov2018) on what is other wise a new machine where I never got ESP boards or other Board - being mostly Teensy specific. On my system all dates are that 15Nov date.

    So current IDE is still using that Arduino15 naming, just may not be populated for use.

  8. #158
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Sorry, was in a rush this morning. I did some experiments trying to use VisualTeensy to support all boards Arduino supports (via Arduino Builder). Therefore I scanned the Arduino15 folder which contains installed plattforms... This was experimental code and was supposed to be in the development branch. Shit happens... I'll clean that up tomorrow.

  9. #159
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Disabled the platform detection, should work again in master and development branches.

  10. #160
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,754
    Quote Originally Posted by luni View Post
    Disabled the platform detection, should work again in master and development branches.
    may need to commit to master?

    took from develop, compiles and runs.

  11. #161
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    The platform detection was only in develop. Master should be fine.

  12. #162
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,754
    Something to discuss:
    libraries:
    we have the following possible library locations
    - inside-sketch: "./lib"
    - inside-sketch-folders "$(sketchfolder)/libraries"
    - teensyduino libraries "$(arduinoroot)/hardware/avr/teensy/libraries"
    - Arduino libraries "$(arduinoroot)hardware/avr/arduino/libraries"
    At the moment teensyduino libraries are copied into sketch library

    Q: is it a good idea to copy 'standard' libraries to inside-sketch library? IMO, this would only make sense if I wanted to modify stock library.
    At least there should be an option 'link' or 'copy'

    I would suggest to keep all four library locations separate
    IMO:
    sketch library is sketch specific (e.g. for development, overriding all others)
    sketch-folder library is cross sketch
    teensyduino and Arduino libraries are 'fixed' for all users
    we can come-up with better and more intuitive path names

  13. #163
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    libraries:
    we have the following possible library locations
    - inside-sketch: "./lib"
    - inside-sketch-folders "$(sketchfolder)/libraries"
    - teensyduino libraries "$(arduinoroot)/hardware/avr/teensy/libraries"
    - Arduino libraries "$(arduinoroot)hardware/avr/arduino/libraries"
    At the moment teensyduino libraries are copied into sketch library
    Plus you have the libraries from the "Arduino repository". I currently download them directly from the net into the project :-)

    Q: is it a good idea to copy 'standard' libraries to inside-sketch library? IMO, this would only make sense if I wanted to modify stock library.
    At least there should be an option 'link' or 'copy'
    IMO: this always makes sense since it will keep projects independent from possibly breaking changes in later versions of a library. Disk space is somewhat irrelevant these days. But I am fully aware that most users prefer to use shared stock libraries. So, I agree that having that as the default option is a good idea. Currently only the libraries from "$(sketchfolder)/libraries" are shared, the others are copied into the project.
    Note: as soon as you allow more than one location for shared libraries the linker might get into troubles with "double" libraries so that needs to be handled in the generated makefile somehow... Having more than one location for shared libraries also needs changes to the libs section of the makefile I'm afraid. Maybe you find a more generic solution for that than the one currently implemented.

  14. #164
    Senior Member
    Join Date
    Nov 2012
    Posts
    141
    Quote Originally Posted by luni View Post
    I finally finished the first beta version of my project generator for VSCode and published it on GitHub: https://github.com/luni64/VisualTeensy. The repo contains a quick usage guide.
    Nice extension!

    Are you considering targeting macOS as well?

  15. #165
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Nice extension!
    Thanks

    Are you considering targeting macOS as well?
    As soon as there is some decent c# cross platform GUI...

    Meanwhile: I tried to separate the business logic from the GUI, so if you want to port it to macOS it shouldn't be too hard.

  16. #166
    Senior Member
    Join Date
    Jan 2015
    Location
    France
    Posts
    117
    Hello Luni,

    Thank you for this addon to VSC. I like it and will never go back to arduino IDE !

  17. #167
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Glad you like it. Once you got used to using a state of the art IDE like vscode it feels somehow sluggish to code with the Arduino IDE :-)

  18. #168
    Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    58
    Hi, I've just downloaded VisualTeensy and tried to use it unfortunately it will not run. Click image for larger version. 

Name:	Capture.PNG 
Views:	12 
Size:	10.1 KB 
ID:	21273 The pic shows the errors I received.
    I installed vsCode followed by the c/c++ extensions. Then executed VisualTeensy.exe in VisualTeensy_v0_9_7_3. That produced the output shown above.
    Bye the way what is the difference between VisualTeensy_v0_9_7_3 and VisualTeensy-master?

  19. #169
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Looks like you don't have Arduino / Teensyduino installed? It requires a few files from it.

  20. #170
    Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    58
    I had installed Arduino and Teensyduino before installing vsCode.
    I assumed that was a given so I did not mention it.

  21. #171
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Ok, I once had a similar issue with a fresh Arduino install. It looks like some of the required files (e.g. the huge list of Arduino libraries) are only generated at the first run. It probably doesn't find \AppData\Local\Arduino15\library_index.json. I recommend to first build a sketch with the Arduino IDE and use the Library manager once.

    Sorry, I definitely need to make that first start code more robust...

    -----------
    Edit: I just deleted my \AppData\Local\Arduino15 folder and get the same error as you. After starting Arduino once the IDE regenerates the folder and vsTeensy starts without issue but without the Arduino library list. Using the Arduino library manager once generates the missing library_index.json which gives you the Arduino library repository in vsTeensy.
    Last edited by luni; 08-04-2020 at 07:54 PM.

  22. #172
    Member
    Join Date
    Apr 2014
    Location
    Cheltenham, UK
    Posts
    58
    Yep, that worked fine. Thanks. Instead of altering your start up code, just change your Quick Start Guide.
    Bye the way what is the difference between VisualTeensy_v0_9_7_3 and VisualTeensy-master? I was initially confused as to which should be installed. But then there is no .exe in the master.

  23. #173
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    what is the difference between VisualTeensy_v0_9_7_3 and VisualTeensy-master
    Master is a Git thing. It is the branch of the source code which should compile into the currently released version. You only need to clone/download this if you want to compile yourself. VisualTeensy_v0_9_7_3.zip contains the binaries of this version.

    The net is full of tutorials for Git and GitHub. They can explain this stuff much better than I can. Just read into it if you are interested. If not, just download the binaries, unzip and you are done.

    Instead of altering your start up code, just change your Quick Start Guide.
    Yep, that's at least a quick win.

  24. #174
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Instead of altering your start up code, just change your Quick Start Guide.
    done (https://github.com/luni64/VisualTeen...ck-Start-Guide)

  25. #175
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,130
    Just released a new version of VisualTeensy which should be more robust regarding installation and first startup.

    To achieve this I removed the problematic dependency on the Arduino library index. This index is updated by the Arduino IDE whenever you start the library manager. Using the new version of VisualTeensy you can download the index directly from https://downloads.arduino.cc/librari...ary_index.json. Thus, you can update this file (see picture below) whenever you like. The index currently contains about 3500 libraries and is about 13Mb large. You can of course use the fast full-text search engine below the library list to quickly find the library you need.

    Here the link to the new binaries https://github.com/luni64/VisualTeensy/releases


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •