Arduino Development on aarch64?
Brian McGovern (bmcgover)
bmcgover at cisco.com
Tue Aug 24 13:47:08 UTC 2021
Tomasz,
> Hey Brian, very good question, not silly :-)
> I work with this kind of embedded stuff on FreeBSD AMD64 for years.
> Also helped with tools for ARM and Linux. So it should be possible on
> FreeBSD too. I am nor sure on status of some specific tools here with
> FreeBSD running on ARM sorry I work on AMD64. Your research and
> patches would be much appreciated in this area :-)
I've had some good luck. I'm not sure its the right way forward, but I figured I'd share it here as a reference to others, and that someone might pick up my changes.
My environment: RPI4 w/8GB, FreeBSD 13.0 Release, X running at 1920x1280 per various documentation.
1.) /usr/ports/devel/gcc-arm-embedded is marked as broken for aarch64. This does not appear to be the case in the hardware configuration above. Commenting out the "BROKEN_aarch64" line had it building fine as near as I can tell. Maybe this is related to my memory/swap note, below?
2.) There appears to be a name space conflict in /usr/ports/openocd/work/openocd-0.10.0/src/target/nds32_tlb.h over PAGE_SIZE_4K, and the redefinition breaks the build. Since the definition is fairly local, it looks fairly safe to use this patch to undefine the system definition before redefining and using it where needed. Since it looks like you created the original port, and I'm cc'ing the maintainer, hopefully one of you can either incorporate this, or re-think the solution (e.g. maybe use "PAGE_SIZE_IS_4K" instead to avoid the namespace problem here).
*** nds32_tlb.h.orig Tue Aug 3 05:26:01 2021
--- nds32_tlb.h Tue Aug 3 05:25:29 2021
***************
*** 20,25 ****
--- 20,26 ----
#define OPENOCD_TARGET_NDS32_TLB_H
#include "nds32.h"
+ #undef PAGE_SIZE_4K
enum {
PAGE_SIZE_4K = 0,
PAGE_SIZE_8K,
With those two changes, I was able to get the arduinio18 port built. I've tested several of the basic examples available with my UNO locally, and I didn't have any issues with the code compiling, downloading, or running. There may be some more complicated cases that I haven't hit yet, but if I hit anything, I'll let you know.
Oh, as a point of reference, I _have_ seen issues with lower RAM boards building some of the dependencies - Java and gcc being two offenders that come to mind. The work around was to add a swap file, but I've seen a few cases where this can be unstable (e.g. one of my USB 3.0 USB drives) and cause hangs and crashes in addition to heavy swapping, so YMMV (and hence why I focused on using my 8GB Pi 😉 ).
Enjoy.
-Brian
________________________________
From: Tomasz CEDRO <tomek at cedro.info>
Sent: Friday, August 13, 2021 2:43 PM
To: Brian McGovern (bmcgover) <bmcgover at cisco.com>
Cc: freebsd-questions at freebsd.org <freebsd-questions at freebsd.org>
Subject: Re: Arduino Development on aarch64?
On Fri, Aug 13, 2021 at 7:34 PM Brian McGovern (bmcgover) wrote:
> This is likely a silly question, but is there a solution for doing Arduino development on any of the ARM 64 platforms? From what I can see in the current ports tree, it looks like gcc for arduino is marked broken for aarch64, as is the Arduino 1.8 IDE. I'm just trying to figure out if I can do some Arduino programming (CLI/text mode is fine, IDE is a bit better) from my PIs, or whether I should plan on an AMD64 platform for this.
Hey Brian, very good question, not silly :-)
I work with this kind of embedded stuff on FreeBSD AMD64 for years.
Also helped with tools for ARM and Linux. So it should be possible on
FreeBSD too. I am nor sure on status of some specific tools here with
FreeBSD running on ARM sorry I work on AMD64. Your research and
patches would be much appreciated in this area :-)
It depends on particular target and RTOS that you would like to use.
Because I don't really like Arduino and its GUI approach, I prefer
standalone shell build environment. I have worked with MBED and Zephyr
on FreeBSD with success. Some friends from Brasil tease me with NuttX
that was until recent change released on BSD license and it also works
on 8-bit+ CPU :-)
I usually work with ARM Cortex-M faimily with Zephyr RTOS +
gcc-arm-embedded package and pyOCD + Python VirtualEnv for flashing
and Debug over DAPLink. Instead using Arduino Espressif for ESP32-C2
(Xtensa CPU) I am using also Zephyr RTOS + Linux toolchain that with
my recent patch install itself for Zephyr with just `west espressif
install` :-) I have ordered ESP32-C3 with Open-Source RISC-V CPU but
will have to wait for a free moment to play with it and Zephyr.. I saw
the commits with support added :-)
Therefore you may also play with Zephyr or NuttX as the elegant full
Open-Source well designed solution :-) Arduino SDK works on FreeBSD
AMD64 but it mostly relies on external modules. You can even use it
with ESP32-C2 (see wiki below) but that needs some manual dirty hacks
to use Linux toolchain.. thus I am not sure if that runs on ARM
Linuxlator.
Here is small wiki of Electronics on FreeBSD:
https://wiki.freebsd.org/electronics
You may play with some MCU tools on ARM FreeBSD and update the wiki
where necessary :-)
Have fun! :-)
Tomek
--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
More information about the freebsd-questions
mailing list