I compiled the CLI version of TeensyLoader v2.2 for linux (using Ubuntu 21.04). It compiled fine, it runs fine. But, it seems to have trouble actually flashing my board. I have a custom board with an M.2 socket for the Teensy MicroMod. I do have a button labeled "ERASE" that will trigger the proper functionality to boot into HalfKay.
Here is what it looks like when I try to do a CLI firmware flash:
collin@<mymachine>:$ ./teensy_loader_cli --mcu=TEENSY_MICROMOD -v -s -w GEVCU7.hex
Teensy Loader, Command Line, Version 2.2
Read "GEVCU7.hex": 272384 bytes, 1.6% usage
Error opening USB device: No error
Waiting for Teensy device...
(hint: press the reset button) <I pushed the ERASE button at this point>
Found HalfKay Bootloader
Read "GEVCU7.hex": 272384 bytes, 1.6% usage
Programming...error writing to Teensy
collin@<mymachine>:$ ./teensy_loader_cli --mcu=TEENSY_MICROMOD -v -s -w GEVCU7.hex
Teensy Loader, Command Line, Version 2.2
Read "GEVCU7.hex": 272384 bytes, 1.6% usage
Found HalfKay Bootloader
Programming.......................................................................................................................................................................................................................................................................
Booting
As you can see, first of all, it doesn't find the Teensy and wants me to push the button. I don't have to do this with the GUI TeensyLoader. It just plain works. Also, when I do push the button it fails immediately afterward. At that point a second run of the command will then flash the program and reboot.
So, my questions are:
1. Why does the GUI program automatically work but the CLI program needs help
2. Why does the CLI program fail the first time I push the button but then a second run works perfectly?
To answer the question of why I want this: I need to be able to have other people be able to easily flash these boards out in the field. The GUI program works but it requires that someone go find the HEX file, load it, and then be able to flash. The CLI should allow me to create a batch/script file and have people just click and go.
Here is what it looks like when I try to do a CLI firmware flash:
collin@<mymachine>:$ ./teensy_loader_cli --mcu=TEENSY_MICROMOD -v -s -w GEVCU7.hex
Teensy Loader, Command Line, Version 2.2
Read "GEVCU7.hex": 272384 bytes, 1.6% usage
Error opening USB device: No error
Waiting for Teensy device...
(hint: press the reset button) <I pushed the ERASE button at this point>
Found HalfKay Bootloader
Read "GEVCU7.hex": 272384 bytes, 1.6% usage
Programming...error writing to Teensy
collin@<mymachine>:$ ./teensy_loader_cli --mcu=TEENSY_MICROMOD -v -s -w GEVCU7.hex
Teensy Loader, Command Line, Version 2.2
Read "GEVCU7.hex": 272384 bytes, 1.6% usage
Found HalfKay Bootloader
Programming.......................................................................................................................................................................................................................................................................
Booting
As you can see, first of all, it doesn't find the Teensy and wants me to push the button. I don't have to do this with the GUI TeensyLoader. It just plain works. Also, when I do push the button it fails immediately afterward. At that point a second run of the command will then flash the program and reboot.
So, my questions are:
1. Why does the GUI program automatically work but the CLI program needs help
2. Why does the CLI program fail the first time I push the button but then a second run works perfectly?
To answer the question of why I want this: I need to be able to have other people be able to easily flash these boards out in the field. The GUI program works but it requires that someone go find the HEX file, load it, and then be able to flash. The CLI should allow me to create a batch/script file and have people just click and go.