Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Debugging in AVR Studio
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 61
Location: Ljubljana

slovenia.gif
PostPosted: Wed Jan 20, 2010 12:08 am    Post subject: Debugging in AVR Studio Reply with quote

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 Very Happy

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
View user's profile Visit poster's website
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 61
Location: Ljubljana

slovenia.gif
PostPosted: Thu Feb 04, 2010 7:15 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2472
Location: Queensland

australia.gif
PostPosted: Thu Feb 04, 2010 11:26 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 474

PostPosted: Sat Feb 06, 2010 8:57 pm    Post subject: Reply with quote

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
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2472
Location: Queensland

australia.gif
PostPosted: Sun Feb 07, 2010 1:08 am    Post subject: Reply with quote

@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
View user's profile Visit poster's website
laborratte

Bascom Expert



Joined: 27 Jul 2005
Posts: 262
Location: Berlin

germany.gif
PostPosted: Thu Feb 11, 2010 6:36 pm    Post subject: Reply with quote

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
View user's profile
enniom

Bascom Member



Joined: 20 Oct 2009
Posts: 474

PostPosted: Thu Feb 11, 2010 6:47 pm    Post subject: Reply with quote

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
View user's profile
AdrianJ

Bascom Expert



Joined: 16 Jan 2006
Posts: 2472
Location: Queensland

australia.gif
PostPosted: Thu Feb 11, 2010 11:34 pm    Post subject: Reply with quote

@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
View user's profile Visit poster's website
jure_m

Bascom Member



Joined: 14 Jan 2005
Posts: 61
Location: Ljubljana

slovenia.gif
PostPosted: Fri Feb 12, 2010 11:06 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5061
Location: Holland

blank.gif
PostPosted: Fri Feb 12, 2010 11:43 pm    Post subject: Reply with quote

Hi

I should visit the forum more often Smile
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 Sad ), i will continue xmega support.

So any help would be great Smile
you can contact me at mark at youknow which domain Smile

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
View user's profile Visit poster's website
MHz

Bascom Member



Joined: 28 Sep 2007
Posts: 123

germany.gif
PostPosted: Sat Aug 21, 2010 7:44 am    Post subject: Reply with quote

Hi Mark,
watching variables in AVR studio is still an issue. Is there any progress I have missed

Regards Wink
Back to top
View user's profile
PatchleAD

Bascom Member



Joined: 09 Apr 2006
Posts: 145

australia.gif
PostPosted: Thu Aug 26, 2010 11:01 pm    Post subject: Reply with 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....
Back to top
View user's profile
ex4

Bascom Member



Joined: 13 Jan 2006
Posts: 1064
Location: indonesia

indonesia.gif
PostPosted: Fri Aug 27, 2010 12:43 am    Post subject: Reply with quote

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 Laughing
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
View user's profile Visit poster's website AIM Address Yahoo Messenger
PatchleAD

Bascom Member



Joined: 09 Apr 2006
Posts: 145

australia.gif
PostPosted: Fri Aug 27, 2010 2:26 am    Post subject: Reply with quote

.... Laughing i must have miss spelled it .. I ment to say Dam.... and in the big pool of water... Wink

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.... Crying or Very sad
Back to top
View user's profile
ex4

Bascom Member



Joined: 13 Jan 2006
Posts: 1064
Location: indonesia

indonesia.gif
PostPosted: Fri Aug 27, 2010 2:37 am    Post subject: Reply with quote

mmm, yes it is a big package
a friend of mine using it. jeez about 2GB of files Shocked
but when i tell him about proteus,he just make a big woowww
Back to top
View user's profile Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum