打印

用CLI在cmd窗口刷写PSoC4的Flash

[复制链接]
929|6
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
本帖最后由 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. */

结果如下:

result.png (165.77 KB )

result

result
沙发
leijixiaomile| | 2017-2-21 17:06 | 只看该作者
沙发沙发 谢谢楼主大神分享。

使用特权

评论回复
板凳
xiaolong_ba| | 2017-2-21 17:55 | 只看该作者
本帖最后由 xiaolong_ba 于 2017-2-21 17:56 编辑

这个最终还是要依赖Kitprog,这样就没意思了

使用特权

评论回复
地板
zhaoruzhe|  楼主 | 2017-2-22 09:08 | 只看该作者
xiaolong_ba 发表于 2017-2-21 17:55
这个最终还是要依赖Kitprog,这样就没意思了

也有其他方法的,用UART,SPI,I2C,BLE任意的接口,在PSoC4的Firnware里写一个简单的写Flash驱动就好了。传参刷写。

使用特权

评论回复
5
zhaoruzhe|  楼主 | 2017-2-22 09:09 | 只看该作者
leijixiaomile 发表于 2017-2-21 17:06
沙发沙发 谢谢楼主大神分享。

我只是小搬运工

使用特权

评论回复
6
xiaolong_ba| | 2017-2-22 09:29 | 只看该作者
zhaoruzhe 发表于 2017-2-22 09:08
也有其他方法的,用UART,SPI,I2C,BLE任意的接口,在PSoC4的Firnware里写一个简单的写Flash驱动就好了。传 ...

嗯,这个是就是最基本的MCU的Bootloader方式。

使用特权

评论回复
7
zhaoruzhe|  楼主 | 2017-2-22 09:35 | 只看该作者
xiaolong_ba 发表于 2017-2-22 09:29
嗯,这个是就是最基本的MCU的Bootloader方式。

总结的好!

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

26

主题

289

帖子

1

粉丝