As before - I created some tcl script commands for the atmel at91 parts.
This is likewise for the stm32 parts.
It is limited - and is a starting point for others to make use of.

-Duane.

Idea is as follows (just like at91)

In your "openocd.cfg" file, add this line:

source [find tcl/chip/st/stm32/stm32.tcl]

Then, try these commands:

show_RCC  [for the entire RCC block]

Or the individual registers commands:

   show_RCC_CR
   show_RCC_CFGR
   show_RCC_CIR
   show_RCC_APB2RSTR
   show_RCC_APB1RSTR
   show_RCC_AHBENR
   show_RCC_APB2ENR
   show_RCC_APB1ENR
   show_RCC_BDCR
   show_RCC_CSR


Attachment: stm32.scripts.targz
Description: Binary data

Index: src/tcl/mmr_helpers.tcl
===================================================================
--- src/tcl/mmr_helpers.tcl     (revision 838)
+++ src/tcl/mmr_helpers.tcl     (working copy)
@@ -13,7 +13,7 @@
     set a [set [set NAME]]
 
     if ![catch { set v [memread32 $a] } msg ] {
-       puts [format "%10s: (0x%08x): 0x%08x" $NAME $a $v]
+       puts [format "%15s: (0x%08x): 0x%08x" $NAME $a $v]
 
        # Was a helper defined?
        set fn show_${NAME}_helper
@@ -36,7 +36,7 @@
 
     upvar $NAMES MYNAMES
 
-    set w 0
+    set w 5
     foreach {IDX N} $MYNAMES {
        set l [string length $N]
        if { $l > $w } { set w $l }
@@ -57,3 +57,16 @@
        puts ""
     }
 }
+
+
+proc show_mmr_bitfield { MSB LSB VAL FIELDNAME FIELDVALUES } {
+    set width [expr (($MSB - $LSB + 1) + 7) / 4]
+    set nval [show_normalize_bitfield $VAL $MSB $LSB ]
+    set name0 [lindex $FIELDVALUES 0 ]
+    if [ string compare $name0 _NUMBER_ ] {
+       set sval [lindex $FIELDVALUES $nval]
+    } else {
+       set sval ""
+    }
+    puts [format "%-15s: %d (0x%0*x) %s" $FIELDNAME $nval $width $nval $sval ]
+}

Index: src/Makefile.am
===================================================================
--- src/Makefile.am     (revision 838)
+++ src/Makefile.am     (working copy)
@@ -79,18 +79,21 @@
        $(FTDI2232LIB) $(FTD2XXLIB) $(MINGWLDADD) $(LIBUSB)
 
 nobase_dist_pkglib_DATA = \
-       tcl/bitsbytes.tcl  \
-       tcl/chip/atmel/at91/aic.tcl  \
-       tcl/chip/atmel/at91/at91sam7x128.tcl  \
-       tcl/chip/atmel/at91/at91sam7x256.tcl  \
-       tcl/chip/atmel/at91/pmc.tcl  \
-       tcl/chip/atmel/at91/rtt.tcl  \
-       tcl/chip/atmel/at91/usarts.tcl  \
-       tcl/cpu/arm/arm7tdmi.tcl  \
-       tcl/cpu/arm/arm920.tcl  \
-       tcl/cpu/arm/arm946.tcl  \
-       tcl/cpu/arm/arm966.tcl  \
-       tcl/memory.tcl  \
-       tcl/mmr_helpers.tcl  \
-       tcl/readable.tcl  
-
+       tcl/bitsbytes.tcl                       \
+       tcl/chip/atmel/at91/aic.tcl             \
+       tcl/chip/atmel/at91/at91sam7x128.tcl    \
+       tcl/chip/atmel/at91/at91sam7x256.tcl    \
+       tcl/chip/atmel/at91/pmc.tcl             \
+       tcl/chip/atmel/at91/rtt.tcl             \
+       tcl/chip/atmel/at91/usarts.tcl          \
+       tcl/chip/st/stm32/stm32.tcl             \
+       tcl/chip/st/stm32/stm32_rcc.tcl         \
+       tcl/chip/st/stm32/stm32_regs.tcl        \
+       tcl/cpu/arm/arm7tdmi.tcl                \
+       tcl/cpu/arm/arm920.tcl                  \
+       tcl/cpu/arm/arm946.tcl                  \
+       tcl/cpu/arm/arm966.tcl                  \
+       tcl/cpu/arm/cortex_m3.tcl               \
+       tcl/memory.tcl                          \
+       tcl/mmr_helpers.tcl                     \
+       tcl/readable.tcl
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to