- Using Interfaces (GPIO, UART, SPI, ...)
- Building an initial ramdisk without root permission
- Creating a JFFS2 image from a directory structure
- SAM-BA : Flashing taskit's ARM-based boards
- Flashing new u-boot on Portux920T / Portux Panel-PC
- Implementing an own boot-logo for Panel-Card
- Nano-X with tslib support
- Using Watchdog on Stamp9G20 or PortuxG20
- Development with Eclipse
- Installing Debian/GNU Linux on Stamp9G20 and PortuxG20
- Using Xenomai on PortuxG20/Stamp9G20
- Installing a rootfs on SD card
- Using Power Management Features
- Using the NAND flash on NanosG20
- Using the buzzer on PortuxG20 rev. 2 and NanosG20
Run and debug remotely
Last edited by cglindkamp on Tue, 09/06/2011 - 10:48
Before you can run and debug your application remotely, you have to make the files available to the target device. The best way to do that is via an NFS mount. Therefore export your workspace in the NFS configuration /etc/exports. It could look like this:
/home/taskit/workspace *(ro)
Now reload the exports, e.g.:
/etc/init.d/nfs-kernel-server reload
After that, you can mount the workspace on your device by entering the following command on the serial console:
mount host:/home/taskit/workspace /mnt -o nolock,tcp
Replace host (your workstation) and the path according to your setup. This step has to be repeated every time you reboot the target.
Now that your device can access the files, it is time to create the run and debug configurations. To do that, activate menu Run -> Run Configurations. There, double-click "C/C++ Remote Application" and you should get the following dialog:
Eclipse - Default run configuration
In this dialog choose the remote connection you have previously configured, enter the absolute path of the binary on the target device and enable the checkbox "Skip download to target path.". If you configured an SSH connection with SFTP, you can also browse the target to enter the path. See the next screenshot for reference:
Eclipse - Adjusted run configuration
While you are at it, you can also set the correct gdb used for debugging. Here, the gdb from the Ångström toolchain is used:
Eclipse - GDB settings
If you have an older product where the arm-linux-3.4.2- toolchain is used, you might get problems when using its debugger with Eclipse. But you can here also use the gdb from the Ångström toolchain or any other newer arm-gdb. You can find one on a new enough Starterkit-CD in the directory for the Stamp9G20/PortuxG20 or you can use this toolchain: http://www.armbedded.eu/download/taskit-0.1/sdk/taskit-0.1-arm-linux-gnu...
The setup is now finished and you can click on "Run". This starts the application on the target should result in the following output:
Eclipse - Remote Run
A debug configuration was automatically created. You can run it by clicking the arrow right of the bug toolbar icon and choose it from the items. The debugger is now started and your are asked to switch to the debug perspective - answer yes. It should now look like this:
You can now debug (single step, inspect variables, ...) as if it was a local application.
It might be, that while starting the debugger, the following warning pass by in the console window:
.gdbinit: No such file or directory. [New Thread 1285] warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. warning: .dynamic section for "/usr/lib/libstdc++.so.6" is not at the expected address (wrong library or version mismatch?) warning: .dynamic section for "/lib/libm.so.6" is not at the expected address (wrong library or version mismatch?) warning: .dynamic section for "/lib/libgcc_s.so.1" is not at the expected address (wrong library or version mismatch?) warning: .dynamic section for "/lib/libc.so.6" is not at the expected address (wrong library or version mismatch?) Error while mapping shared library sections: /lib/ld-linux.so.3: No such file or directory.
The first line is not really a problem but will vanish as a side effect of the change to remove the other warnings. Create a file called ".gdbinit" in the root directory of your project. In this file you can enter gdb commands that are executed before the debug is started. We need to set the sysroot to get rid of the warnings above. This is done by adding the following line to this file:
set sysroot /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/
Adjust the path if you use another toolchain.

