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.
 
 
 
 
 
 

52 lines
1.2 KiB

  1. #
  2. # Silicon Labs (formerly Energy Micro) EFM32 target
  3. #
  4. # Note: All EFM32 chips have SWD support, but only newer series 1
  5. # chips have JTAG support.
  6. #
  7. source [find target/swj-dp.tcl]
  8. if { [info exists CHIPNAME] } {
  9. set _CHIPNAME $CHIPNAME
  10. } else {
  11. set _CHIPNAME efm32
  12. }
  13. # Work-area is a space in RAM used for flash programming
  14. # By default use 2kB
  15. if { [info exists WORKAREASIZE] } {
  16. set _WORKAREASIZE $WORKAREASIZE
  17. } else {
  18. set _WORKAREASIZE 0x800
  19. }
  20. if { [info exists CPUTAPID] } {
  21. set _CPUTAPID $CPUTAPID
  22. } else {
  23. if { [using_jtag] } {
  24. set _CPUTAPID 0x4ba00477
  25. } {
  26. set _CPUTAPID 0x2ba01477
  27. }
  28. }
  29. swj_newdap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  30. dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
  31. adapter speed 1000
  32. set _TARGETNAME $_CHIPNAME.cpu
  33. target create $_TARGETNAME cortex_m -dap $_CHIPNAME.dap
  34. $_TARGETNAME configure -work-area-phys 0x10000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
  35. set _FLASHNAME $_CHIPNAME.flash
  36. flash bank $_FLASHNAME efm32 0 0 0 0 $_TARGETNAME
  37. if {![using_hla]} {
  38. # if srst is not fitted use SYSRESETREQ to
  39. # perform a soft reset
  40. cortex_m reset_config sysresetreq
  41. }