I created a .NET library to act as an intermediary between LabVIEW and the FlashMagic library. This was done because the LabVIEW code was still using LabVIEW 8.2, which didn't always work all that well with third-party .NET assemblies, especially with callbacks. The .NET library I wrote does the process of downloading the firmware file using the Flash Magic .NET library. In the solution I have a test application that's just a simple form to provide the hex file to download, a textbox for displaying status, and a button to test erasing of sectors. This test application is used so I can test our custom library's operations directly in Visual Studio. We've since updated to LabVIEW 2017, but I have not changed the LabVIEW code yet - i.e., it's still using the intermediary .NET library.
In the constructor of this custom library I set the COM options:
public LPC1769(string comPortIn, string link2SerialNumberIn)
{
this.comOptions.baudrate = 19200;
this.comOptions.clocks = 0;
this.comOptions.flashbank = 0;
this.comOptions.halfduplex = 0;
this.comOptions.highspeed = 0;
this.comOptions.hwconfig = HardwareConfigurations.BOOTEXEC;
this.comOptions.hwt1 = 240;
this.comOptions.hwt2 = 120;
this.comOptions.interfacetype = Interfaces.SWDLINK2;
this.comOptions.maxbaudrate = 115200;
this.comOptions.osc = 14.748;
this.comOptions.port = comPortIn;
this.comOptions.postopendelay = 0;
this.comOptions.protocoloptions = ProtocolOptions.AUTOLF;
this.comOptions.selecteddevice = Devices.LPC1769;
this.comOptions.usinginterface = 0;
this.comOptions.interfaceserialnumber = link2SerialNumberIn;
}
As I noted, if link2SerialNumberIn is set to an empty string, I get the "Unable to communicate. Serial number not found" error when the Connect() method is called. This occurs with the .NET test application as well, since it's simply using the LPC1769 library. If I set link2SerialNumberIn to the serial number of the LPC Link-2 device (s3fUQ6uY9uk6 in our case), then it works (both in the .NET test application as well as from LabVIEW).
As for the version number, the value that's returned is 7.85.4776.