It has indeed been too long since I last unpacked a new dev kit and ran the blinky hello world sample for it, so when I saw that Arduino released a new version of the good old UNO, I just had to try it.
My interest for trying out Arduino latest tools and kit is not random: we all know Arduino as the ideal companion for tinkering and building home DIY projects as well as prototyping solution. But it is little less known that in 2019, Arduino released their first Arduino Pro board alongside a refreshed IDE (now coined IDE 2.x), aiming at going beyond hobbyist or prototyping projects and allowing customers to go to production with enterprise grade hardware, yet taking advantage of the simplified embedded coding Arduino is known for. Don’t let the name “Arduino” fool you, the Arduino Pro line has nothing to do with the UNO or MKR series and if you have not considered Arduino Pro as an option for your industrial grade project, I urge you to reconsider and visit https://www.arduino.cc/pro to learn more.
The new UNO R4 is not part of the Pro line, but considering it sports an ARM 32 bit micro-controller, alongside an ESP32-S3 WiFi chip (for the UNO R4 WiFi, not for the Minima) as well as some nice new goodies, like a CAN bus, an onboard DAC or an onboard RTC, I do believe it will allow to get a good sense of what the new tools and libraries have to offer for “pro” users.
Getting started with the hobbyist experience
I always liked the simplicity of Arduino docs which I believe is the right level for both embedded savvy and less technical savvy crowds, and the Arduino R4 setup guide is not disappointing.
It first asks you how you plan to code for the board:
Last time I played with an Arduino board, I used the Visual Studio Code extension developed by Microsoft, which itself depends on the Arduino CLI (you can use it on top of the Arduino IDE Legacy, but it is not recommended as this will be deprecated in favor of the CLI option). I did so at the time because the Legacy Arduino IDE was not on par with the rich code editing offered by VS Code. It’s time to revisit the Arduino IDE and check out the state of the Web Editor.
The install steps for the latest IDE and high-level introduction in the wizard are as straight forward as you would expect and you are ready to roll in a matter of minutes. On Windows (which is what I use these days), the installer does all the work, including adding USB drivers.
I then jumped in the getting-started doc which walks you through the addition of the UNO R4 board package as well as points you to the samples found in the IDE. If you are familiar with the legacy Arduino IDE, the concept of board manager has not changed, and samples come installed with the board packages. The IDE itself has changed a lot. It is now based on the Eclipse Theia project which is compatible with VS Code extensions. With the new IDE you get what you would expect from a modern professional developer tool with some new embedded specific features like “live debugging”, serial port monitoring and even plotting of said serial port output in a dynamic graph, and more. Another neat new feature is the sync of your sketches with the Arduino Cloud (which I will check out later on).
The Getting-Started guide for the UNO R4 invites to try out a Tetris animation sketch sample that uses the new LED matrix… why not? I copy pasted the sketch, verified it, picked the right COM port for uploading it, then ran it. Smooth as expected.
Playing around with the code in the IDE, I could enjoy the whole shebang of the (now) modern IDE, with auto-completion, function peeking, and more. We are far from what I remember of the legacy IDE. Developers used to VS Code and similar IDEs will feel at home and Embedded developer will enjoy modern coding. Well done Arduino!
No live debugging support for the UNO R4 WiFi ☹… yet?
I remember the pain of having to use log traces over serial to debug Arduino apps and like many, I was excited to learn that the new IDE offered what they call live debugging (I remember calling this cross-debugging). I was excited to try this out with my new UNO R4 WiFi and for some reason (I think I’ve been biased by too many years working on not-so-embedded hardware 😊) I was expecting to just have to press F5 in the IDE and wait for the magic to happen… but alas, it seems debugging is not yet supported on the UNO R4 WiFi version. Live Debugging in the IDE 2.x is supported on all SAMD boards (full list here) and requires a JTAG adapter like the Segger J-LINK or Atmel-ICE (except for the Arduino Zero which has a built-in debugger). The UNO R4 Minima has an SWD port to connect such JTAG adapter, but the UNO R4 WiFi doesn’t have this port. I couldn’t find information about how live debugging could be implemented on the WiFi version in the Arduino documentation, but looking at the UNO R4 WiFi pinout, it seems GPIO19 and GPIO20 of the on-board ESP32-S3 are accessible over USB-C, which would allow debugging with OpenOCD on the ESP chip, so there is hope...
Fun (and practical) tools: serial plotter and LED Matrix editor
Who can resist playing around with a new toy? I do and couldn’t wait to test the new serial plotter. There are some samples that allow playing around with the new serial plotter and things are straight forward, but that was a good opportunity to have my buddy Bing Chat participate in the experiment. I asked Bing to generate a simple sketch for my UNO R4 WiFi that would output a sinusoidal signal to both the DAC output as well as in the serial debug traces (which I want to plot in the new tool). The AI generated code just worked, and I could see the sinusoidal output displayed in the plotter tool in a
matter of seconds. Just for the fun, I wanted a sinusoid displayed on the on-board LED matrix of the UNO R4. I asked Bing Chat to add some code to display frames on the LED Matrix and used the LED Matrix Editor to create the series of frames to be displayed and simulate an animation.
A very promising first-minutes experience
I only spent a little time and just scratched the surface of the new Arduino tools and technologies, but that was plenty enough to get a clear sense that this is no longer your grandma’s Arduino (not that it ever was just for your grandma, it’s just an expression 😉). While the philosophy of democratizing embedded development is still front and center, it is also clear that Arduino is not willing to compromise on the quality and richness of the tooling and I can see a bridge forming between the makers and the professional IoT worlds.
In future articles I’ll take a look at the web editor, the Arduino Cloud and will investigate what the Arduino Pro line has to offer. Stay tuned!
Komentáře