Version 4 (modified by 15 years ago) ( diff ) | ,
---|
Development Environment
Setup 825 Weight Indicator
- Connect serial port for debug messages.
- Connect Ethernet port for downloads and debugging
Make sure 825 indicator has bootloader and Linux kernel installed to flash. If necessary use USB-BDM and CodeWarrior or CFFlasher to program the flash. Power on the indicator and use bootloader to configure network settings, IP address, gateway, etc. Download Linux romfs image to flash or configure for NFS (Network File System) for testing with 825 indicator file system residing on test PC. Startup indicator Linux, debug serial port will show startup messages.
Setup Build Environment
- Free:
- GCC compiler – use command line tools – Must use Linux host, or Cygwin. GDB debugger, DDD graphical debugger.
- Purchase:
- CodeWarrior – MetroTrk debugger
- Sourcery G++ Coldfire uClinux version
Use Hyperterminal, Minicom or some other communications program for serial port debugging.
USB – BDM CodeWarrior or CF-Flasher is needed to flash boot-loader for new board.
Debugging
GDB
GDB is an open source debugger that is included in the CodeSourcery development package.
Using a terminal program such as Hyperterm to communicate with the 825 console at the “#” prompt type:
gdbserver :port progname [args] & (where port is the TCP/IP port to be used, and programe is the name of the program to be debugged)
For example:
gdbserver :10000 cardbas 788IDS.77X &
This will start the gdbserver process:
184
Process cardbas created; pid = 185
Listening on port 10000
From the PC you may then start debugging by selecting the “Debug” perspective and then clicking the “Bug” icon in Eclipse.
For example, the terminal will show:
Remote debugging from host 90.1.1.216
Breakpoints may be set by double-clicking the border just to the left of a program line in the editor.
F5 – Step Into (If stopped at a function call, this will step into the function)
F6 – Step Over (If stopped at a function call, this will step over to the next statement)
F8 – Resume (If stopped this will resume running)
The “Variables” window will automatically show the local variables that are in use.
Right-click in the “Variables” window and select “Add global Variables…” to select global variables to monitor. These will not appear until the next break.
To stop the debugging session from CodeSourcery click the red square icon. The application being debugged and the gdbserver will automatically exit.
The terminal window will show:
Killing inferior
It is also possible to set gdbserver to attach to an already executing process.
Determine the existing process ID first by using the PS command.
gdbserver :port – attach pid & (where port is the TCP/IP port number and pid is the process ID)
For example:
gdbserver :10000 –attach 187 &
When using the attach method stopping the debugging session from Eclipse may not stop gdbserver or the application.