Module: OrigenDebuggers::JLink::Custom
- Included in:
- OrigenDebuggers::JLink
- Defined in:
- lib/origen_debuggers/j_link.rb
Overview
Other methods can expose unique features of a given debugger
Instance Method Summary collapse
- #halt ⇒ Object
- #quit ⇒ Object
- #read_memory(address, options = {}) ⇒ Object
- #set_interface(interface) ⇒ Object
Instance Method Details
#halt ⇒ Object
380 381 382 |
# File 'lib/origen_debuggers/j_link.rb', line 380 def halt dw 'halt' end |
#quit ⇒ Object
384 385 386 |
# File 'lib/origen_debuggers/j_link.rb', line 384 def quit dw 'q' end |
#read_memory(address, options = {}) ⇒ Object
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/origen_debuggers/j_link.rb', line 388 def read_memory(address, = {}) = { number: 1, # number of items to read size: 8 # number of bits in each item }.merge() if [:size] == 32 dw "mem32 0x#{address.to_s(16).upcase}, #{options[:number].to_hex}" elsif [:size] == 16 dw "mem16 0x#{address.to_s(16).upcase}, #{options[:number].to_hex}" elsif [:size] == 8 dw "mem 0x#{address.to_s(16).upcase}, #{options[:number].to_hex}" # not sure difference between mem and mem8 else fail 'You must supply a valid :size option!' end end |
#set_interface(interface) ⇒ Object
369 370 371 372 373 374 375 376 377 378 |
# File 'lib/origen_debuggers/j_link.rb', line 369 def set_interface(interface) # set interface and reset value = interface == :swd ? 1 : 0 # set interface : JTAG=0, SWD=1 dw "si #{value}" # pull a reset now dw 'RSetType 2' # reset via reset pin which should be same as manual reset pin # toggle. Also forces CPU to halt when it comes out of reset dw 'r' # reset and halts the device (prob not needed) dw 'halt' # halt core just in case end |