Arduino Portenta H7 Development Board - Review

Table of contents

RoadTest: Arduino Portenta H7 Development Board

Author: dfergenson

Creation date:

Evaluation Type: Development Boards & Tools

Did you receive all parts the manufacturer stated would be included in the package?: True

What other parts do you consider comparable to this product?: Digilent Cmod-A7 35T, Revolution Pi RevPi Core

What were the biggest problems encountered?: The environment isn’t built out yet. The development tools are incomplete, some supporting products are not yet available, example code is sparse and poorly documented and the community hasn’t grown up yet.

Detailed Review:

Going from 0 to 60 with the Arduino Portenta H7

 

David P. Fergenson, Ph.D.

 

Pros:

     +A step improvement over all previous Arduinos in both power and features.

     +The form factor is similar to the existing Arduino MKR line but with a new, high density socket, allowing retro-compatibility and future-proofing.

 

Cons:

     -It’s for pros. It’s priced for pros and the learning curve requires you to be a pro.

     -The environment isn’t built out yet. The development tools are incomplete, some supporting products are not yet available, example code is sparse and poorly documented and the community hasn’t grown up yet.

 

Verdict: The Arduino Portenta H7 is the best embedded computing platform of 2022! Unfortunately, I’m writing this in 2021.

 

 

Introduction:

 

I had originally intended to apply the Portenta H7 (I’ll just call it the H7) to a specific, real-world problem that I was trying to solve. In the end, we had already designed our product to use +5V analog and digital pins for an Arduino Nano Every and, although the H7's DIP pins overlap in functionality with the Nano series, they’re in different locations and the H7 warns you not to exceed +3.3V on either the digital or analog pins. Level shifting would have added too much complexity so I had to abandon that aspect of the road test. Beyond that obstacle, however, there was another that would have made it even more difficult—the Portenta H7 is just too new. And not just new to me but to the entire electronics community.

 

As of this writing, the Arduino Pro developer tools are still only in Alpha testing and the other tool chains that support the H7 are at varying stages of native environmental support or example code availability. The community is still being established. I realize that these reviews are a critical aspect of the development of this community so I’ll discuss the tool chain options (and limitations) and give some step-by-step instructions for getting the device basically up and running.

 

And what a device it is! WiFi, Bluetooth, and two cores that can each independently control 84 digital I/O lines and a slew of other interfaces. Either of these 32-bit cores would be the most powerful Arduinos on their own and one has twice the clock speed of the other. The onboard support for a keyboard, mouse, external monitor with sound and WiFi means that you could operate this as a tiny single board computer. One of the code examples, which I did not test, is entitled Doom and downloads, installs and runs the game Doom.

 

Of course a Raspberry Pi could also do this and costs roughly one third as much as the H7 while the other Arduinos are unable to do this but are simpler to program and less expensive. So does the H7 fall between two stools? Not really. It’s just not intended to be a Linux single board computer even though it could be. Rather, it’s intended for serious, real-world industrial IoT or automation in a form factor that you can close your hand over. It includes two 80-pin connectors which provide direct access to the interfacing functions but also includes timers, onboard embedded cryptography, and networking in a form factor that is intended for use in a custom breakout board.

 

In fact, all of the small form factor Arduinos are really system-on-modules (SoMs) and their ideal mode-of-implementation is through breakout boards. But with 160 pins of connectivity on two 80 pin sockets and all of the added power and specs, this Arduino is a step improvement and can drive far more complex applications.

 

 

Getting Up and Running

 

In my lab, we use both Macs and PCs so I see Mac/PC/Linux toolchain parity as one of the main advantages of the Arduino ecosystem. I used my Mac for all of the tests that I ran which was a lot more convenient for me, especially over the holidays, and I think that everything that I report will be equally helpful for all of the platforms. It is certainly possible to develop applications for the H7 either on a Mac, in the cloud, or in coordination with others working on multiple platforms.

 

The H7 represents as sharp a break from Arduino’s software as its hardware. It’s powered by ST Microelectronics’ STM32H747 which contains two completely independent ARM processing cores, a Cortex M7 and a Cortex M4. When you write an Arduino sketch for either core, the sketch is actually compiled on top of ARM’s own Mbed OS. The only other Arduino that this applies to is the Arduino Nano 33. You can supposedly also use Mbed studio itself but, unlike the Arduino Nano 33 and Nano 33 BLE, there’s no ready-made H7 target, nor could I find a ready-made target for the H7’s STAM32H747XIH chip itself. Since the Arduino IDE already operates through the Mbed OS transparently, I fell back on the Arduino IDE. There are two versions of the IDE now, the version that everyone knows and loves (which I’ll call the the Legacy IDE) and the new Arduino Pro IDE (which I’ll call the Pro IDE).

image

Using the Legacy IDE for the H7 starts out similarly to developing for any other Arduino. You need version 1.8.6 or later of the Legacy IDE to support the H7. I updated to the latest version, 1.8.13 which, on the Mac, also seems to fix a nasty bug where the Serial Monitor was crashing the Legacy IDE. Next, under Tools>Board>Boards Manager you need to add the Portenta H7 as a supported board. There are two H7 options but one is clearly labeled as being deprecated so just choose the non-deprecated one.

 

You need to connect to the H7 using a USB-C port. This is easy enough on a late model MacBook Pro where the charge ports are USB-C ports and you can always run on batteries while you unplug the USB-C charge cable from the charge brick and plug it into the H7. I am fortunate enough to have two charge bricks so I used the USB-C cord from one of them and it worked fine. USB-C cords are still pretty rare but don’t cost all that much so you can also order one at the same time that you order your H7.

For an update on USB-C on a Mac, read this article: https://appleinsider.com/articles/20/08/24/usb-3-usb-4-thunderbolt-usb-c----everything-you-need-to-know

To make sure the H7 is connected, select >About This Mac and then click on the “System Report…” button. The system report window will open and on the left side select USB (it’s inside the Hardware list) and you’ll see a list of a few different USB busses. Click from one to the other until you see your H7. In my case, it was under the first of the USB 3.1 Bus listings and it was called “Envie H7”. Now that you know that the H7 is connected to your Mac, you need to select its port as the current port for the Arduino IDE. On my Mac, this was under Tools>Port>cu.usbmodem14301(Arduino Portenta H7 (M7 Core)). So far, these are pretty straightforward IDE setup procedures but this is where some of the complexity of the H7 begins to come into play.

 

The way that the Arduino IDE abstracts the two processors is by considering them two separate boards on the same port. This is pretty straightforward but there is code that is specific to each core and you need to make sure that you push the right sketch out to the right core. If you make a mistake, you’ll get a compilation error. For example: bootM4() is how the M7 core tells the M4 core to start its sketch. Obviously, this applies only to sketches intended for the the M7 core and a sketch containing that command won’t even compile if you are currently connected to the M4 core. You can also have your code automatically sense which core it is running on and only execute for the appropriate core using the if (HAL_GetCurrentCPUID() == CM7_CPUID) {} command. This is abstracted to something more mnemonic in the RPC_M4 example (File>Examples>Examples for Arduino Portenta H7 (M7 core) - RPC > RPC_m4). You might notice that the example for the M4 core is filed under the M7 core and actually refers to both cores. You might also remember that I said that support for the H7 was a work-in-progress. This is a minor example of what I mean.

 

I wrote two different versions of the Blink application with different colors to run on different cores. They’re not really exciting but they do show the two critical concepts for developing in the Arduino IDE for the H7 that I mentioned.

 

//Blink Green LED on M7 Core

const int ON = LOW;

const int OFF = HIGH;

 

void setup() {

  bootM4(); // This starts the blink_m4 sketch running on the M4 core if it's been uploaded.

  pinMode(LEDG, OUTPUT);

  pinMode(LEDB, OUTPUT);

  digitalWrite(LEDB, OFF);//Turn off the Blue LED which will not be blinked.

}

 

void loop() {

  digitalWrite(LEDG, ON);

  delay(500);

  digitalWrite(LEDG, OFF);

  delay(500);

}

 

 

//Blink Red LED on M4 Core

const int ON = LOW; // Voltage level is inverted

const int OFF = HIGH;

 

void setup() {

  pinMode(LEDR, OUTPUT);

}

 

void loop() {

  digitalWrite(LEDR, OFF);

  delay(500);

  digitalWrite(LEDR, ON);

  delay(500);

}

 

First, notice that there’s the bootM4() command on the Blink_M7 sketch. If that line isn’t included, the other sketch won’t run at all and only the most recently uploaded sketch will be operational. But, as I mentioned, if you try to push it out to the M4 core you’d get a compilation error. This is true even if bootM4() is inside an if-block that won’t be executed on the M4 core. Second, notice that each declares certain pins as outputs. There’s no guardrail stopping you from having both cores grab for the same pin. I couldn’t figure out systematically what happened when I did that but I’m sure that it’s not a good idea. So make sure that each core keeps its hands to itself.

 

if (HAL_GetCurrentCPUID() == CM7_CPUID) {} tests true if the sketch is running on the M7 core and false otherwise. Unfortunately, if you use code reserved for the M7 core, even if it’s inside of this if block, it will still fail to compile if the M4 core is specified. Also, the sketches should be bloated with code intended for the other core.

The Future

 

Switching between sketches and cores on the Legacy IDE isn’t just tedious; it’s confusing. Arduino has done a much better job of juggling boards/cores in their new Pro IDE. To get to that IDE (or even to see any information on the H7 itself) you need to click on the Professional tab at arduino.cc (or just go to https://www.arduino.cc/pro). You’ll have to click on Platform>Software and then scroll down to the Arduino Pro IDE (Alpha) area to download it. Once you do, it’s pretty similar to getting the standard IDE running except that the Portenta H7 board files will already be there.

 

As of this writing, the Pro IDE has been version 0.10.0 Alpha for about a month but it’s already easier to use for the H7 than the Legacy IDE due to a single user interface improvement: you can select the target board through a pop-up menu in the toolbar of each sketch. It doesn’t have all of the H7 examples, though, so I ended up getting both tools up and running. Over time, I’m sure that the Pro version will supersede the standard version for H7 programming.

 

Also, there’s a concept in programming that the average Arduino developer will need to become much more familiar with now that there are two different cores—trace debugging. Arduino has negotiated for a free, device-locked license from Lauterbach (https://www.lauterbach.com/frames.html?download_demo.html) and they have instructions on how to download it and activate the license (https://www.arduino.cc/pro/tutorials/portenta-h7/por-ard-trace32). The problem for me was that, although Lauterbach supports Windows and Linux, there isn’t a build for MacOS. I’m looking for an alternative and would love any suggestions that anyone has. I also assume that it will be built directly into the Pro IDE in the future.

 

Another issue with the H7 is that it’s difficult to do anything with it that you couldn’t do with any other Arduino unless you have a breakout board (your own or Arduino’s) to interface with the new features. The two 80-pin connectors give you access to a ton of features. Mating connectors such as the Hirose DF40C-80DS-0.4V(51) are available but are pretty high density surface mount devices so you’ll need experience with SMD soldering or an assembly house to implement it. This is another reason for the “Pro” designation. Fortunately, Arduino already sells a ready made breakout board called the Vision Shield with either a physical ethernet connector (Pins 1, 3, 5, 7, 17 and 19 on J1) or built-in LoRaWAN connectivity and they’re already in stock at electronics supply houses. But I didn’t have one myself. Those breakout boards, as their name implies, are optimized for machine vision. Intriguingly, the Hack-a-Day review of the Portenta H7 (https://hackaday.com/2020/01/15/new-part-day-arduino-goes-pro-with-the-portenta-h7/) shows a rendered image of a more full-featured breakout board that turns the Portenta into a full fledged SBC. If the H7 is embedded on this board, the integrated unit basically becomes a Raspberry Pi. This sounds like a great way to get up and running but the URL that the review points towards on Arduino’s website (https://www.arduino.cc/pro/hardware/product/portenta-carrier) is mysteriously an empty page.

 

At this point, without an IDE that’s at least in Beta, a full featured breakout board, better example code, proper documentation, board support in other development platforms and a community that is able to help fill in the gaps, it is hard to get started with the H7. That’s a shame because of its obvious potential but this will also surely change over the next few months which is why I say that the H7 is the best SoM of the year 2022.

 

 

David P. Fergenson is the president of Livermore Instruments Inc., a San Francisco Bay Area manufacturer of mass spectrometers.

Anonymous