mdr32f9q2i.cfg 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # SPDX-License-Identifier: GPL-2.0-or-later
  2. # MDR32F9Q2I (1986ВЕ92У)
  3. # http://milandr.ru/index.php?mact=Products,cntnt01,details,0&cntnt01productid=57&cntnt01returnid=68
  4. source [find target/swj-dp.tcl]
  5. if { [info exists CHIPNAME] } {
  6. set _CHIPNAME $CHIPNAME
  7. } else {
  8. set _CHIPNAME mdr32f9q2i
  9. }
  10. if { [info exists ENDIAN] } {
  11. set _ENDIAN $ENDIAN
  12. } else {
  13. set _ENDIAN little
  14. }
  15. # Work-area is a space in RAM used for flash programming
  16. if { [info exists WORKAREASIZE] } {
  17. set _WORKAREASIZE $WORKAREASIZE
  18. } else {
  19. set _WORKAREASIZE 0x8000
  20. }
  21. #jtag scan chain
  22. if { [info exists CPUTAPID] } {
  23. set _CPUTAPID $CPUTAPID
  24. } else {
  25. if { [using_jtag] } {
  26. set _CPUTAPID 0x4ba00477
  27. } {
  28. # SWD IDCODE
  29. set _CPUTAPID 0x2ba01477
  30. }
  31. }
  32. swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  33. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  34. set _TARGETNAME $_CHIPNAME.cpu
  35. target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap
  36. $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
  37. # can't handle overlapping memory regions
  38. if { [info exists IMEMORY] && [string equal $IMEMORY true] } {
  39. flash bank ${_CHIPNAME}_info.flash mdr 0x08000000 0x01000 0 0 $_TARGETNAME 1 1 4
  40. } else {
  41. flash bank $_CHIPNAME.flash mdr 0x08000000 0x20000 0 0 $_TARGETNAME 0 32 4
  42. }
  43. # JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
  44. adapter speed 1000
  45. adapter srst delay 100
  46. if {[using_jtag]} {
  47. jtag_ntrst_delay 100
  48. }
  49. if {![using_hla]} {
  50. # if srst is not fitted use SYSRESETREQ to
  51. # perform a soft reset
  52. cortex_m reset_config sysresetreq
  53. }