MPS2+ with OpenOCD

Is it possible to use MPS2+ with OpenOCD and GDB ? 

If so, can you please provide config files for OpenOCD ?

Thank you!

Parents
  • Hi,

    now I managed to get it work. More by trial and error then by "knowing what I am doing". But anyhow, it seems to work. But keep in mind that the provided script is surely not optimal.

    Make  the following config file called, say "MPS2.cfg":

    # Main file for MPS2+
    
    set TARGETNAME MPS2
    set CPUTAPID 0x2ba01477
    
    interface cmsis-dap
    
    transport select swd
    
    swd newdap $TARGETNAME cpu -irlen 4 -expected-id $CPUTAPID
    
    target create $TARGETNAME.cpu cortex_m -chain-position $TARGETNAME.cpu
    
    $TARGETNAME.cpu configure -event gdb-attach { halt }
    
    adapter_khz 1000
    
    # delays on reset lines
    adapter_nsrst_delay 200
     

    start openocd in a terminal:
    $ sudo openocd -f MPS2.cfg

    start gdb for ARM in another terminal:
    $ arm-none-eabi-gdb

    in the arm shell  connect to the opencod:
    (gdb)  target remote localhost:3333

    in the openocd terminal you should see some text like this one 

    Info : accepting 'gdb' connection on tcp/3333
    target halted due to debug-request, current mode: Thread

Reply Children
No Data