Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Loading .hex file into Teensy 3.6

  1. #1
    Junior Member
    Join Date
    Jun 2018
    Posts
    2

    Loading .hex file into Teensy 3.6

    I've got a device that I have a customer using. If I am in MSVS Community with vMicro installed, I can do a build and upload (without pressing the manual button). vMicro is able to use the Teensy loader to load an image. However, with just the Teensy Loader I can't figure a way to do this without pushing the button. Obviously, I would prefer to not send the source code to the customer.

    Is there an equivalent executable which would do the same thing as vMicro or is there another app that would be able to accomplish the same thing?

    Thanks for any help

  2. #2
    Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    86
    YES, you can load a *.HEX file from windows. I bought a DIY thermocam from GroupGets and there were instructions on how to do it. Sorry, but is has been awhile since I did this, so can't give specifics.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,262
    Yes, all you need is Teensy Loader. Get it here:

    https://www.pjrc.com/teensy/loader.html

    Run it, and click File > Open HEX File. Like this:

    Name:  sc.png
Views: 265
Size:  51.3 KB

    Then press the button on your Teensy. The Teensy Loader window will change, and the toolbar button to program the board will activate. Click it and your code will get written to the Teensy. Easy stuff!

  4. #4
    Junior Member
    Join Date
    Jun 2018
    Posts
    2
    I have Teensy Loader... and can definitely load a .hex that way. I did a whole bunch of devices like that.

    In MSVisualStudio using the vMicro plugin I can connect the USB... then do Upload Last Build. The plugin then puts the Teensy in loader mode and uploads the compiled project. So you don't have to press the button (unless you really screw something up - like loop to fast or something like that). Works most of the time, or you can recover by rebooting everything (PC, Teensy, Hubs)

    Since vMicro knows what the USB command is to put the Teensy into Loader Mode, I was wondering if someone had an app that basically just issued that command.

    -As I was thinking about this... if there isn't a command on the Teensy side... is it possible vMicro has added something to the serial handler?

  5. #5
    Senior Member
    Join Date
    Nov 2015
    Posts
    170
    Is it possible to customize the graphics of the loader?

  6. #6
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,028
    But the OP says
    Quote Originally Posted by Sully View Post
    However, with just the Teensy Loader I can't figure a way to do this without pushing the button.
    This more to Paul

  7. #7
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    4,017
    Quote Originally Posted by Sully View Post
    However, with just the Teensy Loader I can't figure a way to do this without pushing the button. Obviously, I would prefer to not send the source code to the customer.

    Is there an equivalent executable which would do the same thing as vMicro or is there another app that would be able to accomplish the same thing?
    I can think of a few different options to try:

    a) When Teensy installs on Arduino it installs the Teensy program as well, as a reboot and reset program: Look in your Arduino install/hardware/tools directory for these.

    b) You could try using the Teensy Command line stuff for this. More information up at: https://www.pjrc.com/teensy/loader_cli.html

    c) You can trying using the TyCommander and related tools: https://github.com/Koromix/tytools

  8. #8
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,262
    Quote Originally Posted by Sully View Post
    I was wondering if someone had an app that basically just issued that command.
    You probably want TEENSY_REBOOT.EXE. It's default install location is C:\Program Files (x86)\Arduino\hardware\tools.

    It's a command line utility. Normally it talks to Teensy Loader, to make sure auto mode is set and the verify Teensy Loader saw a board appear. To run it in stand-alone mode, where it just sends the request in a "fire and forget" kind of way, add a "-s" flag.

    As with Arduino (which just runs this utility) the automatic reboot only works if Teensy is still properly running USB code. If your program does something like noInterrupts() in setup() and then a tight loop where nothing runs that turns interrupts back on, then no USB communication is possible. Teensy won't be able to hear the request and reboot. Every Teensy is made with a pushbutton for exactly this reason - if your code crashes and USB is off, the button is the only way to recover.

    But if your code is still running properly, that TEENSY_REBOOT.EXE program will do the trick.

Posting Permissions

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