Portenta H7 and Arduino IDE - unusable

I use the Portenta H7 board - a great piece of HW.
I am struggling to so much with the Arduino IDE (2.0 rc6) for it (and actually also ARM mbed).
The SW for it is a nightmare.

  1. Arduino IDE gets so slow after a while:
    A fresh start of IDE is fine: flashing board is quite OK.
    But after some iterations, new upload of FW - the flash loader messages are sooooooo! slow.
    OK, notification tells me: "upload finished" (and it is true: even all the erase and download messages are still tickling in (1 character per second!) - board is ready.
    ==> What is this?
    (almost impossible to make a change on code and try again - you have to wait minutes just to
    let these message finish, no way to interrupt, no way to kill a running command, your "turn-around-time" increases to tens of minutes for small code changes - "rrrrrr")

  2. Arduino IDE is not working in my company office:
    I need Portenta H7 and Arduino actually in my company office. But it turns out: NOT USABLE!
    It looks like, due to virus scanner running (and some company IT tools to monitor) - the compilation process is almost broken.
    It takes hours - really hours! - just to compile a small sketch. No fun in office (it works just at home).
    And - the worst case:
    Any USB device is prohibited to be used on office devices (IT policy).
    Even the UART from Portenta H7 works fine - the flash loader is completely blocked - no way to flash the board (assuming it comes up as another USB device and is blocked/prohibited).

To be honest: I do not understand this Arduino IDE - for what is it useful?
a) there is not any debug feature for Portenta H7 - a nightmare to debug with UART print strings (I thought this 1980's debug approach is gone)
b) I cannot open and browse any H-file, cannot open the declaration of functions etc.
Sometimes it works a bit to see the "Loading..." and hints popping up. But it looks like, if you have a syntax
error in your file, you try to see the hint for function call with typo ... it never displays anything anymore (seems to keep running endlessly).
c) the syntax highlighting lacks so behind: I change a piece of code - it takes minutes to see
the curly line disappearing, to see the color changed etc.
d) any #if 0 or #if 1 looks the same: the editor does not show me which code is inactive, all
looks active.
d) If I use Arduino IDE, esp. compile code - it makes the PC/laptop 100% busy. I saw, esp. in office a 100% CPU utilization. Even at home, the fan is always running, cooling down my CPU, when the IDE is open.

To be honest: it is painful to use Arduino IDE. I have never seen such a feature-less and full-of flaws IDE.
==> why I cannot use any other IDE, e.g. STM CubeIDE, IAR, Keil, ...? Why I am forced to use Arduino IDE only (which does not provide what I am expecting from an IDE)?

My productivity on this board is so bad - I have to give up with Portenta (and any Arduino HW/SW at the end).

And this ARM mbed drives me crazy:
I want to follow the examples, e.g. for Web Server based on this EthernetClient.
Even the sample code works - it is sooooooo slow:
There is a call like c = client.read(), for single characters received on ETH, get these from buffer - after approx. 120 characters pulled from receiver buffer - it is soooooooo slow. The characters tickle in with approx. 500ms delay even all must have been received already.
Any HTTP request takes seconds just to get their characters into my code.
Has anybody tested the examples also in terms of "reasonable" performance?

And I saw also so many bugs and missing features in ARM mbed LIBs, e.g.:

  • SPI devices cannot be set to use "LSB first" on SPI packets - nothing to change from MSB vs. LSB first on the SPI wire. It is a HW feature in Portenta, but not available on API. I do not want
    to flip bits just because ARM mbed does not let me change the HW feature to do.
  • in function transfer16 is the same code for Little and Big endian, this code would never swap the bytes of 16bit or larger words. When I saw it - why the hell nobody has realized that it cannot do what is should do? (code reviews missing for ARM mbed library?)

My BIG WISH to Arduino team, the Portenta H7 HW guys etc.:
! - please, publish and provide the BSP, HAL, the source code for the FW, startup, config of Portenta H7 boards (esp. the config of this I2C based power controller, ETH, DDR RAM etc.)
!- make it possible to create a project with other IDEs, e.g. STM CubeIDE, IAR, ...
!- and make it possible to flash this FW via SWD debug interface, to have a real debug with breakpoints, to use STM FlashProgrammer to burn the OB bits etc. (e.g. to disable CM4)

Another productivity hindering issue:
When I have 100 clients - how could I send them just a new FW version (of my stuff) and let them flash the new version?
It looks like, there is not any other tool besides Arduino IDE, to flash a new firmware (via this very slow, sensitive and always complaining flash loader in Arduino).
==> I want to provide and distribute just a new FW bin file and let all my users to update their
boards. But how? Is there any simple flash loader out there for this Portenta H7 board.
Please, provide a standalone flash tool just to burn a FW image file (w/o IDE). Thank you.

Such a nice board, such a great feature rich piece of HW but the SW and tool chain for it makes is only reasonable to be used by hobbyists (with more time as me), not for a professional, commercial and efficient business approach.

The Arduino IDE is too slow, has so many lacking features and flaws , the ARM mbed so many
bugs - it makes it quite obsolete to use the Portenta H7 in any commercial/company environment.

I am sorry. Even I could get "something" to work on this board - the efficiency and "my performance" with all the trouble is so bad - I cannot convince my boss anymore to use this board for our needs (test of other HW systems, e.g. SPI, network traffic).
I am short before to give up (and never to use anymore any Arduino, mainly because of the IDE, esp. when you have seen other IDEs before).

Torsten
PS: I am so familiar with MCUs, STM, also the dual-core used on Portenta H7. But never seen such a "strange" IDE for STM chips (with so many lacking features).
I hope, the Portenta H7 will be dead just because of its SW tool chain (IDE).

Sorry, I mean: I hope Portenta H7 will NOT be dead because of ... IDE.
BTW:
I saw this new Portenta X8 (with Linux on an NXP chip). A really cool board (and HW).
But after my experience with Arduino IDE - I am very skeptical to "try" it. What a pitty.

Please, Arduino and Portenta H7 team,
publish and provide the BPS, HAL (and ARM mbed startup code) so that
I can use another (even STM) IDE to develop and also to debug my projects.
Thank you. I will appreciate so much.

So you are saying it works fine at home but YOUR company’s IT policies and background running checks just prevents you to wok?

may be you should let your IT team know that they need to look into this as they don’t support productivity…

If this is for a commercial product, have your company buy a professional IDE.

Otherwise, enjoy your hobby at home, where the Arduino IDE works, and stop whining.

I have successfully used Visual Studio + Visual Micro to write code, as well as debug via GDB and the USB port - only limitation is no more Serial.Prints, but that was not needed in my case anyways.

Visual Studio is a nicer environment than Arduino IDE, but you can switch back and forth in the same project.

So far my experience is just starting out, but everything seems OK, except for the occasional slowness as a result of the Visual Micro plugin within Visual Studio.

Just to mention, the debugger is similar to the free Lauterbach license - in that I can single step, view variables etc. I think it is much easier to use, and it is one environment for writing and debugging the code, so much better

Thank you for pointing me to Visual Micro. I appreciate.
Even I got it to work and it looks much better - is also "a bit strange":

a) you have to have a downloaded version Arduino 1.8 (not 2.0rc), in order to install/setup
b) compile time is 3x longer as Arduino 1.8 IDE - "already a killer"
c) it needs a double reset button press (for downloading, the other tools don't need)
But: it works, cool.

  • exception: no debug features (no way for breakpoint and stepping through code)

The quite strange things:

  • it complains in IDE with many not found includes, unknown types (the curly line below),
    but it compiles at the end properly (what? compiler is smarter as the GUI?)
  • in Debug mode - it creates trace and time messages on UART: OK, but the UART monitor
    shows me all sent messages properly but does not act properly on my UART inputs (with external TeraTerm all is fine, except to have also these trace log messages, I don't care, external UART tool works, just these annoying generated trace messages on UART...)

Even it looks like a "great tool" for now, the turn-around time (change-compile-test) is still
too large (3x longer as Arduino 1.8). And no way to kill a running compile ...

The best option seems to me right now: "stick with Arduino 1.8":

  • the fastest of all tool chains
  • but missing a lot of features, e.g. missing just to see list and browse files of my project (no project view)
  • fastest turn-around time with the most lacking features of an IDE

And I found again a strange piece of code in library files:
...\Arduino15\packages\arduino\hardware\mbed_portenta\3.0.1\libraries\SocketWrapper\src\MbedUdp.cpp

size_t size = txBuffer.available();
uint8_t buffer[size];

which spits out properly a warning. How could such code work?

Why is the IDE compiling always all again if already done just download the generate code?
(is it not makefile based or missing dependencies between bin file and source code file?)
If you close and start IDE again - all is like after a "clean" (it does not remember any existing code built).


Professional IDE:
We have IAR, Keil, Nokia Qt ... - how to use with this board?

A nice board but the tool chain for it ...? Really for professional use (in companies, for business)?

1 Like

Hi @tjaekel. Thanks for taking the time to give the Arduino IDE 2.0.0 release candidate a try and for sharing your feedback.

This issue is tracked by the Arduino IDE developers here:

There is some related discussion here:

That was in the context of Arduino IDE 1.x, but I think it is still relevant to Arduino IDE 2.x as well.

The Arduino IDE is a tool for developing Arduino sketches. That is the unit it works with.

Every sketch must contain at least one .ino file, but you are also welcome to add .h, .cpp, .c, .S, etc. files to your sketch if you like.

The "Go to Definition" and "Peek Definition" features will open the library or toolchain files that contain the definition. You can also do this to the header filenames in #include directives.

There are some known issues with the language server capabilities of the Arduino IDE. They are listed here:

https://github.com/arduino/arduino-ide/issues?q=is%3Aopen+is%3Aissue+label%3A"topic%3A+language+server"+label%3A"type%3A+imperfection"

If you find any specific issues that are not already tracked there, it would be very helpful if you would provide a detailed description of the problem and instructions we can follow to reliably reproduce it. You are welcome to submit a report directly to the project's issue tracker on GitHub, or here on the forum if you prefer.

This issue is tracked by the Arduino IDE developers here:

You are not.

There is currently a proposed fix for this:

If you would like to test it out and report your results there, I'm sure that would be helpful to the developers.

You are welcome to submit a bug report or contribute a fix to their open source repository.

I think most of it is in this repository:

Arduino does also maintain a fork of Mbed OS, (though the work done there is contributed to the upstream Mbed OS repository owned by ARM):

Arduino IDE doesn't do the flashing. It uses dfu-util. If you enable Show verbose output during > upload in the Arduino IDE's File > Preferences dialog and do an upload, you can see the exact dfu-util command it runs to flash the board.

The "pattern" used to generate that command is defined here:

https://github.com/arduino/ArduinoCore-mbed/blob/3.0.1/platform.txt#L179

Arduino's cross-build system for dfu-util is hosted here:

But you can get dfu-util directly from the upstream repository:

Or you might like to use Arduino CLI as a higher level solution:

https://arduino.github.io/arduino-cli/latest/

Are you sure it is compiling always all? That is unexpected. The sketch code is always compiled (after all, why would you compile again if the sketch code hadn't changed), but the libraries and core are cached on the first compilation and will only be recompiled if you modify them or change to a different board (because this changes the context the sketch is compiled in).

If you have verbose output enabled, the output should show you the cached components that were not recompiled. For example:

Using cached library dependencies for file: C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\3.0.0\libraries\SPI\SPI.cpp

[...]

Using previously compiled file: C:\Users\per\AppData\Local\Temp\arduino-sketch-8E22E2A95CA6BF1CE066CB1A2C89316F\libraries\SPI\SPI.cpp.o
Compiling core...
Using previously compiled file: C:\Users\per\AppData\Local\Temp\arduino-sketch-8E22E2A95CA6BF1CE066CB1A2C89316F\core\variant.cpp.o
Using precompiled core: C:\Users\per\AppData\Local\Temp\arduino-core-cache\core_arduino_mbed_portenta_envie_m7_split_50_50,security_none_f434b314a6d833e69af141e71c31a3e0.a

It is not Makefile based. You can learn all the boring details here if you are so inclined:

https://arduino.github.io/arduino-cli/latest/platform-specification/

The free open source tools openocd, arm-none-eabi-gcc, dfu-util are surely used by many embedded systems professionals.

1 Like

Thank you for the detailed response. I appreciate.

I will publish a post about my experience with (very slow) ETH throughput and how to improve.
Just to rephrase some issues:

  • close and start GUI - it compiles "all" again
  • I was expecting, after a compile done and "just" start debugger - debugger will start quite immediately, but it does not (still a minute to let parse all the code again).

At the end: I had to spend so much time to figure out the "limitations" of the API and how to "work around" it. mbed API has so many strange behaviors.
Example:

  • ETH RingBufferN is set to 256 bytes (only) - reading more as 256 bytes in chunks via
    client.read(buffer, 1024); returns just 256 bytes (obvious, macro set to 256),
    hard to figure out how to change and improve
  • if you do a lot of client.println(...) for a HTTP response and you think you can close the
    connection (as web browser expects to have a closed and new connection), the call of
    client.stop() does NOT flush! it closes the local connection way before all was sent
  • BTW: every client.println(...) seems to generate a new TCP handshake. I have assumed I can
    let "queue" the lines of a response and API will send entire response as a single response.
    Wrong assumption, obviously.
  • I need a critical region semaphore. But the example from mbed to use Semaphore.wait()
    does not work. The only way is to use the CMSIS RTOS API, features and syntax, as
    osSempahore().
    Even I include "mbed.h" - I do not have a Sempahore. "RRRRRR"

The learning curve for Portenta H7 mbed is so steep just because of the fact that you
had to figure out how the API behaves. You cannot assume it will work as you would expect,
e.g. a socket connection close (client.stop()) will do a flush of active buffers.

Never mind. It works a bit I want to have it. But the time spend just "to understand" what is
going on is huge.

And when I try generic Arduino mbed examples from the Internet, web site, help, blogs... they do not work. Example:

  • the UART Tx is pretty slow, I guess it is not using interrupt Tx mode
  • but the code found on official mbed web sites to use UART interrupt does not compile
    (the code is not 1:1 compatible with my environment, a method missing on Serial.attach())

It is not hard to use Portenta H7, mbed etc. It is hard to figure out what works and what not.
And very hard to find the hooks to improve the performance. And ETH throughout as an HTTP request with 64 KB request, the SPI transaction 64KB (10 Mbps = 0.05 sec max.) and 64 KB MOSI response back - has started with a "round-trip" delay of 33 seconds (half a minute!) when you start with sample code.
I could bring it down to 3.7 seconds (separate post, how). Acceptable.
But still slower as expected, UART way to slow (sending single characters in SW polling mode)... My bare metal STM boards (even with the same chip used) are remarkable faster.

BTW:
I want to use the other cool features of Portenta H7, e.g. SDRAM, QSPI, SD Card, but just the
simple questions coming into my mind create a "frustration" where to find the starting hooks:

  • QSPI flash:
    how to flash it? (e.g. with code generated and part of my project, what is the work flow?)
  • SDRAM:
    how to place my data (or code) on SDRAM (where is the linker script to do so)?
  • SD Card:
    where to find an example how to configure and use?
    And is there a FatFS file system possible? (how to select to get FatFS as part of my project)?
    And is it at the end working together with RTOS (mbed or CMSIS)? Is the FatFS thread-safe
    in mbed environment

Best regards
Torsten Jaekel
PS: to be honest: a very nice board, this Portenta H7, but the tools and API environment (mbed)
are so time consuming... My performance to work on a FW for it is so slow... my boss will never
accept to "fall back" to a better board with such a dramatic decrease in efficiency. I am pretty
sad to have told our teams: "a better board, increased performance" for our needs and at the
end I cannot achieve what I have done already with similar STM boards. "rrrrr"

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.