luni
Well-known member
Hello all,
I'm currently working on a commercial project which will include a Teensy 3.1. As discussed a few times in the forum for many applications it is desirable to upload new firmware from within windows applications. I therefore wrote a little easy to use C# library which handles uploads to Teensy boards. For the protocol I used the algorithms from the Teensy_Loader_CLI. Communication with the board is done via Mike O'Brians HIDLibrary (https://github.com/mikeobrien/HidLibrary). The lib is published it at GitHub (https://github.com/luni64/TeensySharp, VS2013 Solution).
The usage is quite simple. Below you find some pseudo code showing the idea. A working test app is included in the repo
The Lib works nicely for T3.1. I don't have other Teensies so I couldn't test it for those boards. Any feedback, test results and improvement suggestions welcome
Have fun
Lutz
I'm currently working on a commercial project which will include a Teensy 3.1. As discussed a few times in the forum for many applications it is desirable to upload new firmware from within windows applications. I therefore wrote a little easy to use C# library which handles uploads to Teensy boards. For the protocol I used the algorithms from the Teensy_Loader_CLI. Communication with the board is done via Mike O'Brians HIDLibrary (https://github.com/mikeobrien/HidLibrary). The lib is published it at GitHub (https://github.com/luni64/TeensySharp, VS2013 Solution).
The usage is quite simple. Below you find some pseudo code showing the idea. A working test app is included in the repo
Code:
var Board = PJRC_Board.Teensy_31; // all boards implemented but only Teensy 3.1 tested so far
var FlashImage = SharpUploader.GetEmptyFlashImage(Board); //Get an empty flash image with the correct size and all bytes cleared (i.e. set to 0xFF)
// Open the hex file, parse it and write the result into the image file
var HexStream = File.OpenText(testfile);
SharpHexParser.ParseStream(HexStream, FlashImage);
// Upload the image to the board and reboot
int result = SharpUploader.Upload(FlashImage, Board, reboot: true);
The Lib works nicely for T3.1. I don't have other Teensies so I couldn't test it for those boards. Any feedback, test results and improvement suggestions welcome
Have fun
Lutz
Last edited: