You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
1.2 KiB

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