本帖最后由 Simon21ic 于 2009-10-21 02:43 编辑
上次看到mcuisp的那个工具支持了STM32的JTAG/SWJ编程。虽然Versaloon目前没有销售(原来准备在国内销售的那10套,卖给一个国外公司做样机了),但咱也8能落后太多,于是乎,马上加了上去(一些代码参考了OpenOCD,但Flash_Loader优化了一些,虽然JTAG驱动使用更慢的HL接口,但速度仍旧是OpenOCD的3倍多,大概单下载33+KB/s,OpenOCD下4.5M时,速度为10.8KB/s)。SWJ接口will follow。之后会在OpenOCD中,加入SWJ的支持。
不确定是否是新片的问题,目前测试用的芯片的JTAG速度可以支持到很高,目前使用4.5M的速度(难道碰到极品芯片?)。
JTAG速度增加到9M的时候,仍旧可以正常编程,但是速度没有提升。
JTAG速度增加到18M的时候,JTAG访问会出错(DP通信的时候出错,应答不到ACK)。
VSProg debug version (Oct 19 2009) MSVC express 2008 SP1:0000
CopyRight(c) 2008-2009 by SimonQian
URL: http://www.SimonQian.com/en/Versaloon
mail: __N/A__
Info: Versaloon(0x13)by Simon(compiled on Oct 19 2009)
Warning:5 is invalid for hex type, current line ignored!!
Warning:debug port not defined, use JTAG by default.
Info: VSLLink_20080905 by Simon(compiled on Oct 19 2009)
Info: JTAG_ID: 0x3BA00477.
Info: AHB-AP_ID: 0x14770011
Info: ROM_ADDRESS: 0xE00FF003
Info: CFG: 0x00000000, Small-endian
Info: CORTEX-M3 processor detected
Info: CPUID: 0x411FC231
Info: STM32 MCU_ID: 0x20016410
Info: STM32 revision: Z
Info: STM32 type: medium-density device
Info: STM32 flash_size: 32K Bytes
Info: STM32 sram_size: 6K Bytes
Info: Target halted.
Info: erasing chip
erasing chip |========================================%100| 0.03s used
Info: chip erased
Info: Target halted.
Info: programming flash_loader
writing flash |========================================%100| 0.00s used
Info: flash_loader programmed for 120bytes
Info: verifying flash_loader
writing flash |========================================%100| 0.02s used
Info: flash_loader verified for 120bytes
Info: Target running.
Info: programming flash
writing flash |========================================%100| 0.45s used
Info: flash programmed for 15456bytes
Info: verifying flash
reading flash |========================================%100| 0.14s used
Info: flash verified for 15456bytes |