How to use the command line with redlinkserv to enable gdb?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the command line with redlinkserv to enable gdb?

1,424 Views
markrichardson
Contributor I

I can successfully debug via the GUI (on both my LPC1347 and LPC1549 boards), but I just can't find any information on how to debug from the command line. I am familar with using gdbserver and gdb, but just can't understand how to initialise the redlinkserv so that I can then use gdb.

I have tried the following, but the gdb fails to connect.

boot_link2
redlinkserv.exe --telnetport=3025,3050
arm-none-eabi-gdb --quiet --command=run.gdb

Tags (1)
0 Kudos
4 Replies

581 Views
markrichardson
Contributor I

Ok this is now working, thanks for the help. I first run boot_link1.cmd and then start gdb and use "target extended-remote | crt_emu_cm_redlink -g -mi -2 -pLPC1347 -vendor=NXP -reset= -flash-driver=LPC11_12_13_64K_8K.cfx "

This works, but everytime I seem to have to unplug and reconnect the board, is there someway to avoid this?

0 Kudos

581 Views
markrichardson
Contributor I

Thanks for the reply, I have tried to use the JLink, but it refuses to connect.

I have also captured the gdb console output and tried to connect from gdb using "target extended-remote | crt_emu_cm_redlink -msg-port=63289 -g -mi -2 -pLPC1347 -vendor=NXP -reset= -ProbeHandle=1 -CoreIndex=0 -flash-driver=LPC11_12_13_64K_8K.cfx", but this just resulted in " Cannot open GDB connection on localhost:63289 - connect failed - rc 10061"

0 Kudos

581 Views
thefallguy
Contributor IV

Remove the -msg-port=NNNNN option. It is also safe to remove ProbeHandle and CoreIndex options as it will automatically select the 1st probe and the first core (those options are really only necessary for multi-core and multi-probe configurations). So, you should be able to use:

crt_emu_cm_redlink -g -mi -2 -pLPC1347 -vendor=NXP -reset= -flash-driver=LPC11_12_13_64K_8K.cfx
0 Kudos

581 Views
thefallguy
Contributor IV

redlinkserv is NOT a gdbserver and it cannot be used as one.

With LPCXpresso, if you want to use gdb from the command line, you need to use one of the crt_emu* programs (which one, depends on your target) as a remote target within GDB. The best way of working out what you need to do is to start a debug session from within LPCXpresso and then look at the GDB console - you will see the commands that are being issued to GDB.

Note1: that there have been some changes with the new MCUXpresso product, but, AFAIK, it does not use a gdbserver when used with LPC-Link1/2.

Note2: LPCXpresso does also work J-Link which is a gdbserver. In the new MCUXpresso product, J-Link is natively supported.

0 Kudos