NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET assemblies from NXP Flash Magic - connection issue

Solved!
Go to solution

Hi all

 

I'm trying to program the flash of an NXP LPC4357 microprocessor using Flash Magic. The software comes with documented .NET assemblies which I'm trying to utilize in TestStand. I can connect to the processor just fine, but when I run the next step of the sequence I always get an error saying that the port (COM1) is not open(?).

 

It looks like the .NET assembly doesn't know which port to use, or it simply closes the port right after opening it(?).

 

I'm unsure if this is a TS issue, or an issue with the .NET assembly (or just me ;-))

 

- Kim

 

Some pictures:

 

OpenPort.png


BlankCheck2.png

BlankCheck.png

0 Kudos
Message 1 of 4
(4,148 Views)

Do you have working code examples of the .NET assemblies in use? It might be a good idea to check those examples and be sure you are passing the information between function calls correctly--it looks like the calls to these functions are rather complex so it would probably be easy to overlook a parameter. You could also execute the examples to make sure your machine is able to connect to the processor and continue to communicate with it.

 

From the TestStand perspective, one thing that could affect this is the module load and unload options. For every TestStand code module (such as a .NET assembly) you can configure when that module is loaded into memory and when it is unloaded. This setting is available for each individual step (on the Run pane of the Step Settings) and on a sequence file level (Edit > Sequence File Properties). The default is to load modules when execution begins and unload when the sequence file is unloaded. That setting is what I would assume would work properly for this use case. If you have changed the setting (in either place) to unload the module after a step executes, I could imagine that causing issues. This would cause the .NET assembly to unload as soon as a step executes, which would likely break the connection with the hardware.

 

I hope this helps, and let us know how the troubleshooting goes.

0 Kudos
Message 2 of 4
(4,134 Views)
Solution
Accepted by topic author teknik_kim

One issue is that you are recreating the FlashMagic object at each step. You should probably just create it once and store it in a local object reference variable and then on subsequent calls instead of using the constructor as the first call, use the "Use Existing Object" call and specify the local object reference variable which stores the object you already created.

 

Basically, if there is any state stored in the .NET class object you are losing that state by recreating the object on each call.

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 4
(4,125 Views)

Hi

 

You are right, I was recreating the object at each step. I had simply overlooked where to specify that the step should use an existing object (which conveniently is the same place as the classes are selected).

 

0 Kudos
Message 4 of 4
(4,079 Views)