本帖最后由 zhaoruzhe 于 2017-2-21 14:53 编辑
用cmd line写PSoC4的Flash.一段代码供参考哦
所有的API在这里:PSoC Programmer Command-Line Interface (CLI) Guide
[C:\Windons\system32]>cd C:\Program Files (x86)\Cypress\Programmer /* Opens the location where PSoC Programmer installed. */
[C:\Program Files (x86)\Cypress\Programmer]>ppcli.exe /* Opens the interface of PSoC Programmer CLI command-line. */
>OpenPort KitProg/100F143503274400 . /* Opens port to toggle the target device. Please use correct port name as per you are using and don’t miss “ .” at the end. */
>SetProtocol 8 /* Chooses correct communication protocol; “8” means SWD protocol. */
[>SetProtocolConnector 1] /* This step can be ignored if using KitProg; “0” means 5-pin connector, “1” means 10-pin connector. If you are using MiniProg3, please set it according to actual hardware connection. */
>SetPowerVoltage 5.0 /* Sets Voltage of Supply; “5.0” means 5.0 volt. */
>DAP_Acquire /* Toggles the target device. */
>PowerOn /* Applies power to the VDD pin of the target device. */
>PSoC4_WriteRow 0x60 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x01 0x02 0x03 0x04 /* Write one row data at Row#0x60. The absolute starting address should equal to Row# * RowSize; For PSoC4 series, RowSize is always 0x80. In this case, the absolute starting address is 0x00003000. */
>PSoC4_ReadRow 0x60 /* Reads back to check if the data has been written correctly. */
>PowerOff /* Tells the programmer to stop powering the device. */
>ClosePort /* Closes Port.*/
>quit /* Quits from ppcli.exe. */
结果如下:
|