1 of 1 people found this helpful
Here are a couple of things you can use to increase the speed of programming:
(1) In the InitializePort function, you can increase SWD Clock frequency in the pp.SetProtocolClock(enumFrequencies.FREQ_03_0). By default it is set to 3MHz. For list of frequencies, refer to the PPCOM.py file where all the enumerations are listed.
Note that the frequency should be less than one third of the bus-clock at which the PSoC operates.
(2) In the ProgramAll function, you can remove the verification related functions if you are confident that the hex file is targeted at the correct device, if you chip protection is set to normal. etc. These functions are:HEX_ReadChipProtection(), CheckHexAndDeviceCompatibility(), PSoC4_VerifyFlash(), PSoC4_VerifyProtect(), HEX_ReadChecksum(), PSoC4_CheckSum()
Let me know your observations after making these changes. Hope this helps
Thank you very much for your response.
After doing the changes you suggested in item #2, I can reduce the time from 15 secs to 11.5 seconds. The biggest impact was from commenting out PSoC4_VerifyFlash(). This accounted for almost all of the 3.5 second time reduction.
However, doing the change in #1 (that is, changing the SWD clock frequency) had no effect whatsoever.
This was very surprising for me, I was expecting a drastic reduction in flashing time if I increased the SWD clock frequency. Is this expectation of reduction in flashing time, a correct expectation?
- I am flashing the PSOC4 Analog Coprocessor. I have connected it to PC using kitprog.
- For 11.5 seconds flashing time, the SWD clock speed was set as follows: pp.SetProtocolClock(enumFrequencies.FREQ_03_0)
- I tried changing it to FREQ_06_0, FREQ_08_0. No change in flashing time, it still remained at 11.5 seconds
- What is the max supported SWD clock frequency on PSOC4 Analog Co processor?
I tried programming PSoC Analog Processor using one of my hex files and the default Python_Ex.py script and I was able to program the device with programming time less than 5 seconds.
Can you please share your hex file and the script that you are using to program the device so that we can reproduce the issue at our end?
Thanks and Regards,
Rakshith M B
Thanks for helping look into this.
Can you please let me know how to send you the file? I can email it to you. I do not want to post it here.