Nuclei-Software / nuclei-linux-sdk

Nuclei RISC-V Linux Software Development Kit
Apache License 2.0
38 stars 9 forks source link

Using GDBREMOTE to do remote debug and upload freeloader #9

Open fanghuaqi opened 1 year ago

fanghuaqi commented 1 year ago

See https://github.com/Nuclei-Software/nuclei-linux-sdk/blob/dev_nuclei_next/Makefile#L172-L179.

If you are do linux sdk development in remote machine, and your board is connect to your local PC, and you want to upload or debug freeloader to your local PC, you can do the following steps:

Assume your are using SOC=evalsoc CORE=ux900fd

  1. run openocd -f conf/evalsoc/openocd.cfg in your local pc, make sure bindto 0.0.0.0 in openocd.cfg is uncommented
  2. get your local pc ip, such as 192.168.43.120
  3. In remote pc, you can do following command to upload or debug freeloader a) upload freeloader: make SOC=evalsoc CORE=ux900fd GDBREMOTE="192.168.43.120:3333" upload_freeloader b) debug freeloader: make SOC=evalsoc CORE=ux900fd GDBREMOTE="192.168.43.120:3333" debug_freeloader
fanghuaqi commented 1 year ago

You can also check how to debug in Nuclei Studio in https://github.com/Nuclei-Software/nuclei-linux-sdk/wiki/Debug-Linuxsdk-using-NucleiStudio