Teensy Loader Win10 binary and VS2019 Project

dbuergin

Member
Hi guys,

Since i was too stupid to find an actual binary of teensy_loader_cli.exe for Win10, i've compiled my own one.

Attached is my Visual Studio 2019 project with the binary in .\x64\release dir.

To use that project, you have to (https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk)
- Install Visual Studio Code 2019 (obviously...)
- Outside VS2019 install SDK and WDK as new as possible
- Open VS2019 with the solution attached
- Check that you have "Release" in the build settings on top and "x64" and click "Build"
- You should have teensy_loader_cli.exe in the .\x64\Release dir

Changes in the source of teensy_loader_cli.c:

Code:
// #include <unistd.h>
#include <process.h>

#pragma comment( lib,"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64\\hid.lib")
#pragma comment( lib,"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64\\setupapi.lib")
#pragma comment( lib,"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64\\winmm.lib")

The #pragmas are because it didn't work for me to add the libs to the project settings. So you will have either to solve the issue with adding the additional libs to the project settings or change the path in the pragmas to your lib location.

Daniel
 

Attachments

  • teensy_loader_cli_VS2019.zip
    126.5 KB · Views: 213
Last edited:
Thanks a lot - it was very helpful!
however , I am trying to also upload without pressing the program button , is it possible?
 
Thanks a lot - it was very helpful!
however , I am trying to also upload without pressing the program button , is it possible?

I got my Teensy today, and after the first verification I just press upload and it loads automatically, even if the image says "Press Button on Teensy..."

@dbuergin thank you
 
I managed to build teensy_loader_cli using VS2019, thanks for the above guidance. I am wondering, is there a version that can do a Teensy4.1 soft_reboot on Win32? Thank you
 
Compiling Issues (Windows 10 x64 Ent LTSC)

Hi guys,

Since i was too stupid to find an actual binary of teensy_loader_cli.exe for Win10, i've compiled my own one.

Attached is my Visual Studio 2019 project with the binary in .\x64\release dir.

To use that project, you have to (https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk)
- Install Visual Studio Code 2019 (obviously...)
- Outside VS2019 install SDK and WDK as new as possible
- Open VS2019 with the solution attached
- Check that you have "Release" in the build settings on top and "x64" and click "Build"
- You should have teensy_loader_cli.exe in the .\x64\Release dir

Changes in the source of teensy_loader_cli.c:

Code:
// #include <unistd.h>
#include <process.h>

#pragma comment( lib,"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64\\hid.lib")
#pragma comment( lib,"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64\\setupapi.lib")
#pragma comment( lib,"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.19041.0\\um\\x64\\winmm.lib")

The #pragmas are because it didn't work for me to add the libs to the project settings. So you will have either to solve the issue with adding the additional libs to the project settings or change the path in the pragmas to your lib location.

Daniel


Hello. I know this post is getting old but I am having issues getting this to compile on Windows. I have installed quite a few different things to allow VSC2019 and make and all the other CLI tools to get to the point where I can use the make command but it gives me this error. I have tried this with your files and the ones provided by PJRC with the same issue. I do not know what I am doing wrong. Any suggestions would be helpful. I am having the issue where my RTC keeps resetting every time I unplug it or plug it back in. It was working for a little bit and I thought I had found a work around for their Teensyduino software but it stopped working after a 2 or 3 times. Now my RTC does not keep time at all and keeps resetting back to the parameters I have in the setTime() function. In void setup I have it check timeStatus() and if its != 2, it sets the time to what I have / had set in setTime(). I just need to upload the sketch without it trying to update the time because it does not work as they intended. I have been pulling my hair out for weeks trying to get the internal RTC to work and about 3 days trying to get the CLI loader to work without the auto time set function that does not work. Any help would be greatly appreciated.

This is with your files:

C:\Users\OMITTED\Desktop\teensy_loader_cli>make
rm -f teensy_loader_cli teensy_loader_cli.exe*
process_begin: CreateProcess(NULL, rm -f teensy_loader_cli teensy_loader_cli.exe*, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:59: clean] Error 2


And this is with the master files:

C:\Users\OMITTED\Desktop\teensy_loader_cli-master>make
rm -f teensy_loader_cli teensy_loader_cli.exe*
process_begin: CreateProcess(NULL, rm -f teensy_loader_cli teensy_loader_cli.exe*, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [Makefile:59: clean] Error 2
 
Sorry, but if you struggeling at this point, the whole process will be a loooong journey for you :)
The error message above means you have no "rm" tool in your local directory or in you PATH variable. rm is the default "delete file" tool on unix and does normally not exist on a windows machine.
You can avoid that by jumping into the MINGW world and install the tools from there. Or if you have done that already, you have to learn how to use them, for example: https://opensource.com/article/20/8...nstall GCC, click the,of the mingw-get window.
 
Sorry, but if you struggeling at this point, the whole process will be a loooong journey for you :)
The error message above means you have no "rm" tool in your local directory or in you PATH variable. rm is the default "delete file" tool on unix and does normally not exist on a windows machine.
You can avoid that by jumping into the MINGW world and install the tools from there. Or if you have done that already, you have to learn how to use them, for example: https://opensource.com/article/20/8...nstall GCC, click the,of the mingw-get window.



I do not have much Linux experience but did know the rm was delete file, my issue is trying to get that stuff to work on windows since I don't have a spare machine to install Linux on.
 
Well I have struck out again with the 2 methods suggested by KurtE and BriComp. For whatever reason I could not figure out what the pull request page is or if there is a download in it (again very novice) but downloaded something, probably the master again for the 4th time lol, and it did not work. As far as trying it with VisualMicro in Visual Studio, today was my first time ever touching Visual Studio and had to look up a few videos to get VisualMicro to install but for whatever reason it says its incompatible and would not load it, not sure if that is because I downloaded VS Code rather than just regular VS. I also tried the MinGW, installed Choco and Git for make functions, both Windows SDK and WDK packages, and also tried TyTools with no luck. I might look around for a cheap laptop I can run Linux and Arduino on to test it again in a more native environment. At this point my autism is starting to really strain me with this and I might put it on the back burner for a while and just wait for an updated Teensyduino program to be pushed out or maybe some internal RTC work is done. I know they have a billion other things on their plate and my one thing on my plate is highly insignificant to everything else. I do appreciate the fast responses from those who offered help. I have favorited this post in my main folder so I will see it every time I use the internet and will post if I figure anything out or if I find a different method or learn how to do it properly. Again thanks to everyone who quickly offered help.
 
VisualMicro to install but for whatever reason it says its incompatible and would not load it, not sure if that is because I downloaded VS Code rather than just regular VS.
It needs the FULL Visual Studio.
 
while it is great to be able to compile and mod yourself i do not understand why there is no exe to be found. best with all required files in an installer.
i tried mingw but then it need msys2 while i have msys and msys2 can not work on my pc.
then i found an exe somewhere but that complaints about lib-usb-0-1-4.dll while i have newer libusb installed.
i do not want to make my pc unstable by intalling loads of software to find out there is always some other problem.

so best is to have an installer. Or is that something the "C people" (no disrespect) do not like? there is probably tons of good reasons but i see none, not to also share the build exe with a signature.
i can spend a lot of time to get it going but looking at the code i best rewrite it to delphi which will take less hours.
but to get some reference it would be nice to have a working exe file :)
for now i simpy try the rebootor since that seems really easy in delpi.
 
Back
Top