A way to debug arudino from eclipse?

hi…

i’ve search a few forums here and there, and found no so clear info if it’s possible to debug an arduino sketch from eclipse (i saw there might be a need for an external device an AVR dragon).

also when i try to upload a sketch from eclipse to my UNO, nothing really happens, it launches avrDUDE, but just hangs there.

Yes, you would certainly need additional hardware for low level debug using Eclipse or any other dev tool.

As an Eclipse user you will probably be quite an advanced user, so please forgive me if the following other suggestions are not applicable. Here they are anyway just in case they are useful :slight_smile:

  1. SoftwareSerial on most digital pins connected to the pc using something like an FTDI cable can be quite useful for serial debug if there are no available hardware serial ports.

  2. If using ms windows then Visual Studio Professional and the free Arduino plugin are an alternative. The plugin has a debug extension in beta. The debug extension provides something inbetween hardware debug and serial debug but does not require any additional hardware. Debugging is configured using the standard debug features of Visual Studio, such as adding conditional breakpoints. Please ignore if not relevent or read more at [visualmicro.com

Best of luck with your project](http://www.visualmicro.com)

for visual studio .net i have a few cards for netduino, so i’ll use that with vs. as for item 1, i’m not sure i understand, are we talking breakpoint step by step debugging here?

Item 1) is standard serial debugging but avoiding use of hardware serial.

Item 2) is a step by step breakpoint debugger for Arduino nothing to do with .net. The standard Visual Studio Arduino Plugin gives you a complete Arduino development system in Visual Studio Professional. Sketches created in VS can be opened and compiled in the Arduino IDE and sketches created in the Arduino IDE can be opened and compiled in VS. You get all of the features from the Arduino IDE in Visual Studio Pro plus all of the benefits of Visual Studio and more.

what is serial debugging?

Oh that is where you send messages from the arduino to the pc either via usb cable or xbee radio and usb cable.

Let’s take a simple sketch example using the serial port that is normally used to upload to the arduino.

void setup()
{
 Serial.begin(115200);
}
void loop()
{
  uint8_t i = random(100);

 if (i>30 && i<70)
  {
     Serial.print("Hello, we hit this place in our code. Variable i is currently = ");
     Serial.print(i);
     Serial.println(" which is > 30 and < 70");
  }
}

Notice in both the Arduino IDE and also Visual Studio that there is a “Serial Monitor” tool. Open the tool after uploading the sketch shown above and ensure the speed option is set to 115200

Doing so will show the following output in the serial monitor window.

Hello, we hit this place in our code. Variable i is currently = 40  which is > 30 and less than 70
Hello, we hit this place in our code. Variable i is currently = 45  which is > 30 and less than 70
Hello, we hit this place in our code. Variable i is currently = 35  which is > 30 and less than 70
Hello, we hit this place in our code. Variable i is currently = 60  which is > 30 and less than 70
Hello, we hit this place in our code. Variable i is currently = 68  which is > 30 and less than 70

I have used a very verbose example to show you how to conditionally see on your pc what the arduino is currently doing. I have used an “if” condition to conditionally limit the messages. There will be a lot of serial messages resulting from this code, a real world example might simple report exceptional information.

To recap: The “Serial” system in arduino is the same system that is normally used to upload programs to the arduino but it can be used as shown above to send messages between arduino and the pc. It is crude but easy!

NB: The Serial.print() functions are overloaded should you need to see different data formats such as HEX

Serial.print(myvar,HEX);

The difference between print() and println() is simple that println() adds new line terminators

oh, it’s just the age old Alert/MessageBox logging. that’s not how i wanna roll, i’ve had that with JavaScript and that’s crazy city right there.

so what’s you are saying that without any extra hardware, that would also involve hacking arduino (something about disabling reset, otherwise i would buy , the dragon seems to only cost 50$). i can’t step by step debug this with eclipse.

it’s a shame the Visual Studio plugin doesn’t work with visual studio express, i tried going for the webspark program, but there was a website error upon submission.

but i think with netduino you CAN use Visual Studio express and thus use debugging.

Edit: My answer wasn’t very good to I have changed it…

Yep, agreed serial debugging isn’t very good at all. Messing with the hardware is a no no, it screws it up.

The only option is the Visual Studio debugger in Vs pro or NET MF

Like i said i tried websitespark

EDIT 2012-09-29

Microsoft Web Site Spark is available to students, individuals and small businesses. The Visual Micro information [page about these offers has been updated to provide better information. You will read that the various schemes are entirely free and that the rules are quite relaxed. Should at any time Microsoft feel that you do not qualify you will be asked to stop using the software until you do qualify :violin:](Visual Studio for free for Arduino Development)

What rules?

well i’ve managed to sign in, but how do i get a subscription?

EDIT

It can take up to 3 days for your application to be processed. In the meantime Microsoft provide a free 90 day license key and immediate download of Visual Studio Professional to everyone. Use the 90 day license key described [here until your subscription is processed.

http://www.visualmicro.com/pics/MsdnSub … wnload.png

After your account is setup, you can also sign in to msdn using the same Microsoft id. http://www.msdn.com. This is a quick way of accessing your Microsoft downloads on future occasions.

To be a good person you should follow the rules of websitespark or in theory microsoft can ask you to stop using the products.](Visual Studio for free for Arduino Development)

but i don’t know exactly what kind of number it’s looking for is it Microsoft Partner Network Oragnization id ?

EDIT:

Microsoft were have some issues last week with the application system. It is all automatic but can take up to 3 days

yea i got that allready, and i also got an email saying: “Welcome to the Microsoft Partner Network”, is that email with subscription number?

i recently worked as a freelance for a company providing consulting services on how to integrate a product to Office 365 online , so i wrote that in the description.

Edit: There were issues last week, the system is automatic. The overview of this Microsoft Offer for Visual Studio Professional has been extended. Read more [here](Visual Studio for free for Arduino Development)

what does the title of the subscrition id email? (how do i know if i got it?)

“on my product keys” it says there’s not subscription linked to this id.

EDIT

Subject to the delay outlined above the MY PRODUCT KEYS list will be filled with lots of nice product keys within 3 days :smiley:

i didn’t get any email regarding renew subscription.