I have tested the SWJ support to STM32, implemented in vsprog.

I'll then prepare to implement it in OpenOCD.
Most operation is the same as JTAG, but DP accesses are not posted.

For multiple interface, I'll add a "swd_mode" command to select SWD
interface.
Add corresponding SWD driver.
I find a patch about SWD support, but there is some BUG in the SWD
implementation in that patch.

SWJ interfaces functions:
SWJ_SeqOut: used to output a sequence, eg: output JTAG_TO_SWD sequence
SWJ_Transact: do the SWD RW operation
SWJ interfaces parameters:
SWJ_Trn: turnaround cycles, for STM32, default is 2
SWJ_Dly: delay in us for each bit

Below is the vsprog log when programming STM32 through SWD:

VSProg debug version (Oct 22 2009) MSVC express 2008 SP1:0000
CopyRight(c) 2008-2009 by SimonQian
URL: 
http://www.SimonQian.com/en/Versaloon<http://www.simonqian.com/en/Versaloon>
mail: __N/A__
Info:   Versaloon(0x13)by Simon(compiled on Oct 24 2009)
Warning:5 is invalid for hex type, current line ignored!!
Info:   VSLLink_20080905 by Simon(compiled on Oct 24 2009)
Info:   SWJ_ID read is 0x1BA01477.         <<<<<<<<<<++++++++++ SWJ_ID
++++++++++>>>>>>>>>>
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_loader |========================================%100| 0.00s
used
Info:   flash_loader programmed for 120bytes
Info:   verifying flash_loader
reading flash_loader |========================================%100| 0.00s
used
Info:   flash_loader verified for 120bytes
Info:   Target running.
Info:   programming flash
writing flash |========================================%100| 0.52s used
Info:   flash programmed for 15456bytes
Info:   verifying flash
reading flash |========================================%100| 0.36s used
Info:   flash verified for 15456bytes

-- 
Best Regards, SimonQian
http://www.SimonQian.com
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to