teensy_loader_cli executable for windows?

It probably would build on 2019 as well...

The RAWHID stuff was done on 2019

It was asking for some specific 1.45 (?) tool pack. Rather than see if an update would grab it (or it could be found) - the Install of VS2022 Enterprise is done - ready for a reboot
 
Didn't restart yet - opened and build gave this:
Code:
Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol __imp_SetupDiGetDeviceInterfaceDetailW referenced in function open_usb_device	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK2019	unresolved external symbol __imp_timeGetTime referenced in function teensy_write	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK2019	unresolved external symbol __imp_SetupDiDestroyDeviceInfoList referenced in function open_usb_device	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK2019	unresolved external symbol __imp_SetupDiEnumDeviceInterfaces referenced in function open_usb_device	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK2019	unresolved external symbol __imp_SetupDiGetClassDevsW referenced in function open_usb_device	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK2019	unresolved external symbol HidD_GetAttributes referenced in function open_usb_device	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK2019	unresolved external symbol HidD_GetHidGuid referenced in function open_usb_device	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\hid_Windows.obj	1	
Error	LNK1120	7 unresolved externals	Teensy_loader_cli	D:\Tim\downloads\Teensy_loader_cli\x64\Debug\Teensy_loader_cli.exe	1

>> same after restart of course
 
Not right now I am building for Debug x86
I am not sure if x64 can build.

If you open properties on project:
Go to linker/Input section

The Additional Dependencies: hid.lib;setupapi.lib;winmm.lib;%(AdditionalDependencies)
 
Kurt - works to build fine as x86:
Code:
D:\Tim\downloads\Teensy_loader_cli\Debug>Teensy_loader_cli.exe
Filename must be specified

Usage: teensy_loader_cli --mcu=<MCU> [-w] [-h] [-n] [-b] [-v] [-f] <file.hex>
        -w : Wait for device to appear
        -r : Use hard reboot if device not online
        -s : Use soft reboot if device not online (Teensy 3.x & 4.x)
        -n : No reboot after programming
        -b : Boot only, do not program
        -v : Verbose output
        -f : Fill memory region holes with 0s
        -d : dump hex file memory ranges
 
Quick update: I reworked the setup, such that the Visual Studio builds using the same .c file as used in the makefile

I then added the external stuff into that source file. And it appears to build again.

I then pushed these changes up to my Fork/Branch: https://github.com/KurtE/teensy_loader_cli/tree/experiments

Will see if this is something I should issue a Pull Request back to Paul or not...

note: My experiments branch code has two extra options:
-d (Dumps the address ranges within the hex file)
-f (Tries to fill in holes between areas within hex file)

Some of my changes were to make Windows happier, to use things like sscanf_s instead of sscanf but Linux did not like ssconf_s so made all of these use: SSCANF
which I defined depending on this or not.
 
@KurtE - Teensy_loader_cli.sln works to build setting Debug x86:

Code:
Usage: teensy_loader_cli --mcu=<MCU> [-w] [-h] [-n] [-b] [-v] [-f] <file.hex>
        [B][COLOR="#FF0000"]Hello World - Defragster was here![/COLOR][/B]
        -w : Wait for device to appear
        -r : Use hard reboot if device not online
        -s : Use soft reboot if device not online (Teensy 3.x & 4.x)
        -n : No reboot after programming
        -b : Boot only, do not program
        -v : Verbose output
        -f : Fill memory region holes with 0s
        -d : dump hex file memory ranges

Didn't try an upload - but minor source edit built, and shows in usage output!

Using Win 11 and up to date MSFT Visual Studio 2022
If WDK was needed - it was resident from VS 2019 install
 
Old thread... but the easiest way to to get the compiled teensy_loader_cli for your OS is to use PlatformIO, install the Teensy board and then get the file out of it. The paths:

Linux: `$ENV{HOME}/.platformio`
Windows `$ENV{USERPROFILE}/.platformio`

and then the folder `.platformio\packages\tool-teensy`.

I attached it here if you are lazy.
 

Attachments

  • teensy_loader_cli.zip
    8.8 KB · Views: 12
Last edited:
Back
Top