cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

nigelsmith
New Contributor

I'm trying to automate the programming of a CY8C3445AXI-104 device using the ppcli application, the problem I have is that I cannot find the ppcli command that will write the data to the PSoC from a hex file that has been read in. The following lines of code appear to work, but I'm at a loss as to what commands are used to program and verify the Hex file.

OpenPort MiniProg3/1636BB000190 .
HEX_ReadFile "C:\\PSOC_CLI_Programmer\\Application\\2001HPC_V_21_for_CY8C3445AXI-108.hex"
SetAcquireMode “Reset”
SetProtocol 1
SetProtocolClock 152
SetPowerVoltage 3.3
DAP_Acquire
PSoC3_EraseAll

I assume that the commands would be "PSoC3_ProgramRowFromHex" and "PSoC3_VerifyRowFromHex", but need further information on how to use these commands.

Am I also correct in thinking that the script would be completed with the following:

PSoC3_ProtectAll
PSoC3_VerifyProtect
DAP_ReleaseChip
ClosePort
Quit

 

0 Likes
1 Solution
AlenAn14
Moderator
Moderator

Hi @nigelsmith ,

You will have to work out this part from the hex file you are trying to load as there is no predefined command in ppcli that allows you to obtain the number of rows in the hex file.( You can try writing a script for finding out the number of flash rows by taking the hex file as the input)

The method I would like to suggest you is as follows:
You can create a tool for this using the C Sharp source code provided in the following path:
C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\C_Sharp

You will have to look into the PSoC Programmer COM Guide ,which gives details regarding the API's used in the C Sharp code for creating the tool. More specifically, you can refer section 3.2.2, 'C_Sharp SWD Example' of the guide to understand how the "PSoC3_ProgramRowFromHex" command is used in the tool.
You will require Visual Studio to build the tool using the C sharp code given in the above mentioned path.

Hope this helps.

Regards
Alen

View solution in original post

0 Likes
3 Replies
AlenAn14
Moderator
Moderator

HI @nigelsmith ,

Thank you for using our products and we do have sample scripts that you can use to automate the programming operation on PSoC  devices.
Please take a look at the KBA Programming PSoC™ 3, PSoC™ 4, and PSoC™ 5LP MCUs using PPCLI – KBA232937 which gives the detailed commands that you can use in your custom script to automate the PSoC  programming using PPCLI tool.
The KBA mentioned above also provides a sample example script to help you get started. 

Hope this helps

Regards
Alen

0 Likes
nigelsmith
New Contributor

How can I work out how many rows are in the HEX file so that I can program/verify each row with the commands "PSoC3_ProgramRowFromHex" and  "PSoC3_VerifyRowFromHex"?

0 Likes
AlenAn14
Moderator
Moderator

Hi @nigelsmith ,

You will have to work out this part from the hex file you are trying to load as there is no predefined command in ppcli that allows you to obtain the number of rows in the hex file.( You can try writing a script for finding out the number of flash rows by taking the hex file as the input)

The method I would like to suggest you is as follows:
You can create a tool for this using the C Sharp source code provided in the following path:
C:\Program Files (x86)\Cypress\Programmer\Examples\Programming\PSoC3_5\SWD\C_Sharp

You will have to look into the PSoC Programmer COM Guide ,which gives details regarding the API's used in the C Sharp code for creating the tool. More specifically, you can refer section 3.2.2, 'C_Sharp SWD Example' of the guide to understand how the "PSoC3_ProgramRowFromHex" command is used in the tool.
You will require Visual Studio to build the tool using the C sharp code given in the above mentioned path.

Hope this helps.

Regards
Alen

0 Likes