Forum Rule: Always post complete source code & details to reproduce any issue!
Page 6 of 6 FirstFirst ... 4 5 6
Results 126 to 147 of 147

Thread: Compiling Teensy Sketches with VisualCode (Win10)

  1. #126
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306

  2. #127
    Yep !

    [HEX] bin\visual_teensy_testproj.hex
    text data bss dec hex filename
    40924 3476 34044 78444 1326c bin\visual_teensy_testproj.elf
    Sucessfully built project

    That worked. Thanks for the fix!

  3. #128
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    Perfect, let me know if you find other issues or things to improve.

  4. #129
    Maybe another small issue? :

    The std uploader seems to work fine. However when I run Terminal/Run Task/Upload(TyCommander):

    Code:
    > Executing task: C:/Users/user2/Documents/VisualTeensy_V0.84/make.exe uploadTy -j -Otarget <
    I get this error:

    Code:
    process_begin: CreateProcess(NULL, \tyCommanderC upload bin\visual_teensy_testproj.hex --autostart --wait --multi, ...) failed.
    make (e=2): The system cannot find the file specified.
    make: *** [makefile:154: uploadTy] Error 2
    The terminal process terminated with exit code: 1
    The file is there for sure.

    When I run it from Terminal/Run Build Task/Upload(TyCommander):
    Then it works. It seems to be two Menus under Terminal (Run Task and Run build task).

  5. #130
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    Did you set the path to the TyTools correctly (settings tab). You can check in the generated makefile. The variable UPL_TYCMD_B should be set to your TyTools folder

    Code:
    #******************************************************************************
    # Generated by VisualTeensy (https://github.com/luni64/VisualTeensy)
    #
    # Board              Teensy 3.2 / 3.1
    # USB Type           Serial
    # CPU Speed          96 MHz (overclock)
    # Optimize           Faster
    # Keyboard Layout    US English
    #
    # 10.11.2018 17:25
    #******************************************************************************
    SHELL            := cmd.exe
    export SHELL
    
    TARGET_NAME      := newProject
    BOARD_ID         := TEENSY31
    
    LIBS_SHARED_BASE := C:\Users\lutz\Documents\Arduino\libraries
    LIBS_SHARED      := 
    
    LIBS_LOCAL_BASE  := lib
    LIBS_LOCAL       := 
    
    CORE_BASE        := C:\PROGRA~1\Arduino\ARDUIN~1.5\hardware\teensy\avr\cores\teensy3
    GCC_BASE         := C:\PROGRA~1\Arduino\ARDUIN~1.5\hardware\tools\arm
    UPL_PJRC_B       := C:\PROGRA~1\Arduino\ARDUIN~1.5\hardware\tools
    UPL_TYCMD_B      := C:\toolchain\TyTools
    UPL_CLICMD_B     := 
    ....

  6. #131
    Errrr..... ok so I havent installed TyTools it appears .... LOL

  7. #132
    How do I get a serial debug terminal via USB when using VisualTeensy / VisualStudioCode?

  8. #133
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,056
    It's all included in TyTools...

  9. #134
    How can I make a keyboard shortcut so that when I press for example SHIFT+F10 the Terminal/Run Build task / Upload (Teensy Uploader) is run.

    I would like to avoid having to use the mouse to go into that menu every time.

  10. #135
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    CTRL+SHIFT+B opens the "Terminal/Run/Build Task" menu. The menu remembers the last selection. So after the first time all you have to do is "CTRL+SHIFT+B RETURN" to trigger a rebuild followed by an upload. No need for the mouse at all.

  11. #136
    I just want to thank you so much for this great toolchain!

    Getting rid of that sucky Arduino IDE was a big relief. And being able to see the .h files and have an editor with .cpp on the left and .h on the right or pressing Alt+O to swap to the header is great. Now coding Arduino / Teensy is fun!

    You should really spread the word and possibly get support from Paul Stoffregen to try to have more people use this toolchain.

    The only thing missing now is a proper debugger integrated in the toolchain.

  12. #137
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306

    VisualTeensy for Sublime

    Just tried to compile a existing VisualTeensy generated project with Sublime and it works nicely :-) If anyone is interested in a quick experiment you can do the follwing steps:

    1) copy the code below in a file called "test.sublime-project" in the root folder of the project and open it with Project | open Project
    2) adjust the path to make.exe in this file
    3) In Tools | Build System select VisualTeensy Build

    Then a CTRL+SHIFT+B should open a menu where you can select from build, clean, and upload

    Here a very first proof of principle build-system:

    Code:
    {
    	"folders":
    	[
    		{			
    			"path": ".",
    		}
    	],
    	"build_systems":
        [
            {   
            	"name":"Visual Teensy - Build",
            	"working_dir": "${project_path}",         
            	"shell_cmd": "c:\\toolchain\\make\\make -f${project_path}\\makefile all",
                "variants": [            
                {
                 	"name": "Clean",
                 	"shell_cmd": "c:\\toolchain\\make\\make -f${project_path}\\makefile clean",
                 },
                 {
                   "name": "Upload",
                   "shell_cmd": "c:\\toolchain\\make\\make -f${project_path}\\makefile uploadTy",
                 }
              ]
            }
        ]
    }

    Click image for larger version. 

Name:	sublime.jpg 
Views:	7 
Size:	70.3 KB 
ID:	15140

    Could add a "Sublime Option" in VisualTeensy if anyone is interested.

  13. #138
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,744
    Since I don't like makefiles and fiddling/copying with libraries in Arduino (hey, that's my personal preference, not your problem! - really, please don't feel offended! ), I'd like an option to use the Arduino-Builder more - and it is more compatible - works out of the box with existing projects. It's easy - here's a dumb batch that does it: https://forum.pjrc.com/threads/27825...l=1#post190940

  14. #139
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    Yes, I've seen that post and thought: "since I don't like the Arduino Build system I'll stick with my makefiles!" "Dem ein' sin Uhl is dem annern sin Nachtigall" as they used to say :-) It is always good to have more than one option, and most of the users will be just happy with the Arduino Builder I'm sure.

    Anyway, I'm not : https://forum.pjrc.com/threads/53604...l=1#post188069 But: hey, that's my personal preference, not your problem! - really, please don't feel offended! :-)

  15. #140
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,744
    no Problem

  16. #141
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,052
    I like SublimeText - though just installed Eclipse for another project. I trust the Arduino Build system to work as long as Paul and PJRC are making Teensy. With ZIP installs the prior version is unchanged when new version of anything drops as it goes to a new directory - and copies of the old installers will still work to recreate when it does break in Beta … or versions after. A full IDE/TDuino install is under 700 MB { half that for the installers } and the libraries needed.

    Also Frank_B shows how the Arduino build system can be run in place with a Batch file - which is cool since I'm on Windows I've not looked into Sublime to see if it might have a way to spawn that - but that would still leave the settings to be managed ...

  17. #142
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    Taking up Franks idea to use the arduino-builder instead of makefiles I added an option to VisualTeensy which generates vsCode projects using the arduino builder as build system. You can select the corresponding option on the settings tab.

    Click image for larger version. 

Name:	builder1.PNG 
Views:	12 
Size:	51.6 KB 
ID:	15207
    As always, you can use the comboboxes to select board, usb type and the other teensy settings. File|Save generates / updates the vsCode project


    The generated tasks.json now directly calls arduino builder.
    Click image for larger version. 

Name:	builder2.PNG 
Views:	12 
Size:	71.1 KB 
ID:	15209

    This is a little bit experimental at the moment but it already works nicely :-)
    CTRL+SHIFT+B in vsCode opens the build task menu with the build and upload commands. The output messages of the arduino builder are a bit messy but I currently don't see how to improve that.

  18. #143
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,744
    Great I'll try it tomorrow.
    What means messy output? Same as in Arduino? :-)

  19. #144
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306
    What means messy output? Same as in Arduino? :-)
    Sort of, I didn't find out yet how to switch of word wrapping in the output window of vsCode which makes it even worse :-/

    I somehow prefer the clean output of my makefiles :-)

    Click image for larger version. 

Name:	builder3.PNG 
Views:	14 
Size:	28.2 KB 
ID:	15210

  20. #145
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,744
    hm . word wrapping makes it more difficult to see errors or warnings. can you redirect stderr, and show it if the builder exits with return codes>0? the atom plugin I use does it this way, and opens a nice window with the text of stderr.

  21. #146
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    306

    Support for ATOM and Arduino-Builder

    New features in v.0.9.0

    • Additionally to vsCode, VisualTeensy now supports the ATOM editor as alternative target editor.
    • For those who like builds as close to the Arduino IDE as possible I implemented Frank's Arduino-Builder idea as alternative build system


    Repository and download: https://github.com/luni64/VisualTeen...ases/tag/0.9.0

    Usage
    In vsCode the key combination ctrl-shift-b opens the standard vsCode build menu where the required build action (build, clean, upload-PJRC upload-TyTools) can be selected. In ATOM a VisualTeensy menu with the corresponding build entries is generated automatically. Please note: ATOM requires the process-palette package installe to work with VisualTeensy. (https://atom.io/packages/process-palette).

    Both, target IDE and build system can be selected on the setup tab. A simple File|Save automatically generates (or updates) the corresponding project folder for the target IDE.

    Click image for larger version. 

Name:	atom.PNG 
Views:	3 
Size:	9.6 KB 
ID:	15237

  22. #147
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,052
    Very cool … looking forward to trying it out.

Posting Permissions

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