Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Is it possible to debug an ATMEGA328P in a protoboard using software serial? (Read 14688 times)
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Jul 10th, 2015 at 9:49am
Print Post  
Hello,

I'd like to debug an ATMEGA328P that I've placed in a protoboard using arduino ide with atmel studio, the problem is that when I try to do it the program always tries to upload the sketch which in my case it's not possible.

What I do to upload is build the project, and program the .elf file using a jtagice3 within device programming. So I'd like to know if it's possible to override the uploading thing when start debugging so it just starts reading by software serial.

Kind regards.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #1 - Jul 10th, 2015 at 11:32am
Print Post  
Hi

This area is being expanded at the moment but for upload, did you try using a jtag ice option from tools>visual micro>programmers?



  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #2 - Jul 10th, 2015 at 11:40am
Print Post  
You mean you are working on it to include it in newer versions?

I don't have JtagIce option under tools>visual micro>programmers, maybe I have to add it some way.

Thank's for your help.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #3 - Jul 10th, 2015 at 11:48am
Print Post  
No I mean we are working on an option to allow debug build without upload. Then you can upload using device programming and still debug using software serial.

I expect you already have configured the debug for software serial? In which case we just need to upload.

What options do you have on the "tools>visual micro>programmers menu" and what board do you have selected?
  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #4 - Jul 10th, 2015 at 11:52am
Print Post  
GreatĀ  Smiley

I have arduino nano w/ ATmega328 board selected.
Programmer options are:
AVR ISP
AVRISP mkII
USBtinyISP
USBasp
Parallel Programmer
Arduino as ISP
« Last Edit: Jul 10th, 2015 at 11:53am by jmraw »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #5 - Jul 10th, 2015 at 12:33pm
Print Post  
Hmm that's strange. I am going to assume you are on a relatively recent version of visual micro from within the last few months.

In this case there should be a load of additional atmel options on the programmers menu.

Please try a few things ...

1) Switch to a different board such as uno then back to nano again. Do more menu items appear in the programmers list

2) If no then please confirm which version of the arduino ide you are using? and if you are using the nano supplied with the ide or with your own custom hardware defs from somewhere else?

Thanks
  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #6 - Jul 14th, 2015 at 9:01am
Print Post  
I have the JTAGICE programmer now, it didn't appear because I had arduino 1.0 selected instead of arduino 1.5.

I'll have to update my code for this version before I can try.

Thank's.
  
Back to top
 
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #7 - Jul 16th, 2015 at 8:33am
Print Post  
Hello,

I'm trying to upload my sketch selecting JTAG ICE3 Programmer, but I get this error:

Code
Select All
Binary sketch size: 22.274 bytes (used 73% of a 30.720 byte maximum) (0,79 secs)
Minimum Memory Usage: 1470 bytes (72% of a 2048 byte maximum)
Uploading to I/O board using 'Atmel Studio JTAG ICE3 (ISP)'
Firmware check OK

Error during upload using programmer
[ERROR] JSON error: Failed to parse response to  Modules:add: 'utf8' codec can't decode byte 0xfa in position 12: invalid start byte

The uploader returned an error 



Do you know why this could be?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #8 - Jul 16th, 2015 at 12:01pm
Print Post  
No sure that that is. 

The Atmel Studio JTAG ICE3 (ISP) entry was created by a user so I don't have much knowledge about the settings.

You can switch on tools>visual micro>verbose to see the commands that are being sent.

You can also change the params in "program files(x86>visual micro>arduino for visual studio>micro platforms>avr..."
  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #9 - Jul 17th, 2015 at 7:41am
Print Post  
Verbose doesn't give me further info about the problem, and I don't have enough knowledge to modify those params, althoug I'll keep on trying to solve it learning about it.

Thank's a lot for your help!

Do you have an approximate ETA of that new version you're working on? If this is gonna be too long, could I betatest it with my proto?

Kind regards.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #10 - Jul 17th, 2015 at 10:18am
Print Post  
I'm sorry if I have missed some conversation but what new version are you waiting for?
  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #11 - Jul 17th, 2015 at 10:22am
Print Post  
Tim@Visual Micro wrote on Jul 10th, 2015 at 11:48am:
No I mean we are working on an option to allow debug build without upload. Then you can upload using device programming and still debug using software serial.


Sorry if I misunderstood, I thought you were working to release a new version with this feature.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #12 - Jul 17th, 2015 at 11:31am
Print Post  
Oh yes sorry I forgot we discussed that it is on the list. You can test this out by attempting an upload using serial which will fail but you will then have a debug version of the hex/elf.
« Last Edit: Jul 17th, 2015 at 11:32am by Tim@Visual Micro »  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #13 - Jul 17th, 2015 at 11:48am
Print Post  
Thank's a lot for your help!! I'll try it!
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #14 - Jul 18th, 2015 at 9:57pm
Print Post  
Sp2 is out. You should find a new programmer on the "tools>visual micro>Programmers" menu called "Atmel Studio Device Programming". Make sure it is ticked and also tick "tools>visual micro>Upload Using Programmer"

The option opens the device programming dialog instead of attempting upload. This means the elf is a debug version. After you close the dialog the debugger will start using the visual micro debug settings that you have configured for the project. 

tip: You can start/stop the debugger at any time simply by opening/closing the serial window on the specified debug port
  
Back to top
IP Logged
 
jmraw
Newbies
*
Offline


Posts: 9
Joined: Jul 10th, 2015
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #15 - Jul 20th, 2015 at 10:22am
Print Post  
I'm currently testing Sp2, it allows me to upload the .elf using jtagice3 and when I close it starts debugging as you mentioned. The problem is that I'm receiving strange characters (see attached image), I've checked that I'm using the right pins and the right speed. The prototype I'm trying to debug has 2 328p connected by software serial (I'm using softEasyTransfer library for this), runnning at same speed I try to debug but different pins, could this be the problem? If I want to debuf one of them would I have to avoid using software serial between micros??

Thank's a lot in advance.

Kind regards.
« Last Edit: Jul 20th, 2015 at 10:36am by jmraw »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Is it possible to debug an ATMEGA328P in a protoboard using software serial?
Reply #16 - Jul 20th, 2015 at 10:42am
Print Post  
I don't know the answer. Software serial is not as good as hardware serial. How it responds will be down to your usage of it. You could try slowing it down a bit, 57k is the max speed software serial will work at.

You should also confirm if the pins you are using support interrupts. I notice the easytransfer also supports i2c which might be a better solution anyway.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint