View previous topic :: View next topic |
Author |
Message |
jure_m
Joined: 14 Jan 2005 Posts: 68 Location: Ljubljana
|
Posted: Wed Jan 20, 2010 12:08 am Post subject: Debugging in AVR Studio |
|
|
Hi all,
this thread gave me a "kick" this afternoon until I've done it (thanks Luciano!).
I was using JTAG ICE clone, like this one, after few hours I have connected it to ATmega32 uC, then I followed Luciano's tip how to start OBJ code generated with Bascom in the AVR studio. There was one small change: simulator that I selected was JTAG ICE - and voila: I can step into code with actual debugging on real micro controller. When I press STOP, program inside uC stops, steps by step etc. As far as I test all seems to work nice
It's rather late hour now so I will stop my work now, but will report soon more about this interesting topic.
Best regards
Jure |
|
Back to top |
|
|
jure_m
Joined: 14 Jan 2005 Posts: 68 Location: Ljubljana
|
Posted: Thu Feb 04, 2010 7:15 pm Post subject: |
|
|
Hi,
just a short update on that topic.
I have used JTAG ICE with Bascom OBJ code with success. I could also change variables and see immediate effect on running program.
I will shortly report how goes on debugging with interrupt routines.
Best regards
Jure |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Thu Feb 04, 2010 11:26 pm Post subject: |
|
|
Yes, it works really well. But the one thing Bascom misses is that it does not generate an ELF file. If it did, you would have the named variables available in AVR Studio, and could watch the variables change as you run the code. With just the .obj module, you must look at the memory locations to see the changes. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Sat Feb 06, 2010 8:57 pm Post subject: |
|
|
Adrian,
have you developed some "system" to view the changing variables for us less-experienced users to adopt and use? For example: a variable memory map, hex converter, etc??
Ennio |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Sun Feb 07, 2010 1:08 am Post subject: |
|
|
@enniom
No, I never had those tools when I grew up with using ASM on micro controllers, so I got used to looking at raw memory dumps to find out what is going on. With Bascom, the compiler report gives the variable locations, and I just use that alongside AVR Studio. But then I have done it that way for 30+ years. Some better tools would be nice, but I am usually too busy writing applications to write tools. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
laborratte
Joined: 27 Jul 2005 Posts: 299 Location: Berlin
|
Posted: Thu Feb 11, 2010 6:36 pm Post subject: |
|
|
I wrote a small tool for viewing vars in AVR-Studio some years ago (see attached file). Sometimes it is helpfull.
Usage from commandline:
Code: | avrmapbuilder YourProgramm.rpt YourProgramm.map |
It generates a .MAP-File like the AVR Assembler from a Bascom .RPT-File. If the MAP File is in the same Directory as your .OBJ-File, AVR Studio recognized it and you can use the watch window for your variable names.
But it is still assember-like, so you can only watch byte values. My workaround is splitting word or long-vars like that:
Code: | BASIC:
dim bOne as byte
dim wTwo as word
dim lThree as long
watch-vars:
bOne
wTwo_L '(Low-byte of wTwo)
wTwo_H '(High-byte of wTwo)
lThree_LL '(Lowest byte of lThree)
lThree_LH
lThree_HL
lThree_HH '(Highest byte of lThree) |
Arrays are also recognized. Just look into the generated .MAP file for details.
It is a small tool I wrote for myself, so don't expect a user interface, cool sound effects or updates and improvements. Also the watch windows in AVR_studio seems sometimes a little bit buggy (like the disassembler view).
For shure: it would be much nicer, if BASCOM would generate a .ELF-File (or even better: a .COFF-File). Oh please, Mark, please..... |
|
Back to top |
|
|
enniom
Joined: 20 Oct 2009 Posts: 537
|
Posted: Thu Feb 11, 2010 6:47 pm Post subject: |
|
|
Thank-you Laborratte - this is a great start.
Do you think we can help Mark by laying out the requirements of an *.ELF file? |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Thu Feb 11, 2010 11:34 pm Post subject: |
|
|
@laborratte
Nice !
Maybe now the hard work of the XMega stuff is out of the way, Mark might have time. *Please* _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
jure_m
Joined: 14 Jan 2005 Posts: 68 Location: Ljubljana
|
Posted: Fri Feb 12, 2010 11:06 pm Post subject: |
|
|
AdrianJ wrote: | Yes, it works really well. But the one thing Bascom misses is that it does not generate an ELF file. If it did, you would have the named variables available in AVR Studio, and could watch the variables change as you run the code. With just the .obj module, you must look at the memory locations to see the changes. |
Well, actually you can watch variables in the Memory window. In Bascom report file you can find address of all variables, then you can access these variables within AVR Studio and monitor/change them.
Best regards |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Feb 12, 2010 11:43 pm Post subject: |
|
|
Hi
I should visit the forum more often
Very nice to see this.
I wanted to support COFF but got reply from atmel that they will not support it anymore. ELF is the way to go.
I did not got very clear info on ELF.
I am happy to generate all the required info for COFF or ELF.
Or even the map if that will work for all variables.
While Xmega is done for a big part it is not finished. Things like timers and other hardware need to be handled. Of course you can access all registers and most users that need to use Xmega should be able to do so, but to say it is finished, no.
After i released the IDE beta (which was scheduled for last Xmas ), i will continue xmega support.
So any help would be great
you can contact me at mark at youknow which domain
Also, do you know ISIS simulator? They added bascom DBG format. You can simulate and watch variables. I found it more convenient then Studio. Especial all the hardware you can simulate ! _________________ Mark |
|
Back to top |
|
|
MHz
Joined: 28 Sep 2007 Posts: 123
|
Posted: Sat Aug 21, 2010 7:44 am Post subject: |
|
|
Hi Mark,
watching variables in AVR studio is still an issue. Is there any progress I have missed
Regards |
|
Back to top |
|
|
PatchleAD
Joined: 09 Apr 2006 Posts: 145
|
Posted: Thu Aug 26, 2010 11:01 pm Post subject: |
|
|
damn ... That ISIS looks sweet..... will need to look into it to see if it can import my Altium Designer circuits or is i need to re-draw them.... |
|
Back to top |
|
|
ex4
Joined: 13 Jan 2006 Posts: 1062 Location: indonesia
|
Posted: Fri Aug 27, 2010 12:43 am Post subject: |
|
|
Quote: | damn ... That ISIS looks sweet..... will need to look into it to see if it can import my Altium Designer circuits or is i need to re-draw them.... |
ehem..ehemm...
hope someone dont mind on this word 'damn' , hehehehe
Altium, wow....
i thought altium specially made only for FPGA(thats what the Altium guy from Singapore told me on the phone) |
|
Back to top |
|
|
PatchleAD
Joined: 09 Apr 2006 Posts: 145
|
Posted: Fri Aug 27, 2010 2:26 am Post subject: |
|
|
.... i must have miss spelled it .. I ment to say Dam.... and in the big pool of water...
It is a massive package, I do not use it for the programming and simulation side (did not pay for it).... It is a great circuit and PCB design package but..
and I just got a email on the import into the ISIS ... It is a big NO.... |
|
Back to top |
|
|
ex4
Joined: 13 Jan 2006 Posts: 1062 Location: indonesia
|
Posted: Fri Aug 27, 2010 2:37 am Post subject: |
|
|
mmm, yes it is a big package
a friend of mine using it. jeez about 2GB of files
but when i tell him about proteus,he just make a big woowww |
|
Back to top |
|
|
|