Circuitpython for raspberry pi with ubuntu 22.04 64-bit?

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
nocom
 
Posts: 9
Joined: Thu Jan 19, 2023 3:37 am

Circuitpython for raspberry pi with ubuntu 22.04 64-bit?

Post by nocom »

Hi,

I am trying to run my newly purchased BNO055 sensor on my raspberry pi with ubuntu 22.04 64-bit. I installed the adafruit_bno055 package and could import it in python. Next I tried to import board and that failed: no such module.

That's where the trouble started. As far as I could see this problem was caused by having no circuitpython installed. So I tried to install that and I got: "Blinka Exiting due to error: Sorry, the OS detected was Ubuntu. This script currently only runs on Raspberry Pi OS.". It appears that the only way to get circuitpython up and running is by compiling and installing it by my self. Please correct me if I am wrong, the documentation is not clear and I tried it and failed.

I tried to setup circuitpython following these instructionshttps://learn.adafruit.com/building-circuitpython/linux. Installed the Cortex-A toolchain, with the 10.3-2021.07 version because circuitpython is version 7 or higher. When I downloaded that version of the toolchain it was something different than was suggested in the instructions: gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf instead of gcc-arm-none-eabi-10-2020-q4-major. It seems that I got the 64 bit version which suited me fine as I run on a 64bit system.

Everything seems allright until I try to make a BOARD=raspberry_pi4b:

Code: Select all

$ make BOARD=raspberrypi_pi4b
Use make V=1, make V=2 or set BUILD_VERBOSE similarly in your environment to increase build verbosity.
mkdir -p build-raspberrypi_pi4b/genhdr
GEN build-raspberrypi_pi4b/genhdr/moduledefs.h
[Errno 8] Exec format error: 'aarch64-none-elf-gcc'
[Errno 8] Exec format error: 'aarch64-none-elf-gcc'
concurrent.futures.process._RemoteTraceback: 
Please don't tell me that my new shiny BNO055 sensor does not run because circuitpython does not run on ubuntu 64bit. Tell me that I did something stupid and that my problem can be solved!

Seriously: what must I do to run the BNO055 sensor in ubuntu 22.04 64 bit? And looking to the next phase of the project: what must I do to get it running in ros2 humble hawking? I saw an entry of adafruit in the rosdep python config file. Does that mean it will be installed without problems?

Thanks in advance for any help!

User avatar
dastels
 
Posts: 15608
Joined: Tue Oct 20, 2015 3:22 pm

Re: Circuitpython for raspberry pi with ubuntu 22.04 64-bit?

Post by dastels »

CircuitPython runs on on the bare metal on embedded microcontrollers, NOT on Linux, i.e. the Pi. On the Pi you use cpython 3.something and Blinka. That gives you access to CircuitPython libraries/drivers.
As the error says, ubuntu isn't supported, only Pi OS. You can probably add support for ubuntu on Pi. I'd start by looking at https://learn.adafruit.com/adding-a-sin ... -to-blinka and https://github.com/adafruit/Adafruit_Blinka.

Dave

User avatar
nocom
 
Posts: 9
Joined: Thu Jan 19, 2023 3:37 am

Re: Circuitpython for raspberry pi with ubuntu 22.04 64-bit?

Post by nocom »

Thanks Dave, I'll do that.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”