An open API service indexing awesome lists of open source software.

https://github.com/dsuarezv/arduino.net

An IDE for Arduino development including a software debugger.
https://github.com/dsuarezv/arduino.net

Last synced: 5 months ago
JSON representation

An IDE for Arduino development including a software debugger.

Awesome Lists containing this project

README

          

Note: consider this readme file as a preview of the coming documentation that will be more detailed and better structured, but is still work in progress.

# Arduino.net

An alternative IDE to write, build, deploy and debug Arduino programs.

**This software is still at an early stage of development. It may contain bugs or behave strangely.**

## Motivation

Arduino.net is an IDE (Integrated Development Environment) for the Arduino platform. Its main purpose is to provide an open source software debugger capable of debugging programs running in the Arudino boards without any modification to the hardware. You don't need to add Serial.prints anymore to track the values of variables in your program.

While hardware programmers/debuggers exist that allow debugging in the atmega MCUs, it is not easy to connect them to the Arduino boards, often requiring some soldering or board hacking and, of course, spending some money on the hardware itself.

## Features

* Binaries comparable to those generated by the original Arduino IDE.
* Faster builds: only changed files are recompiled on each build.
* Compatible with existing arduino sketches (see known limitations, below).
* Software debugger that can set breakpoints to stop the code running on the Arduino and inspect local and global variables.
* Watches pad to inspect a set of variables every time a breakpoint is hit.
* To debug programs on the Arduino boards, only the serial port is used. Most Arduino boards already include a serial port through the USB interface.
* Serial.print is supported even when the debugger is running.
* Little overhead of the debugger code: only 800 bytes of program memory.

Here is a screenshot of a development version:

![IDE screenshot](screenshots/13%20capturing%20realtime%20data%20in%20code.png)

## Some debugger terms

#### What is a breakpoint?

A breakpoint is a mark you insert on a code line indicating that the program will stop when it reaches that line and will let you inspect the state of variables at that point in the execution flow.

#### What is "inspecting a variable"?

It means that you will hover over a varaible in the code with the mouse and a tooltip (a small yellow rectangle) will popup displaying the value of that variable.

#### What is a watch?

A watch is a variable whose value will be updated and displayed in the Watches panel everytime a breakpoint is hit. If the variable is visible in the current scope it will be displayed.

#### What is the "current scope"?

the current scope means the context where the program is stopped. When a brekpoint is hit inside a function, the current scope is that function, so the debugger can inspect variables inside that function and global program variables.

Note that the debugger does not support yet stack unwinding, so there is no call stack and no way to inspect the value of variables in the functions that called the current one. You have to set breakpoints to achieve this result.

## How it works

To compile a program without debugging, click the "Verify" button. To upload the binary to the Arduino, click the "Deploy" button. If this is the first time that the IDE is run, you may need to select the Arduino board and how it is connected to the PC. This is done with the settings buttons at the top right.

To activate the debugger, click the "Debugger" checkbox. Breakpoints are set before deploying the code to the device, and cannot be changed while the debugger is running in the Arduino. Go to the line where you want to have a breakpoint and hit F9 to toggle the breakpoint. An orange dot will appear to the left of the code. Click "Run" (or hit F5) and the IDE will build the program, deploy it to the Arduino board and wait for the program to connect to the debugger on the PC. The orange breakpoint dots will become red, meaning that they are deployed to the Arduino. If a new breakpoint is added later with F9, it will be orange until it is deployed to the Arduino.

When a breakpoint is hit, the line will be highlighted and the Arduino is stopped waiting for your actions.
You can now inspect local and global variables just by hovering the mouse over them in the code. A tooltip will appear with their value (supported types are all the basic types like int, bool, float as well as structs and classes). See known limitations below for more details
you can click on "Run" to continue execution

## Supported platforms

Currently Arduino.net only runs on Windows and requires the .NET framework 4.5. The software is designed to be ported to other platforms (namely Linux and OSX) just by implementing the frontend layer, but this is not done yet.

On the Arduino side, it supports the same boards included in the original Arduino SDK. A copy of the hardware directories from the Arduino SDK is included. If you have modified the programmers.txt or boards.txt files for your specific platform, you can setup the directory of the Arduino SDK to use.

## Technical details

This is a software debugger, meaning that it will insert some code in your program to signal the PC that a breakpoint is hit.

It will insert a call to DbgConnect() in your setup() function or generate one if none exists in your code. This call will setup the serial port and wait for the PC side to issue a "Run" command.

When you insert a breakpoint, a call to DbgBreak(uint8_t breakpointId) is inserted in the source before the existing code in that line. This call will save all the registers on the Arduino and send them through the serial port to the PC side, together with a signal indicating the breakpoint is hit. The PC side of the debugger will use the registers information to find the current function and will also use them later to inspect variables if required. The registers are restored to their original state in the Arduino when the "Run" button is clicked.

Because there is some debugger code running in the Arduino, it may consume precious RAM memory when a brekapoint is hit and the debugger is processing commands from the PC side. You can find the code of the debugger in the Arduino side inside the "debugger" directory, in case you want to see exactly what's going on.This code is only included in debug builds.

## Known limitations

* (software debugger)
* (being a realtime platform, putting breakpoints in the code may disrupt the operation of some programs. For instance, reading a sensor using a FIFO you may get FIFO overflows if you set a breakpoint in the middle of the reading loop, because the Arduino is stopped, but the sensor keeps producing data.)
* (code optimization is disabled for debug builds. This has an impact in the size of the code and quite possibly in the RAM used by the program)
* (breakpoints can only be set inside functions. Putting them outside a function will throw a compiler error, since a function is being called in the middle of nowhere)
* (sketches with multiple pde/ino files)
* (breakpoints set inside class methods are not hit. This is because the dwarf debug information does not provide enough data to determine where we are stopped in the current implementation.)
* (no call stack or stack unwinding)