This is an automated email from Gerrit.

Uwe Bonnes (b...@elektron.ikp.physik.tu-darmstadt.de) just uploaded a new patch 
set to Gerrit, which you can find at http://openocd.zylin.com/2609

-- gerrit

commit 52f48b9e77457745f750a6d9278fa5801745136a
Author: Uwe Bonnes <b...@elektron.ikp.physik.tu-darmstadt.de>
Date:   Fri Jan 9 10:53:30 2015 +0100

    tcl: Add default hooks for STM32F4x
    
    Keep clocks running in low power modes. Stop watchdogs from interfering
    with the debug session. Set up PLL and increase clock at reset init.
    
    Change-Id: I611bc6fb7c0c5afd8ed3f4ad8e64f3c7b981d31c
    Signed-off-by: Uwe Bonnes <b...@elektron.ikp.physik.tu-darmstadt.de>

diff --git a/tcl/target/stm32f4x.cfg b/tcl/target/stm32f4x.cfg
index fd5cab6..7a0394f 100644
--- a/tcl/target/stm32f4x.cfg
+++ b/tcl/target/stm32f4x.cfg
@@ -89,3 +89,33 @@ if {![using_hla]} {
    # perform a soft reset
    cortex_m reset_config sysresetreq
 }
+
+proc stm32f4x_default_reset_start {} {
+       # Reset clock is HSI (16 MHz)
+       adapter_khz 2000
+}
+
+proc stm32f4x_default_examine_end {} {
+       # Enable debug during low power modes (uses more power)
+       mww 0xe0042004 0x00000007 ;# DBGMCU_CR = DBG_STANDBY | DBG_STOP | 
DBG_SLEEP
+
+       # Stop watchdog counters during halt
+       mww 0xe0042008 0x00001800 ;# DBGMCU_APB1_FZ = DBG_IWDG_STOP | 
DBG_WWDG_STOP
+}
+
+proc stm32f4x_default_reset_init {} {
+       # Configure PLL to boost clock to HSI x 4 (64 MHz)
+       mww 0x40023804 0x08012008 ;# RCC_PLLCFGR 16 Mhz /8 (M) * 128 (N) /4(P)
+       mww 0x40023C00 0x00000102 ;# FLASH_ACR = PRFTBE | 2(Latency)
+       mwh 0x40023802 0x0100     ;# RCC_CR[31:16] = PLLON
+       sleep 10                  ;# Wait for PLL to lock
+       mwh 0x40023808 0x0002     ;# RCC_CFGR |= SW[1]
+
+       # Boost JTAG frequency
+       adapter_khz 8000
+}
+
+# Default hooks
+$_TARGETNAME configure -event examine-end { stm32f4x_default_examine_end }
+$_TARGETNAME configure -event reset-start { stm32f4x_default_reset_start }
+$_TARGETNAME configure -event reset-init { stm32f4x_default_reset_init }

-- 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to