From c2c9b4aa540766f830f75c0bee180cbc2268a1a2 Mon Sep 17 00:00:00 2001 From: Geert Bevin Date: Sun, 26 Oct 2014 10:56:23 +0100 Subject: [PATCH] Wrote more complete README. Added some code comments. --- README.md | 10 +++++++++- Source/LinnStrumentSerialMac.cpp | 2 +- Source/LinnStrumentSerialWindows.cpp | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 096e6f2..e4bfcb6 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,12 @@ LinnStrument Firmware Updater This is a GUI tool written in Juce to easily update the firmware of a LinnStrument. -The firmware update file should be alongside the updater application and will be automatically detected. \ No newline at end of file +The firmware update file should be placed alongside the updater application and will be automatically detected. + +To get this .bin file, go to the Arduino IDE preferences and enable "Show verbose output during: compilation". Then, when you press the Verify button (the left-most) when the linnstrument-firmware sketch is open, it will compile the firmware and the before-last line will end with something like: /var/folders/nz/x2b_qbpj6j94wjq9jf8r1sx00000gn/T/build8779920126312548776.tmp/linnstrument.cpp.bin. This is the location of the compiled firmware. Copy the .bin file from there to the folder with the LinnStrument Updater and give it a name like linnstrument-firmware-103.bin. This name isn't necessary per-se, it will work with any .bin file for convenience, but it is a nice naming scheme to adopt. + +On Windows, the compiled executable expects a 'tools' directory alongside it with the 'bossac.exe' binary. This is needed to perform the actual firmware update with a standard tool. The Visual Studio build steps will automatically create this in the build directories, just make sure to correctly more the 'tools' directory with 'LinnStrument Updater.exe'. + +Thanks to Tod E. Kurt (http://todbot.com/blog/) and his usbSearch project for inspiration of how to detect Arduino devices: https://github.com/todbot/usbSearch + +The bossac tool was copied from the Arduino IDE distribution and was created by ShumaTech http://www.shumatech.com/web/products/bossa \ No newline at end of file diff --git a/Source/LinnStrumentSerialMac.cpp b/Source/LinnStrumentSerialMac.cpp index b73cd95..1f27771 100644 --- a/Source/LinnStrumentSerialMac.cpp +++ b/Source/LinnStrumentSerialMac.cpp @@ -53,7 +53,7 @@ bool LinnStrumentSerialMac::detect() else { String output = detectionChild.readAllProcessOutput(); - int indexBegin = output.indexOf("LinnStrument SERIAL"); + int indexBegin = output.indexOf("LinnStrument SERIAL"); // Look for a serial device named "LinnStrument SERIAL" if (-1 == indexBegin) { std::cerr << "No LinnStrument serial device found" << std::endl; diff --git a/Source/LinnStrumentSerialWindows.cpp b/Source/LinnStrumentSerialWindows.cpp index b200638..ac1db54 100644 --- a/Source/LinnStrumentSerialWindows.cpp +++ b/Source/LinnStrumentSerialWindows.cpp @@ -67,7 +67,9 @@ bool LinnStrumentSerialWindows::detect() char* match; dhGetValue(L"%s", &name, objDevice, L".Name"); dhGetValue(L"%s", &pnpid, objDevice, L".PnPDeviceID"); - if (name != NULL && ((match = strstr(name, "(COM")) != NULL) && strstr(pnpid, "VID_F055&PID_0070") != NULL) + if (name != NULL && + ((match = strstr(name, "(COM")) != NULL) && // only use COM ports + strstr(pnpid, "VID_F055&PID_0070") != NULL) // only use a COM port that has the vendor and product ID of LinnStrument { char* comname = strtok(match, "()"); linnstrumentDevice = String(comname);