Programming PSoC5 LP from python

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ViRa_1964436
Level 2
Level 2
First like received First like given Welcome!

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 Solution
Anonymous
Not applicable

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))

View solution in original post

0 Likes
3 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

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

0 Likes
Anonymous
Not applicable

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))

0 Likes