1 # This is an STM32 eval board with a single STM32F103ZET6 chip.
2 # http://www.st.com/internet/evalboard/product/204176.jsp
4 # increase working area to 32KB for faster flash programming
5 set WORKAREASIZE 0x8000
7 source [find target/stm32f1x.cfg]
10 # configure FSMC Bank 1 (NOR/PSRAM Bank 2) NOR flash
14 set _FLASHNAME $_CHIPNAME.norflash
15 flash bank $_FLASHNAME cfi 0x64000000 0x01000000 2 2 $_TARGETNAME
17 proc stm32_enable_fsmc {} {
19 echo "Enabling FSMC Bank 1 (NOR/PSRAM Bank 2)"
21 # enable gpio (defg) clocks for fsmc
23 mww 0x40021018 0x000001E0
27 mww 0x40021014 0x00000114
29 # configure gpio to alternate function
31 mww 0x40011400 0x44BB44BB
33 mww 0x40011404 0xBBBBBBBB
36 mww 0x40011800 0xBBBBB444
38 mww 0x40011804 0xBBBBBBBB
41 mww 0x40011C00 0x44BBBBBB
43 mww 0x40011C04 0xBBBB4444
46 mww 0x40012000 0x44BBBBBB
48 mww 0x40012004 0x444444B4
52 mww 0xA0000008 0x00001058
55 mww 0xA000000C 0x10000502
57 # FSMC_BCR1 - enable fsmc
58 mww 0xA0000008 0x00001059
61 $_TARGETNAME configure -event reset-init {