1 # This is an STM32 eval board with a single STM32F103ZE chip on it.
2 # http://www.st.com/mcu/contentid-100-110-STM3210E_EVAL.html
4 # increase working area for faster flash programming
8 source [find target/stm32.cfg]
11 # configure FSMC Bank 1 (NOR/PSRAM Bank 2) NOR flash
15 set _FLASHNAME $_CHIPNAME.norflash
16 flash bank $_FLASHNAME cfi 0x64000000 0x01000000 2 2 $_TARGETNAME
18 proc stm32_enable_fsmc {} {
20 echo "Enabling FSMC Bank 1 (NOR/PSRAM Bank 2)"
22 # enable gpio (defg) clocks for fsmc
24 mww 0x40021018 0x000001E0
28 mww 0x40021014 0x00000114
30 # configure gpio to alternate function
32 mww 0x40011400 0x44BB44BB
34 mww 0x40011404 0xBBBBBBBB
37 mww 0x40011800 0xBBBBB444
39 mww 0x40011804 0xBBBBBBBB
42 mww 0x40011C00 0x44BBBBBB
44 mww 0x40011C04 0xBBBB4444
47 mww 0x40012000 0x44BBBBBB
49 mww 0x40012004 0x444444B4
53 mww 0xA0000008 0x00001058
56 mww 0xA000000C 0x10000502
58 # FSMC_BCR1 - enable fsmc
59 mww 0xA0000008 0x00001059
62 $_TARGETNAME configure -event reset-init {