Page 1 of 1

Remote debugging using GDB server

Posted: Thu Jan 26, 2017 1:27 pm
by marozak
Hello,

I'm facing a problem with remote debugging on VoCore2. My configuration is:

- VoCore2 Ultimate
- Ubuntu 16.04 LTS (on VMvare 12 Player)
- Eclipse IDE for C/C++ Developers - Version: Neon.2 Release (4.6.2)
- toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2

With this configuration I get these errors (step into, step over, step return are disabled in this case - don't know why):
Image

Sometimes it will stay freezed on 57% during launching like here:
Image

I also tried to google it and found the example on this link: http://noblepepper.com/vocorewiki/doku. ... iki:remote
but Noblepepper uses different toolchain build_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/gdb-linaro-7.6-2013.05/gdb/gdb than yours recommended. Maybe debugging will work with Nobleppepper toolchain but where did he find this toolchain?

Was anybody successful with debugging?

Re: Remote debugging using GDB server

Posted: Sun Feb 05, 2017 1:44 am
by Vonger
I upload a source to vocore.io/v2, Source/Software, maybe you can compile it there, then gdb might work

Re: Remote debugging using GDB server

Posted: Sun Feb 05, 2017 6:05 am
by noblepepper
That wiki page was about the original version VoCore so there are some differences to the new VoCore2.

I started revising my wiki in December and it is in bad shape since I never completed the revisions to add VoCore2 but there is some good info in there. The page you reference is part of the set up a development environment section. The first three steps are specific to the original VoCore but luckily all that is already done when you download Vonger's sources.

So:
Skip steps 1, 2 & 3, instead download Vonger's sources, untar them and cd into the directory created.
I hit an error if I compile as is, to fix this I run
Code: Select all
make menuconfig

Find libghoto under Libraries and disable it (press space bar until it looks like this < > not <*> or <M>)

Step 4 is how I build OpenWrt, there are many variations but if you don't already have a preference just use my method.

Step 5 uses the image name for the VoCore original (openwrt-ramips-rt305x-vocore-squashfs-sysupgrade.bin) the image for VoCore2 is named openwrt-ramips-mt7628-vocore2-squashfs-sysupgrade.bin

Now Step 6 (the page you were looking at) should work much better.

Re: Remote debugging using GDB server

Posted: Sun Feb 05, 2017 1:58 pm
by noblepepper
Last night I had troubles with Eclipse, when I put together those instructions (back in 2015) everything worked but things have changed on my system since then and neon doesn't like my java sdk anymore. I uninstalled/reinstalled java and switched to mars and it is happy now. This sort of crap is why I HATE JAVA, if a language can't be minimally compatible between the gobs of versions it has I don't even want to start to learn it! Anyway, if you have trouble try Eclipse Mars. All this has nothing to do with OpenWrt or VoCore, it is Eclipse/Java !@#$%^&*(!!! Eclipse has some great features but I really wish it was based on a workable language instead of the steaming pile of shit that Java is (can you tell I don't care for Java?) Eclipse can also be frustrating and confusing to set up, many options look very similar to other options, make sure you follow the instructions exactly, I just did it and it does work. If things don't look like what I describe back up a few steps and make sure you did it just like the instructions. I wrote the instructions and I have to do that!

Once you get Eclipse working there are a couple more aggravations to deal with. You should really do this before you set up Eclipse but it doesn't matter much except you need to do it before Step 7 (Use Eclipse to connect to VoCore).
1. If you are using a VoCore2 withOUT a sdcard slot you will get an endless stream of
Code: Select all
Sun Feb  5 12:40:36 2017 kern.err kernel: [   34.810000] mmc0: error -22 whilst initialising SDIO card
Sun Feb  5 12:40:36 2017 kern.warn kernel: [   34.840000] mtk-sd 10130000.sdhci: no support for card's volts
on the UART console, to kill this crap you need to hit enter and then
Code: Select all
rmmod mtk-sd

This will come back when you reboot, to prevent this add the rmmod command to /etc/rc.local so it looks like this:
Code: Select all
root@vocore2:/# cat /etc/rc.local
rmmod mtk-sd
uci set wireless.sta.disabled=0
uci commit
/etc/init.d/network restart
sleep 10
uci set wireless.sta.disabled=1
uci commit
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

exit 0
root@vocore2:/#
Now you will still see the error messages but it will shut up once rc.local kicks in.

2. When you do
Code: Select all
 opkg update
you will get a scary message about a missing repo, it really doesn't hurt anything but to get rid of the message delete the line in /etc/opkg/distfeeds.conf that has "linkit" in it so it looks like this:
Code: Select all
root@vocore2:/# cat /etc/opkg/distfeeds.conf
src/gz chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/base
src/gz chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/packages
src/gz chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/luci
# src/gz chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/routing
# src/gz chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/telephony
# src/gz chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7628/packages/management
root@vocore2:/#


I started the wiki update after my VoCore2 Ultimate shipped and wanted to be sure my changes matched the production units so I stopped. I really need to get the wiki fixed up but that is a different squirrel in a different tree from where I am now. The Ultimate actually showed up last week (>2 months transit, I have sent containers on a freighter and beat that time by alot!) so I will get back to it soon. If you want to sign up and work on the wiki I'll be more than willing to help if you hit trouble.