Arduino IDE 2.0
blog.arduino.cc
blog.arduino.cc
My VSCode setup is already crowded with Development tools for other platforms and the Arduino IDE reliably works, with the libraries. I’ve been using the 2.0 beta for awhile And it is really nice. I’m pleased it’s made it out of beta.
I really think that professional software engineers are trolling "normal people" with stuff like this. Oh, you want to be a programmer? Jump through these 8 million flaming hoops suspended over man-eating sharks, and you'll see just how hard it is to make an LED blink. After failing, you will dedicate a new national holiday to our sacrifices; we do this for a living and you should be grateful that literal human garbage like you are even allowed to THINK about monitoring the water level of your potted plants. But behind the scenes, we don't do this for a living. When we press TAB, our IDE knows exactly which level to indent the text too. When we want to reflash our microcontroller, it does a diff of the last binary we pushed and updates only the 3 flash cells that actually changed and updates it in microseconds. When we want the documentation for some library function, it pops up in a web browser hovering above our cursor. Our life is nothing like this. We just use our skills to give you tools to make you think programming sucks.
It's all a scam.
It's like the legal system where emails are converted to fax when sent and then back to email when received.
That said, I think Mbed should have eaten Arduino's lunch but they kept making loads of different terrible build systems, and there are still a load of old boards available that need firmware updates to work properly. I have a couple of K22F's that have been bricked just by plugging them into a Windows machine. Never happened with Arduino.
So yeah, Arduino have sat still at the "it's rubbish but it works pretty reliably" stage while Mbed has failed to get beyond "it's great... when it works".
Not every tool is for everyone, and that's fine :)
It literally recompiles all code on every verify or upload (because "we don't want lots of machine objects littering hard disks")
So on any of the mbed based boards compiles are like a minute or two for anything. On platformio and other compatible ways, it is instant.
So even for basic messing around I don't use the Arduino ide because it makes it not fun
This alone was reason for me to move to PlatformIO. It's infuriating.
A main.cpp that includes all other .cpp files and a build.bat that recompile everything, it's always been instant.
And I do use a some amount of template and constexpr for peripheral setup code (computing all the constant values for GPIO config registers with a nice "DSL" of sort for example).
It all compiles nearly instantly. So you can have large apps that work fine in that space and time.
I haven't debugged the differences in compile options, etc. I suspect it is related to constant data handling differences (they both have the same RTTI, exceptions settings. They both use the same GCC version). But IMHO there can be very wide variation in the size of literally the same code.
In the case of arduino, they don't provide you anything that could be used to flamegraph it, but i suspect it's just recompiling a significant part of mbed each time or something.
The non-Mbed based ones are faster to compile for sure.
[1] The one thing Zephyr does not yet support is std::thread/std::mutex, but it's really easy to make it work in your app because the build system functions properly, so i did and sent them patches as an example. They are working on proper support in the toolchain. Just need to rebuild it with some different config flags and twiddle a few files. MBed fully supports std::thread/etc if i remember right.
What did you do to your computer? My 5 year old Ryzen desktop opens the Arduino IDE in ~1.5 seconds.
I blame windows stuff I guess, it's definitely not just CPU power
My top of the line macbook, with a fresh arduino 2.0 ide install on MacOS, is the same way.
Meanwhile, literally everything else works great.
This is absolutely an Arduino problem. avr-gcc for a small program often compiles faster than the time it takes to upload with avrdude. And the IDE uses both underneath. Or compared to Atmel Studio, which is surprisingly not bad.
The more you treat "Arduino project" differently from any other project, the less sense it makes to be using Emacs instead of the Arduino IDE.
Nothings perfect, sometimes you need chip specific functions, but I have so far been pretty lucky.
Like for one project as a student, we had to make a dozen or so units of a custom data logging thingy. The plan was to use STM boards, but I suggested using Arduino software/libs because all the hardware was supported and we didn't really need anything STM-specific. Eyes were rolled, something to the extent of "Arduino is for amateurs and children" was said, so I volunteered to work on the server side instead and let them have their fun with STM32 HAL. They ended up having to interface with most things manually because libs just don't exist or aren't publicly available. Half a year later, they needed to set up a more of these units, but it was in the middle of the supply chain issues and basically no affordable STM boards were in stock. Meanwhile, the local electronics store had more than a hundred Arduinos in the warehouse. My screenshot and winking emoji were not appreciated in the team chat. The new generation now uses various Arduino (Atmel) and ESP boards with software now fully written on top of the Arduino stack with only one or two board-specific sections in the code.
When I was doing a lot more Arduino programming ~5 years ago I ended up using Visual Studio with some pretty good extensions. The Arduino "IDE" really felt more like a basic text editor with an upload button at the time.
I have a particularly hard time forgetting "Linux is a cancer."
https://microsoft.github.io/monaco-editor/
Also Erich Gamma from Eclipse fame, and GOF book, is the main architect.
"VS Code an Overnight Success… 10 years in the making"
https://www.youtube.com/watch?v=hilznKQij7A
VSCode remote editing on Github is it returning back to its roots.
For an absolute beginner PlatformIO is off the beaten path so I'd say skip it to start, but if you have any familiarity with traditional IDEs, PlatformIO is probably 90% as beginner friendly while being more of a traditional development environment.
2.0 being based on Monaco will help bridge the gap, but it's clear that they're still going for a very pared down experience in the Arduino IDE. Other comments comparing it to Notepad are about right... it's very easy to get into Notepad but can be limiting once you get past the initial hump
A workaround is to not follow their suggestion to install from the VS Code plugin and install the command line tools instead.
Also, serial monitoring and plotting isn't very good. I ended up writing my own: https://serialviz.skybrian.com/
That said, package management is more sane. Having a platformio.ini file that you can check in helps with reproducibility.
Happy to see an integrated rich serial data plotter. One of my tricks used to be to do a: Serial.print(inputVal * 100 * "-") to get a basic visual 'chart' stream going to test sensor inputs and the like.
Otherwise, you can do anything Arduino 2 can do with VSCode+PIO, it'll just take some setup.
Actually you can get the same experience with an FPGA if you pay for the FPGA development tools, maybe what you’re asking for is a low cost version of Quartus or similar tools. I would like it if that existed but I fear FPGA makers deliberately want to keep their tooling expensive and hard-to-learn to promote lock-in.
You could certainly use a microcontroller to implement arbitrary digital (or even analog) logic within a circuit. You'll be limited by the CPU speed. The trick is to avoid interrupts, and spin the CPU in a tight poll loop instead. An Arduino Uno's MCU can run an instruction perhaps every 150ns on average. You could implement some simple logic that runs upwards of 1Mhz. If you use a cortex-m CPU, you could do fairly complex logic at several Mhz.
That's a silly way to use an MCU, though. You're supposed to use the peripherals to offload enough complexity from the CPU that you have plenty of cycles to implement your application logic in a straightforward, maintainable way.
You can absolutely compile Verilog to C using Verilator and run it on a microcontroller. The performance is abysmal, and it completely misses the point of using HDL, but it does work. :)
https://www.reddit.com/r/FPGA/comments/r86hod/running_verila...
building a simple hardware dev board is a straightforward exercise.
building an IDE that lets a novice do anything useful on an fpga, outside of a very basic state machine, is an entirely different problem in both scope and structure.
The vast majority of HDL blocks you'd need to make such a thing more useful than a $4 microcontroller are closed source, nontrivial to build, and require careful thought in terms of integrating them into a workable system, not to mention very specific and application dependent PHYs: Things like HDMI, ethernet, USB, etc.
I think what most people would prefer is a fast general purpose CPU with pluggable, low-latency memory mapped peripherals without the hassle of having to know linux systems programming to make it work.
I would argue that you can make your own microcontroller dev board easily enough too. An RP2040 or similar, a USB programmer, some kind of voltage converter, etc.
The joy that Arduino bright to microprocessors was that it was a device that was useful for a lot of projects straight out of the box, accessible to those with only high school knowledge of circuits or programming.
However I'm not sure how much people use it and if it really has the simplicity that Arduino brought to tinkering with microcontrollers. I read and hear a lot that the FPGA dev tooling is usually not really great to use and very vendor-specific, but it's something I haven't tinkered with yet so I don't really know much !
[0]: https://store.arduino.cc/products/arduino-mkr-vidor-4000
It's an Arduino with an FPGA on it, yes. But the FPGA is practically a hood ornament: there is no support whatsoever for building gateware in the Arduino IDE, only for using a set of prebuilt demonstration bitstreams, and what little documentation Arduino has provided on using the FPGA (e.g. https://docs.arduino.cc/tutorials/mkr-vidor-4000/vidor-quart...) is extremely vague and is missing a lot of critical information.
(Additionally, some of the product specifications for the board are highly misleading -- for example, some pages refer to the edge connector as "mini PCI Express" and suggest that it can be used "to creat [sic] your own PCI interfaces", but the FPGA on the board does not support PCIe.)
You're much better off with a dedicated FPGA development board. Arduino hasn't brought anything useful to the table here.
Not that you have an answer, but it makes me wonder what is the target audience for this board ?
I have a feeling that the primary audience for this product was Arduino's own management team, rather than any actual customer needs.
I want a gcc or LLVM like compiler ecosystem that can handle multiple vendor backends and language front ends so we can use vhdl, verilog or a new hdl in a project. Let me write portable modularized logic files that let me abstract the underlying hardware so I can target different vendors and devices. Decouple layout and let the community create as many textual or graphical layout tools as needed. Then let me write a makefile to handle the build process. I don't want to worry about switching gigabytes of tooling so I can move from a Xilinx to Lattice or Microchip FPGA or SoC. These tools will be a boon to devs using those awesome FPGA SoC's as you can self-host the toolchain on the SoC itself.
I did a bunch of fpga self learning around 2012 and spent a lot of time fighting with getting ISE to run on Linux. I then tried Altera and then fought with fought with Quartus (though from memory I think it was easier to setup). Then ISE was replaced by vivaldo and I felt discouraged by having to adopt a new IDE contraption with more licensing woes. Then my hard drive died and I've never bothered with wrestling fpgas since. The two fpga boards, a Digilent Nexus 3 and Terasic de0 nano collect dust. I gave up because the tools sucked and i wasnt using them to make money.
Also IPs sometimes have errata in them that need to be worked around. With an FPGA, you can usually fix it in soft logic, but vendors don't like giving that out either.
For some smaller FPGAs without complex IPs, they are starting to open up their bitstream generation algorithms. Though bitstream generation is pretty trivial compared to synthesis and place & route.
It's only a first step though. Still needed: an Arduino-like IDE where you can click-and-run your design; examples that match the board you are using; examples to use peripherals(1) without having to resort to vendor IP blackboxes.
We're also eternally stuck with HDLs that are either crappy, niche-only, or add loads of complexity -- but I'm not really sure how bad this is for a beginner. Getting Verilog syntax right is probably only half bad if you have good IDE support.
(1) talking to an SDRAM is easy, getting DDR3 timing right on an ECP5 isn't. A simple "this is how you do it" example would be priceless, not being stuck between blackboxes from Lattice and Migen exception stacktraces.
The Arduino IDE 2.0 beta - https://news.ycombinator.com/item?id=27123410 - May 2021 (120 comments)
But with that said, PlatformIO is super impressive.
"The new IDE is based on the Eclipse Theia framework, which is an open source project based on the same architecture as VS Code (language server protocol, extensions, debugger). The front-end is written in TypeScript, while most of the backend is written in Golang."
A VS Code plugin might have been better indeed.
If your eyes are feeling strained/sore, stop using your computer for a while.
If reading black/dark text on a white/light background is regularly causing you discomfort, consider improving the lighting around your display. Ideally, get regular sleep and go outside (in the sun) every day.
Light text on a dark background ("dark mode") takes more work to focus on because more dilated pupils let more light in. Your eye muscles doing work causes eye strain.
It takes one update from vscode to break everything and your SOL.
still, happy to see this update.
I'm hesitant to change for fear of breaking my working install.
https://docs.arduino.cc/software/ide-v1/tutorials/PortableID...