2 Replies Latest reply on Aug 18, 2017 2:42 PM by TelmoBarros

    Programming PSoC5 LP from python

    vdevram_1964436

      Hi,

         

      I am trying to program PSoC 5LP from python.

         

      I am on Windows 10 Pro, 64 bit. I am using python 3.4.4, and PSoC 5LP kit, connected via kit prog to PC. I am able to program the device using PSoC creator 4.0, update 1.

         

      I tried to program the device using "C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\Python_Ex\Python_Ex.py"

         

      I modified this script to point to my hex file. 

         

      However, I am getting this error below:

         

      -------------------------------------------

         

      C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\Python_Ex>python Python_Ex.py
        File "Python_Ex.py", line 418
          print "Mismatch of Checksum: Expected 0x%x, Got 0x%x" %(flashChecksum, hexChecksum)
                                                              ^
      SyntaxError: invalid syntax

         

      -------------------------------------------

         

      Also, if multiple PSoCs are connected to the same PC (via kit prog), how will I program them all, one by one?

         

      Regards,

         

      Vishnu

        • 1. Re: Programming PSoC5 LP from python
          anks

          Yes,you have to program one by one each PSoC by KitProg

          • 2. Re: Programming PSoC5 LP from python
            TelmoBarros

            I also want to program my PSoC 5LP with python, but I have no idea how.

            With that said, and taking into account what you wrote:

             

            "I am using python 3.4.4"

             

            line 418

                 print "Mismatch of Checksum: Expected 0x%x, Got 0x%x" %(flashChecksum, hexChecksum)

                                                                     ^

            SyntaxError: invalid syntax

             

            I think it's because, in python 3, the syntax for print is something like

              - print("Mismatch of Checksum: Expected 0x%x, Got 0x%x" %(flashChecksum, hexChecksum))