Skip to content
Snippets Groups Projects
Commit 3d5976e0 authored by Edu Almas's avatar Edu Almas
Browse files

Add doc for Week 08 - Explore other platforms

parent d30efbe2
No related branches found
No related tags found
No related merge requests found
Pipeline #293847 passed
#Embedded Programming
Group assignment: compare the performance and development workflows for other architectures
## Checking out other tools and platforms
- extra credit: try other programming languages and development environments
During the development phase of this week's assignment, I wanted to explore other environments and tools.
These are 3 of the environments I explored:
- Platform.io on VSCode (on linux) ⭐
- VSCodium
- IntelliJ IDEA (on linux) ⭐
- CLion
- Arduino emulation on [Wokwi](https://wokwi.com) ⭐⭐⭐⭐
### VSCode (linux) using the Platform.io plugin
#### How to install Platform.io on Linux Mint
Download [VSCode for Linux](https://az764295.vo.msecnd.net/stable/c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1/code_1.65.2-1646927742_amd64.deb)
from the official site. and install it using apt
```shell
sudo apt install ./code_1.65.2-1646927742_amd64.deb
```
Platform.io uses [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux) (Microsoft) + the _Platform.io
plugin_ to provide an IDE
Platform.io can be installed (as a standalone toolchain), but it does not seem to support SAMD11C [[1](https://registry.platformio.org/tools/platformio/framework-arduino-megaavr-megatinycore)]
, [[2](http://fabacademy.org/2021/labs/agrilab/students/theo-gautier/assignments/week09/)].
![](week08-embedded-programming/platformio-install-atmel.png)
While it supports some Atmel boards, it does not support SAM-D11C.
### VSCodium (linux)
VSCodium seems to be a modified version of Visual Studio Code, with no telemetry (nice). Despite this nice gesture, it
has even worse support for Platform.io.
![](week08-embedded-programming/vscodium.png)
It can't even find the platform.io plugin. So it got uninstalled in less than 10 minutes.
### IntelliJ IDEA (linux)
[IntelliJ IDEA](https://www.jetbrains.com/idea/download/?fromIDE=#section=linux) would have been my preferred method of
working, since I'm familiar with the JetBrains family of IDEs. I could find a basic wrapper plugin that allows cpp_check
to do basic syntax checking, but nothing beyond that.
Installing cpp-check to validate cpp code
```shell
sudo apt install cppcheck cppcheck-gui
```
It also requires you to install cpp_check manually, so the plugin is basically a wrapper that can highlight lines of
code in the editor, but not much else (no refactor capabilities, no syntax highlight or prediction, et...)
### CLion with official Plugins for Arduino
I would have liked to try out [CLion](https://www.jetbrains.com/clion/download/#section=linux).
It seems to have better plugin support, from the official
marketplace: [Official Arduino Support plugin](https://plugins.jetbrains.com/plugin/11301-arduino-support)
Unfortunately, since it has no community edition, I didn't want to start the 30-day trial just yet, but I might look
into it in the future (final project?), when I need heavy IDE support.
I've been a big fan of JetBrains for years, and I'm expecting that this combo packs a bunch of goodies out of the box.
### Emulating the circuit with wokwi.com
![](week08-embedded-programming/emulation-in-wokwi-dot-com.png)
See a [simplified simulation at wokwi.com](https://wokwi.com/projects/326858429404545618)
This was a really nice discovery:
It allows us to emulate LOTS (not everything) of the behaviour of our board (not just the microcontroller but also the
components attached to it!) and it provides _semi realtime_ simulations of the behaviour and the outputs.
It could not emulate everything perfectly:
1. In order to generate pseudo-random numbers, we need to initialize the random generator with a seed.
1. The emulator was able to simulate a random seed with faking noise into an analog unused pin, but on the real
board, the seed always ended up being the same and the sequence of "random" numbers was always the same, making
the game a bit boring.
2. The emulator assumes infinite memory. so the first iterations of the program were too large to fit in memory and
would get `region 'FLASH' overflowed` errors.
docs/assignments/week08/week08-embedded-programming/emulation-in-wokwi-dot-com.png

296 KiB

docs/assignments/week08/week08-embedded-programming/platformio-install-atmel.png

167 KiB

docs/assignments/week08/week08-embedded-programming/vscodium.png

244 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment