From: Mike M. <mi...@ai...> - 2014-06-17 12:56:23
|
Hi again, actually this config file I hacked up seems to work OK with this command line: sudo openocd -f interface/ftdi/jtag-lock-pick_tiny_2.cfg -f /tmp/stm32-swd- mikem.cfg But is this the right way to do it? # stm32-swd-mikem.cfg # Connect to stm32f1 and similar by swd over jtag-lock-pick tiny 2 # use with patched openocd: # sudo src/openocd -f tcl/interface/ftdi/jtag-lock-pick_tiny_2.cfg -f /tmp/stm32-swd-mikem.cfg # and arm-none-eabi-gdb -ex "target remote localhost:3333" /tmp/xyz/xyz.elf transport select swd adapter_khz 10 adapter_nsrst_delay 200 if { [info exists CHIPNAME] } { set _CHIPNAME $CHIPNAME } else { set _CHIPNAME stm32 } if { [info exists ENDIAN] } { set _ENDIAN $ENDIAN } else { set _ENDIAN little } # Work-area is a space in RAM used for flash programming # By default use 16kB if { [info exists WORKAREASIZE] } { set _WORKAREASIZE $WORKAREASIZE } else { set _WORKAREASIZE 0x4000 } #jtag scan chain if { [info exists CPUTAPID ] } { set _CPUTAPID $CPUTAPID } else { # See STM Document RM0008 # Section 26.6.3 set _CPUTAPID 0x3ba00477 } swd newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID set _TARGETNAME $_CHIPNAME.cpu target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 # flash size will be probed set _FLASHNAME $_CHIPNAME.flash flash bank $_FLASHNAME stm32f1x 0x08000000 0 0 0 $_TARGETNAME # if srst is not fitted use SYSRESETREQ to # perform a soft reset cortex_m reset_config sysresetreq On Tuesday, June 17, 2014 09:17:23 PM Mike McCauley wrote: > Hi Freddie, > > thats all worked fine so far. Thanks. Just for the complete record for other > people the commands are: > > git clone git://git.code.sf.net/p/openocd/code openocd-code > cd openocd-code/ > git fetch http://openocd.zylin.com/openocd refs/changes/36/2136/2 > git checkout FETCH_HEAD > ./bootstrap > ./configure --enable-ftdi > make > > > Now, whats the right openocd command line to connect by SWD to an STM32F1 > or similar? > > I see your tcl/interface/ftdi/jtag-lock-pick_tiny_2.cfg, but that doesnt set > the transport etc up. > > > Cheers. > > On Tuesday, June 17, 2014 11:54:49 AM Freddie Chopin wrote: > > W dniu 2014-06-17 10:12, Mike McCauley pisze: > > > On Tuesday, June 17, 2014 08:52:17 AM Freddie Chopin wrote: > > >> W dniu 2014-06-17 08:06, Mike McCauley pisze: > > >>> Hi, > > >>> Has anyone successfully used openocd with a JTAG-lock-pick Tiny 2 with > > >>> SWD > > >>> with, for example, a STM32F1? > > >> > > >> There are a couple of success reports, but I guess you should be > > >> looking > > >> for them on the "devel" list, not here. > > > > > > I did search and didnt find anything helpful except your patch reports. > > > > From what I remember Jens Bauer was trying the SWD patches. > > > > >>> If so, how did you build and configure openocd for that? > > >> > > >> For now (until this is fully merged) you need to compile OpenOCD with > > >> this patch series - http://openocd.zylin.com/#/c/2136/2 > > > > > > Thanks. > > > Your changes are in patch set 2, is that correct. > > > Its not clear to me how to get the patched version from git. Can you > > > please > > > advise the process? > > > > 1. Go to http://openocd.zylin.com/#/c/2136/2 > > 2. In the upper right click on "download" > > 3. Click on the "copy to clipboard" button next to "checkout" - > > currently "git fetch http://openocd.zylin.com/openocd > > refs/changes/36/2136/2 && git checkout FETCH_HEAD" > > 4. Execute this command in a git clone of OpenOCD. > > > > This should pull the whole series, up to the point which is selected in > > the "Related changes" window. > > > > > Also, what is the ./configure command for building? ie what --enable > > > options should I use for this device? Looks like maybe its > > > --enable-ftdi?? > > > > Exactly - --enable-ftdi is the only one that is needed here, but others > > will do no harm. > > > > Regards, > > FCh > > > > -------------------------------------------------------------------------- > > -- -- HPCC Systems Open Source Big Data Platform from LexisNexis Risk > > Solutions Find What Matters Most in Your Big Data with HPCC Systems > > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > > http://p.sf.net/sfu/hpccsystems > > _______________________________________________ > > OpenOCD-user mailing list > > Ope...@li... > > https://lists.sourceforge.net/lists/listinfo/openocd-user -- Mike McCauley VK4AMM mi...@ai... Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.airspayce.com Phone +61 7 5598-7474 |