LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a segger's flasher 5 programmer in labview

Solved!
Go to solution
I want to use labview to send and receive commands to a Flasher 5 programmer made by Segger.  It comes with ASCII command sets, and I was unsucessful in getting the return information using the basic serial read and write, labview example, error states that is timeout on the read.  When you send a AUTO  command the programmer is suppose to erase, program and verify the microcontroller, in which it sends back response when it completes each step.  The port is setup correctly, because when the auto command is sent, the programmer lights blink, but having problems with the read.  Anyone familiar with this particular programmer and could give me some pointers, it would be much appreciated.
0 Kudos
Message 1 of 8
(8,052 Views)

Hi there

 

In case you are really really sure that the port is setup correctly (thats the most common reason for such problems) then there is propably something wrong in the LV code. Please post some code here so we can take a look.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
Message 2 of 8
(8,009 Views)

I was using the basic serial read and write in the labview examples, so its a common VI, the issue was getting the response back from the programmer.  Listed below is the command set when using the programmer in serial mode.

 

 #AUTO
The Auto command behaves exactly as the start button or external remote control input.
·    Flasher starts clearing target, if “automatic clear before program“ option was set.
·    Flasher programs target CPU
·    Flasher verifies target CPU
·    Flasher verifies its internal CRC to validate the programming operation.
Finally, Flasher responds with
·    #OK if no error occurred
·    #ERRxxx if any error occurred during operation. xxx represents the errorcode, normally replied to Flasher PC program. The #ERRxxx message may be followed by an additional error text.
During execution of the AUTO command, Flasher automatically sends “status” messages via RS232 to reflect the state of execution. Typically during execution of #AUTO command, Flasher will reply the following sequence of messages:
#ACK
#STATUS:START CMD
#STATUS:CONNECTING
#STATUS:CLEARING
#STATUS:WRITING
#STATUS:VERIFYING
#STATUS:VERIFY FLASHER CRC
#OK

or no staus until end:

#AUTO NOINFO
This command may be used instead of AUTO, if no status messages from Flasher should be sent during execution.
The command ends with #OK or #ERRxxx 

EACH command sent ends in an ASCII 13 ("CR").

Labview is timing out before the response even if I increase the time.

0 Kudos
Message 3 of 8
(7,997 Views)

Hi there

 

I assumed the error inside the LV code. Change the "termination char" of "VISA Configure Serial Port (Instr).vi" from the default LF to the desired CR or use the "Advanced Serial Write and Read.vi" example.

 

 

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 4 of 8
(7,989 Views)

Thanks for the help, just start back working on it yesterday, I was able to get the programmer working using the advance serial write example, I created a vi using that as a prototype.  had to move the serial write out of the loop, and then increase the delay.  My next task isstopping the Loop when one of three things happen, timeout, #OK is recieved or #ERRxxx is recieved, not sure how to do it yet.  Have summitted a copy of the vi i am working from.

Any help is appreciated.

Download All
0 Kudos
Message 5 of 8
(7,934 Views)
Solution
Accepted by topic author hallawt2004
Figured it out, created a program that works and stops on an error.  thank-you again for your help, I maybe able to make it simplier but, still learning.  School isn't till February already have the CLAD.   Here's my final solution, included the write protion of the vi, renamed read to flasher program
Message 6 of 8
(7,925 Views)

Hi,

I am going to use Segger Flasher ARM device with LabVIEW. Basically I need to perform two functions:

 

1. Upon initial tester start up, LabVIEW will check if Segger Flasher Arm is connected and working.

2. Program actual programming of a hex file (stored in a location in PC) into the target device.

 

I am new to VISA programming. Any help in implementing above two functions will be much appreicated.

Thanks

Jeet

0 Kudos
Message 7 of 8
(6,929 Views)

Hello jeet,

 

Can you tell us a bit more about what you've done already to communicate with the Segger Flasher Arm?

 

You may also be interested in the serial communication examples included with LabVIEW. If you go to Help->Find Examples, the example finder will pop up. There are several examples under Hardware Input/Output->Serial. 

 

0 Kudos
Message 8 of 8
(6,893 Views)