Using debugger on MOD54415

Discussion to talk about software related topics only.
gary.richardson
Posts: 12
Joined: Thu Nov 24, 2011 1:31 pm

Using debugger on MOD54415

Post by gary.richardson »

Using NNDK 2.6.0.020 (BETA RELEASE) with a MOD54415 Rev 1.5 on a Mod-Dev-70 Rev 1.7 ( MOD54415 LC Development Kit) with the J2 pin 5 to J2 pin 2 fix, running an imported factory demo with one additional line in the menu section (iprintf( "debug test 1\r\n" );), open Eclipse, click the debug icon, acts like it downloads to the unit and the debugger connects. Shows 7 tasks running. If I have a breakpoint at this line when I perform the above steps it will break and I can single step. If I don't have a breakpoint when I start the debugger, when I try to place one I get:
Multiple markers at this line
- Line breakpoint: main.cpp
[line: 199]
- Unresolved breakpoint

An additional piece of information is that if I click the suspend icon the debugger doesn't successfully stop, it gives me a "Target request failed: Failed to interrupt." error popup. It will stop at the breakpoint that was located before the debugger was invoked, but trying to place one anyplace else causes the unresolved breakpoint warning.

Terminating the debugger also gives a "Target request failed: Failed to interrupt." error.

Leaving Eclipse running with the debugger "sort of" attached to that one breakpoint, I can use the Autoupdate program to put a new program in the unit. At that point the debugger does not work at all and will not reattach.

If I try the change to the InitializeNetworkGDB_and_Wait function I get:
G:\Netburner\projects\MOD54415FactoryApp\Debug/..\main.cpp:319: undefined reference to `InitializeNetworkGDB_and_Wait'

Under NBEclipse "Rebuild All System Files" it is doing the MOD5234. That would be incorrect, but how do I change it?
m68k-elf-g++ -c -m5206e -gdwarf-2 -Wall -fno-rtti -fno-exceptions -D_DEBUG -falign-functions=4 -DMOD5234 -DMCF5234 -DNBMINGW -I"C:\nburn/include" -I"C:\nburn/MOD5234/include" -I"C:\nburn/MOD5234/include/ETPU" -I"C:\nburn/MOD5234/include/ETPU/cpu" -I"C:\nburn/MOD5234/include/ETPU/sets" -I"C:\nburn/MOD5234/include/ETPU/functions_API" debugprintblock.cpp -o debugprintblock.od
m68k-elf-ar cr C:\nburn/lib/DBdebugLibrary.a debugprintblock.od
gary.richardson
Posts: 12
Joined: Thu Nov 24, 2011 1:31 pm

Re: Using debugger on MOD54415

Post by gary.richardson »

The "Rebuild All System Files" problem was corrected by going to properties for the project, then "Netburner options" "Target Platform" and touching the target platform, it was showing MOD5441X, but after I clicked the dropdown box, leaving it at MOD5441X and OK the next "Rebuild All System Files" was for the MOD5441X. However, that didn't help with any of the debugging issues. Just a wrong turn for me.
cfavreau
Posts: 29
Joined: Fri Jul 27, 2012 8:12 am

Re: Using debugger on MOD54415

Post by cfavreau »

Instead of InitializeNetworkGBD_and_Wait() I use this:

Code: Select all

#ifdef _DEBUG
InitializeNetworkGDB();
OSTimeDly(TICKS_PER_SECOND * 5);
#endif // _DEBUG
This waits 5 seconds for the debugger to hook up. It works on my system quite well however you may need to adjust how many seconds it waits.

If you put in the delay the debugger will probably catch your breakpoint properly... otherwise it takes some time for the debugger to actually attach to your code... which results in weird behavior if the processor executes past your breakpoint before the debugger gets going.

I also find that the and_Wait() function gives an undefined reference linker error.

GDB does not exit all the time for me so I have to kill the process in Task Manager often. Doing so will get rid of the failed to interrupt error.
gary.richardson
Posts: 12
Joined: Thu Nov 24, 2011 1:31 pm

Re: Using debugger on MOD54415

Post by gary.richardson »

The reason InitializeNetworkGBD_and_Wait() is undefined is that netwait.cpp is commented out in the makefile for the MOD5441X. After I included it in the makefile I was able to get a clean compile. Still having problems getting the debugger to connect.

Netwait.cpp was not in the make file for the MOD5441X in “C:\nburn\MOD5441X\system\makefile”.

From the makefile:
#
CXXSRCS := \
serial.cpp \
ethernet.cpp \
etherprint.cpp \
emulticast.cpp \
ioboard.cpp \
pins.cpp \
mmc_mcf.cpp \
ethernetauxdb.cpp\
etherhardware.cpp \
rtc.cpp \
i2cmaster.cpp \
netwait.cpp \
# mmc_mcf.cpp \
cfavreau
Posts: 29
Joined: Fri Jul 27, 2012 8:12 am

Re: Using debugger on MOD54415

Post by cfavreau »

where do you find the makefile for the platform?

I found netwait.cpp (in which I included the code for waiting for the debugger in place of the delay I had before...).

Code: Select all

	
while(!GDBDebugConnected()) asm(" nop");
Thanks!
gary.richardson
Posts: 12
Joined: Thu Nov 24, 2011 1:31 pm

Re: Using debugger on MOD54415

Post by gary.richardson »

Mine was located at “C:\nburn\MOD5441X\system\makefile”, check your install path it should be there.
User avatar
Forrest
Posts: 286
Joined: Wed Apr 23, 2008 10:05 am

Re: Using debugger on MOD54415

Post by Forrest »

Hello,

We have found and fixed some debugging issues in the current beta. These fixes made it in to the new beta, which is being uploaded right now. I'll post release notes and a link today.
Forrest Stanley
Project Engineer
NetBurner, Inc

NetBurner Learn Articles: http://www.netburner.com/learn
gary.richardson
Posts: 12
Joined: Thu Nov 24, 2011 1:31 pm

Re: Using debugger on MOD54415

Post by gary.richardson »

Tried 2.6.0.025 and when I "Rebuild All System Files" this error appears:
m68k-elf-g++.exe: release_data.cpp: No such file or directory

I did a search for release_data.cpp that is listed in the makefile and it does not exist. Removed it from the makefile and I can then rebuild the files.

The new beta did fix the netwait.cpp not being in the \MOD5441X\system makefile.

The debugger did not improve. I get a "Launching projectname: (44%)" and icon in the lower right corner, but then it leaves and the debugger does not connect.
seulater
Posts: 445
Joined: Fri Apr 25, 2008 5:26 am

Re: Using debugger on MOD54415

Post by seulater »

I too had a similar problem with NNDK 2.6.0.025, but mine complained about "release_tag.cpp: No such file or directory"


The big problem for me is that i wiped out NNDK 2.6.0.020, figuring that 0.25 would be the cure for many problems.
So not i have nothing to go back to. Also, i would like to see them go back to naming the file name with the version number.
gary.richardson
Posts: 12
Joined: Thu Nov 24, 2011 1:31 pm

Re: Using debugger on MOD54415

Post by gary.richardson »

Mine was the same as yours I just typed it in wrong. The file next to it was "release_tagdata.cpp" and I was using that to remember what file I removed. So indeed "release_tag.cpp" is listed in the makefile but does not exist. There is a "release_tag" no extension in the "\nburn" directory.
Post Reply