3 Replies Latest reply on Jan 9, 2018 4:28 PM by RuzheZ_36

    How do I use PSoC Programmer CLI to program and verify a PSoC 4 BLE device?

      I'm trying to create a script for PSoC Programmer to program a CY8C4248LQQI-BL483.  I need to be able to program the part by calling an executable from N.I Labview and this looked like the simplest option.  I'm running into two issues:


      1) Table 1-1 in the Command-Line Interface (CLI) Guide indicates that the "Program" function only works on PSoC 1 devices and I don't see a similar command for PSoC4.  That said if I run the CLI interpreter the Program function appears to work on my device.  What is the correct method for programming and verifying a PSoC 4 device?


      2) In section 1.4 "Return Values" of the CLI Guide there is a discussion about "analyzing" return (status) values but none of the examples there or later in the document actually describe how to do this within a script.  How are you supposed to check returned statuses and change the flow of the script?  Or are you supposed to execute the CLI interpreter with only one command per launch and process the returned status in a DOS batch file?  And example or two showing how this is expected to be accomplished would help greatly.

        • 2. Re: How do I use PSoC Programmer CLI to program and verify a PSoC 4 BLE device?

          Sorry, I wasn't clearer but all I want to do is program the Flash with the .elf or .srec file from PSoC Creator in a manner that can be run from a command line or script.  The main issue we are having is that the CLI documentation doesn't appear to provide any guidance on changing the control flow in a script based on the output from the interpreter.


          Paragraph 1.4 in the CLI Guide states that one should "analyze the return values..." yet no mechanism is described in that document for doing so.


          1.4 Return Values Most PSoc Programmer CLI functions return a status that shows the function name and a string representation of the status or error. Other functions return a string or void value. It is recommended that you analyze the return values before processing the returned parameters or moving to the next function. If a function fails, some parameters may remain in an uninitialized state. Processing these parameters may cause an exception or runtime error. All CLI APIs return either a negative or positive integer to indicate success or failure: ■ 0 or greater = Success Example: Verify < 7.57662 0 OK ■ Negative integer = Failed PSoC Programmer Command-Line Interface (CLI) Guide, Doc. # 001-16300 Rev. *P 10 Overview Example: E Acquire returned –3 OK


          It also appears that the CLI doesn't provide any simple command to "program" a PSoC 4 device.  There is a command to write a single row in the Flash but I don't see any way to add a control loop that would allow writing to the entire Flash.   Finally as near as I can tell the Perl command set doesn't include anything for PSoC 4 devices.


          The bottom line is I need a way to transfer a program generated by PSoC Creator (.elf, srec, or .hex) to a PSoC 4 device that can be run from a command line (vs a GUI).  Preferably this would utilize the MiniProg3 programmer as we have acquired several of these and have incorporated them into a custom programming fixture due to the expectation that this would work.



          • 3. Re: How do I use PSoC Programmer CLI to program and verify a PSoC 4 BLE device?

            Hi Lance,


            I read your topic again and think...maybe CLI is not what should be used for LabVIEW interface...Another KBA is FYI.

            Programming with KitProg2/MiniProg3 Using LabVIEW™ - KBA218796

            If it can help you out. CLI issues you met should be not so important...