stm3210e_eval.cfg 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # This is an STM32 eval board with a single STM32F103ZET6 chip.
  3. # http://www.st.com/internet/evalboard/product/204176.jsp
  4. # increase working area to 32KB for faster flash programming
  5. set WORKAREASIZE 0x8000
  6. source [find target/stm32f1x.cfg]
  7. #
  8. # configure FSMC Bank 1 (NOR/PSRAM Bank 2) NOR flash
  9. # M29W128GL70ZA6E
  10. #
  11. set _FLASHNAME $_CHIPNAME.norflash
  12. flash bank $_FLASHNAME cfi 0x64000000 0x01000000 2 2 $_TARGETNAME
  13. proc stm32_enable_fsmc {} {
  14. echo "Enabling FSMC Bank 1 (NOR/PSRAM Bank 2)"
  15. # enable gpio (defg) clocks for fsmc
  16. # RCC_APB2ENR
  17. mww 0x40021018 0x000001E0
  18. # enable fsmc clock
  19. # RCC_AHBENR
  20. mww 0x40021014 0x00000114
  21. # configure gpio to alternate function
  22. # GPIOD_CRL
  23. mww 0x40011400 0x44BB44BB
  24. # GPIOD_CRH
  25. mww 0x40011404 0xBBBBBBBB
  26. # GPIOE_CRL
  27. mww 0x40011800 0xBBBBB444
  28. # GPIOE_CRH
  29. mww 0x40011804 0xBBBBBBBB
  30. # GPIOF_CRL
  31. mww 0x40011C00 0x44BBBBBB
  32. # GPIOF_CRH
  33. mww 0x40011C04 0xBBBB4444
  34. # GPIOG_CRL
  35. mww 0x40012000 0x44BBBBBB
  36. # GPIOG_CRH
  37. mww 0x40012004 0x444444B4
  38. # setup fsmc timings
  39. # FSMC_BCR1
  40. mww 0xA0000008 0x00001058
  41. # FSMC_BTR1
  42. mww 0xA000000C 0x10000502
  43. # FSMC_BCR1 - enable fsmc
  44. mww 0xA0000008 0x00001059
  45. }
  46. $_TARGETNAME configure -event reset-init {
  47. stm32_enable_fsmc
  48. }