Arduino Forum

Development => Other Software Development => Topic started by: Vanyamba on Feb 02, 2011, 07:47 am

Title: Simple Dumping Monitor
Post by: Vanyamba on Feb 02, 2011, 07:47 am
Simple Dumping Monitor library for ATmega168/ATmega328p based Arduino boards allows you to dump registers, timer states, interrupts and memories, either RAM, Flash and ROM.

Starting with version 0.6 simple symbolic debugger functions were added.

Being compiled, the library requires near 11 KBytes of Flash memory and requires less than 1 KByte of RAM (227 Bytes for dumpmon.pde example, 377 Bytes for dumpmonDebug.pde example).

In order to use the library, you should download library's archive, unpack it to libraries directory of the Arduino IDE Software directory. As result it would be libraries/DumpMon directory created.

There are two sketches inside the DumpMon/Examples directory:


After successful compilation and uploading of the sketch into Arduino board, open Serial Monitor window and set the correct USART speed (it uses 19200 in examples). Then use following commands to dump microcontroller states:


Addresses are hexadecimal only. Comands and addresses could be entered in both upper and lower cases.

More about debugging functions of the library http://arduino.cc/forum/index.php/topic,51910.0.html (http://arduino.cc/forum/index.php/topic,51910.0.html)

Download DumpMon http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon-0.7.tar.gz (17,7 KB)

Attach below is version 0.1. Current version is 0.7. Please download DumpMon with link above.
Title: Re: Simple Dumping Monitor
Post by: graynomad on Feb 02, 2011, 08:49 am

Downloaded and installed in the arduino-0021/libraries folder, then read dumpmonBlink.pde into the IDE and get this when I compile

dumpmonBlink.cpp:4:57: error: dumpmon.h: No such file or directory
dumpmonBlink.cpp: In function 'void setup()':
dumpmonBlink:9: error: 'dumpmonSetup' was not declared in this scope
dumpmonBlink.cpp: In function 'void loop()':
dumpmonBlink:13: error: 'dumpmonLoop' was not declared in this scope

I don't normally use the IDE so don't know what to tweak.

______
Rob

Title: Re: Simple Dumping Monitor
Post by: Vanyamba on Feb 02, 2011, 11:35 am

Downloaded and installed in the arduino-0021/libraries folder, then read dumpmonBlink.pde into the IDE and get this when I compile
dumpmonBlink.cpp:4:57: error: dumpmon.h: No such file or directory


It doesn't see DumpMon library at libraries folder.
Please try to restart Arduino IDE.
I've got some auto-reset issues with 0021 version. So I could recomend to install 0022.
Title: Re: Simple Dumping Monitor
Post by: graynomad on Feb 02, 2011, 01:12 pm
OK I've managed to have a dump, thanks.

Still with 21, I guess the IDE only reads the include paths when it boots.

BTW, I'm writing something similar but mine is different in that it uses some hardware to reduce the footprint on the target system.

______
Rob
Title: Re: Simple Dumping Monitor
Post by: Vanyamba on Feb 02, 2011, 02:02 pm
That's great!  :)

I've just updated Simple Dumping Monitor. Current version is 0.3.
http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon.tar.gz

'\r' added to '\n' to use it with 'screen'. http://swoolley.org/man.cgi/1/screen
Title: Version 0.5. Interrupts added!
Post by: Vanyamba on Feb 10, 2011, 07:57 pm
Version 0.5 of DumpMon is now available.
Major update is the interrupts table dump added. This is so cool. :)
http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon-0.5.tar.gz (http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon-0.5.tar.gz)
Title: Re: Simple Dumping Monitor
Post by: graynomad on Feb 11, 2011, 07:06 am
Just downloaded, works well, just needs full symbolic debugging :)

______
Rob
Title: Version 0.6. Some symbolic debugging added.
Post by: Vanyamba on Feb 11, 2011, 01:14 pm

Just downloaded, works well, just needs full symbolic debugging :)


Thanks, Rob. It was hard work but...

Download DumpMon version 0.6 and use new advanced debug features! :)
http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon-0.6.tar.gz (http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon-0.6.tar.gz)

See dumpmonDebug example in order how to use symblic debug functions.

New commands added:


:)
Title: Re: Simple Dumping Monitor
Post by: westfw on Feb 12, 2011, 06:04 pm
How does this compare in size and complexity to an implementation that would support remote access from gdb?
I think there are some sample gdb for AVR out there...
Title: Re: Simple Dumping Monitor
Post by: Vanyamba on Feb 12, 2011, 06:47 pm

How does this compare in size and complexity to an implementation that would support remote access from gdb?


Debugging with AVR-GDB is made through JTAG interface with AVR ICE (In-Circuit Emulator).
This is much different way to debug. User can set breakpoint at any address of program without reprogramming of the Flash memory.
Title: Re: Simple Dumping Monitor
Post by: westfw on Feb 13, 2011, 06:52 am
Quote
Debugging with AVR-GDB is made through JTAG interface with AVR ICE (In-Circuit Emulator).

Debugging with AVR-GDB is USUALLY done using JTAG or other debug interface, but gdb also has a "remote" protocol that can send the data over an ordinary serial line using a "stub" piece of software in the target  (See http://www.hex-rays.com/idapro/idadoc/1335.shtml for instance.)  Most reasonably complete "monitor" programs are pretty close to having all the features needed by the gdb remote protocol (but the parsing tends to be simpler for gdb remote.)
Title: Re: Simple Dumping Monitor
Post by: Vanyamba on Feb 13, 2011, 10:26 am

Debugging with AVR-GDB is USUALLY done using JTAG or other debug interface, but gdb also has a "remote" protocol that can send the data over an ordinary serial line using a "stub" piece of software in the target  (See http://www.hex-rays.com/idapro/idadoc/1335.shtml for instance.)


As I know, AVR ICE is an "Arduino as ISP programmer" board, which implements GDB Remote Serial Protocol for debugging via JTAG. This is more universal programmer, because it can be used with any AVR microcontrollers. I guess, AVR JTAG protocol is proprietary.

Most reasonably complete "monitor" programs are pretty close to having all the features needed by the gdb remote protocol (but the parsing tends to be simpler for gdb remote.)


You want to know, does it to implement RSP is more difficult than to implement state machine with three switch case construction in three functions (dumpmonlib.cpp)? No, it's not more difficult, but it requires more Flash memory and more RAM, and it should work at bootloader memory (sketches work at program memory).
Title: Available RAM function added
Post by: Vanyamba on Mar 01, 2011, 03:51 am
Show available RAM function added in version 0.7.

http://sites.google.com/site/vanyambauseslinux/home/fajlovyj-menedzer/DumpMon-0.7.tar.gz
Title: Re: Simple Dumping Monitor
Post by: WillR on Mar 01, 2011, 06:20 am
I just got this error...

D:\Arduino\arduino-0022\libraries\DumpMon\registers.cpp: In function 'void getRegisters(registers_t*)':
D:\Arduino\arduino-0022\libraries\DumpMon\registers.cpp:148: error: 'PRR' was not declared in this scope

See entire output below....

Code: [Select]
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon C:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\dumpmon.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\dumpmon.cpp.o
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon -ID:\Arduino\arduino-0022\libraries\DumpMon\utility D:\Arduino\arduino-0022\libraries\DumpMon\dumpdebug.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\DumpMon\dumpdebug.cpp.o
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon -ID:\Arduino\arduino-0022\libraries\DumpMon\utility D:\Arduino\arduino-0022\libraries\DumpMon\dumpmonlib.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\DumpMon\dumpmonlib.cpp.o
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon -ID:\Arduino\arduino-0022\libraries\DumpMon\utility D:\Arduino\arduino-0022\libraries\DumpMon\interrupts.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\DumpMon\interrupts.cpp.o
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon -ID:\Arduino\arduino-0022\libraries\DumpMon\utility D:\Arduino\arduino-0022\libraries\DumpMon\memory.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\DumpMon\memory.cpp.o
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon -ID:\Arduino\arduino-0022\libraries\DumpMon\utility D:\Arduino\arduino-0022\libraries\DumpMon\printpgm.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\DumpMon\printpgm.cpp.o
D:\Arduino\arduino-0022\hardware\tools\avr\bin\avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=22 -ID:\Arduino\arduino-0022\hardware\arduino\cores\arduino -ID:\Arduino\arduino-0022\libraries\DumpMon -ID:\Arduino\arduino-0022\libraries\DumpMon\utility D:\Arduino\arduino-0022\libraries\DumpMon\registers.cpp -oC:\Users\dave\AppData\Local\Temp\build7581516507984079922.tmp\DumpMon\registers.cpp.o
D:\Arduino\arduino-0022\libraries\DumpMon\registers.cpp: In function 'void getRegisters(registers_t*)':
D:\Arduino\arduino-0022\libraries\DumpMon\registers.cpp:148: error: 'PRR' was not declared in this scope


This is the version 7

So no luck...

Title: Re: Simple Dumping Monitor
Post by: Vanyamba on Mar 01, 2011, 10:23 am

-mmcu=atmega2560


Currently I am working on ATmega2560 support.  ;)
Title: Re: Simple Dumping Monitor
Post by: WillR on Mar 01, 2011, 07:35 pm


-mmcu=atmega2560


Currently I am working on ATmega2560 support.  ;)


NOW you tell me!  ]:D

I await eagerly....
Title: Re: Simple Dumping Monitor
Post by: b_l on Feb 13, 2018, 11:23 am
I just installed DumpMon 0.34 today and I got an error message complaining about ve_avr.h file not found in breakisr.cpp during compilation of dumpmonBlink sketch.
Fortunately the ChangeLog mentions ve_avr.h was renamed to ve_avr_dumpmon.h in version 0.34.. easy to fix.

Thanks a lot for your great work
Title: Re: Simple Dumping Monitor
Post by: swctrlhw on Aug 06, 2018, 03:45 pm
Hello,

Try to compile the simple "dumpmon.ino" example and get following error.

I copied all the file into  Arduino library directory.  Where can I download the latest release?


Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"

WARNING: Category 'Device' in library Wio LTE Arduino Library is not valid. Setting to 'Uncategorized'
Build options changed, rebuilding all
C:\Users\dtran.TECOMSYS\Documents\Arduino\libraries\DumpMon\breakisr.cpp:12:20: fatal error: ve_avr.h: No such file or directory

 #include "ve_avr.h"

                    ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.