Posts with «cli» label

Arduino CLI for I/O Pin Testing

Need to quickly toggle or read some logic signals without the hassle of writing a quick program? [Thor_x86], aka [Eric], built an Arduino sketch that does just that — and he threw in the ability to send (or receive) serial messages, too. This is a neat idea — kind of a simplified Bus Pirate.

We should warn you that this is an early release, and there are a few minor issues which we are sure [Eric] will iron out soon. We discovered the function strtol() was misspelled in cmd_send.cpp, and there are some configuration #defines which need to be sorted out in file parsePin.cpp, depending on which Arduino module you are running. We got it running on an Arduino Leonardo the quickest, because it has support for Serial1().

Don’t be discouraged by these glitches in this rev 0 deployment — [Eric] has really made quite a nice tool here. Check his GitHub repository for updates (or submit corrections yourself). All in all, it’s a good addition to your digital tool box. On a completely unrelated note, we really like [Eric]’s USB cable with the right-angle micro connector, grungy though it may be.

Besides the standard tools like Bus Pirate, GreatFET, FTDI modules, etc., are there any similar tools you like to use for bit banging and serial testing? Let us know in the comments below.

Hack a Day 21 Mar 21:00

Open-Source ARM Development Simplified

The ARM series of processors are an industry standard of sorts for a vast array of applications. Virtually anything requiring good power or heat management, or any embedded system which needs more computing power than an 8-bit microcontroller is a place where an ARM is likely found. While they do appear in various personal computers and laptops, [Pieter] felt that their documentation for embedded processors wasn’t quite as straightforward as it could be and created this development board which will hopefully help newbies to ARM learn the environment more easily.

Called the PX-HER0, it’s an ARM development board with an STM32 at its core and a small screen built in. The real work went in to the documentation for this board, though. Since it’s supposed to be a way to become more proficient in the platform, [Pieter] has gone through great links to make sure that all the hardware, software, and documentation are easily accessible. It also comes with the Command Line Interpreter (CLI) App which allows a user to operate the device in a Unix-like environment. The Arduino IDE is also available for use with some PX-HER0-specific examples.

[Pieter] has been around before, too. The CLI is based on work he did previously which gave an Arduino a Unix-like shell as well. Moving that to the STM32 is a useful tool to have for this board, and as a bonus everything is open source and available on his site including the hardware schematics and code.

Arduino Gets a Command Line Interface

When using an Arduino, at least once you’ve made it past blinking LEDs, you might start making use of the serial connection to send and receive information from the microcontroller. Communicating with the board while it’s interacting with its environment is a crucial way to get information in real-time. Usually, that’s as far as it goes, but [Pieter] wanted to take it a step farther than that with his command line interpreter (CLI) for the Arduino.

The CLI allows the user to run Unix-like commands directly on the Arduino. This means control of GPIO and the rest of the features of the microcontroller via command line. The CLI communicates between the microcontroller and the ANSI/VT100 terminal emulator of your choosing on your computer, enabling a wealth of new methods of interacting with an Arduino.

The CLI requires a hex file to be loaded onto the Arduino that you can find at a separate site, also maintained by [Pieter]. Once that’s running, you can get all of that sweet command line goodness out of your Arduino. [Pieter] also has some examples on his project page, as well as the complete how-to to get this all set up and running. There’s a lot going on in the command line world, in Linux as well as windows. So there’s plenty to explore there as well.

Hack a Day 11 Nov 03:00
arduino  cli  command line  gpio  i2c  microcontrollers  serial  shell  unix  uno  

Arduino Gets Command Line Interface Tools That Let You Skip the IDE

Arduino now has an officially supported command-line interface. The project, called arduino-cli, is the first time that the official toolchain has departed from the Java-based editor known as the Arduino IDE. You can see the official announcement video below.

Obviously this isn’t a new idea. Platform IO and other command-line driven tools exist. But official support means even if you don’t want to use the command line yourself, this should open up a path to integrate the Arduino build process to other IDEs more easily.

The code is open source, but they do mention in their official announcement that you can license it for commercial use. We assume that would mean if you wanted to build it into a product, not just provide an interface to it. This seems like something Arduino expects, because a lot of the command line tools can produce json which is a fair way to send information to another application for parsing.

The command line interface doesn’t just build a sketch. You can do things like install and manage libraries. For example, to create a new sketch:

arduino-cli sketch new HackadayPgm

You can update the installed platforms, list the connected boards, and search for board support:

arduino-cli core update-index

arduino-cli board list

arduino-cli core search mkr1000

If you don’t already have the board support, you can install it and verify that it is there:

arduino-cli core install arduino:samd

arduino-cli core list

That last step will give you the FQBN or unique name for the core. So to compile and upload you have this mouthful:

arduino-cli compile --fqbn arduino:samd:mkr1000 Arduino/HackadayPgm

arduino-cli upload -p /dev/ttyACM0 -fqbn arduino:samd:mkr1000 Arduino/HackadayPgm

Unlike, say, PlatformIO, this is clearly better for building into a tool, even if it is a makefile. We’d like to see a .build.json file or something that allows you to just issue short commands that do the right thing in a working directory. Of course, you could build that with a little shell scripting. Hmm….

It is nice to see the release of an official method and we hope this will lead to more editors being able to handle Arduino seamlessly.