Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - smercurio

#1
Thanks for the tip. That certainly simplifies the parsing! ;)
#2
Ah, so it is due to the version number. OK, that makes sense.

I'll forward this information to my engineering manager. For the time being, so we can do our initial checkout of our autotest software, I added a step in the LabVIEW code to call USBManager.exe and parse out the serial number from USBManager's output. I then pass this into the constructor of our custom library. With that, the whole process works as it does with the Flash Magic application. Long term we will need to update our Flash Magic software.

Thanks for verifying it's a version number issue.
#3
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.
#4
Thanks for the response. I tried setting the interfaceserialnumber field to an empty string, but it still returns the "Unable to communicate. Serial number not found" error. If I set that field to the actual serial number (as displayed in the GUI version or from the USBManager.exe output), then it works as expected.

As I noted, we're using v10.60. Does the setting of the interfaceserialnumber field to an empty string only work on newer versions than that?
#5
General / Using Production System NET and SWD over Link2
November 10, 2017, 08:25:10 AM
We previously used Production System NET to program LPC1769 chips over a serial interface. This go-around, due to the design, we can't use the serial port, so we have to switch to using SWD over Link2. We are using Production System NET v10.60. While the stand-alone Flash Magic application works when "SWD over Link2" is selected, we can't get the .NET libraries to work.

The first problem is that the interface looks for USBDriver.dll. This is not mentioned in any of the documentation. This DLL needs to be placed in C:\Windows\System32 on 32-bit systems and C:\WINDOWS\SysWOW64 on 64-bit systems. Placing it in the same directory where the other DLLs (FlashMagicARMCortex.dll, etc) doesn't work.

Once you get that straightened out, the Connect function throws an error: "Unable to communicate. Serial number not found". I have no idea what serial number it's looking for. If it's for the LPC1769, it's not going to find one, since as far as I know, it doesn't have one. Is there something else that needs to be done to get SWD over Link2 to work with Production System NET?