Build chain for linux (fedora)

Unboxing Rev F Tympan

My new RevF board arrived and worked great out of the box: I wasn’t sure but plug in earbuds, switch on, listen, switch off, listen seemed like a plan.

Second task and maybe more about teensy than tympan is to upload a sketch eg basic gain. Some successes to share but still no banana, I’m also a little worried about bricking my tympan if I build and upload a bad hex file.

Maybe I’ll get a bare teensy 4.1 to practice on, or dig up an old windows laptop if that’s the underlying issue. I’m up to “BLE/ble_BC127.h:6:10: fatal error: ble/ble.h: No such file or directory” so far and taking a break.

Teensy Loader Binary (and ‘brew’)

The instructions for the teensy loader from pjrc here involve building from source and although I could; it’s not a great pathway.

So first success: the package manager ‘brew’ includes teensy_loader_cli and loaded a heap of dependencies automatically.
INSTALL:
brew install teensy_loader_cli
AFTER:
$ brew list --version | grep teensy
teensy_loader_cli 2.2
RUN:
teensy_loader_cli --mcu=TEENSY41 -w teensy_loader_cli.hex

… but needs a .hex file to drive it and there’s the teensy_loader_cli.ino file in github at (https://github.com/Tympan/Tympan_Rev_F_Hardware.git):/TympanF_basicGain/TympanF_basicGain.ino

=> I’ll still need to run a board-specific build .ino to .hex

arduino-cli (not yet)

It’s a long time since I’ve run the arduino gui, mostly I use the arduino-cli which works great and might even be supported by the arduino team themselves.

With Tympan plugged in and switched on, lsusb can see the teensy chip interface but arduino-cli doesn’t know what it is:

$ lsusb
Bus 003 Device 012: ID 16c0:048a Van Ooijen Technische Informatica Teensy MIDI/Audio

$ arduino-cli board list
Port Protocol Type Board Name FQBN Core
/dev/ttyACM1 serial Serial Port (USB) Unknown

install log

Since I haven’t run the arduino gui in a while, then it means I can do a clean install and not break any existing build chains.

The reference I liked most turned out to be ancient (2013 and a 2.0 teensy ie different architecture) but strangely relevant ‘HalfKay’.

arduino 1.8 gui

You do need the Arduino gui install, it provides the folder structure that teensy requires and updates. For me the linux 64 was a clean install (off the arduino website / no package manager) and came in from https://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz ie requires a further $ tar -xJf ~/Downloads/arduino-1.8.19-linux64.tar.xz into where you want it to go).

  • There’s a binary ‘arduino’ in the root runs up the gui

  • There are some install shell files there also which I ran also ''arduino-linux-setup.sh" eg set up some group memberships … or at least said it did.

arduino 1.8 install fix (java version)

Although it ran okay, the menu system was blanked. Caused by the required font not being found. Fix is as follows:

  1. rename the java folder inside /arduino 1.8/
  2. sudo dnf install java-latest-openjdk
  3. sudo alternatives --config java (for me was openjdk 17 → 22)
    ref: Arduino IDE 1.8.13 menu bar and icon options text missing in Archlinux LXQt · Issue #11150 · arduino/Arduino · GitHub

teensy loader binary and udev additional file

Next I ran up the teensy loader binary from pjrc’s website ''TeensyduinoInstall.linux64" which ran up fine even from the downloads folder after I gave it execute permissions. It whinged about my not having added the udev file until I did; as 00-teensy.rules /etc/udev/rules.d/. Then I let it go at the arduino gui folder structure, adding in teensy specifics. If we’re talking user experience then pjrc should work at packaging this better.

Tympan_Library

I added the Tympan_Library under the arduino root /libraries/ as instructed, latest from github. This at least felt clean.

followups

=> I should have tried listing connected boards, confirm it does see the Tympan. Haven’t tried that yet.

=> Also I’d expected the arduino-gui compile to check/ask then load any required dependency libraries. Maybe because my first compile was on an old/bad java version it didn’t ask.

blocker (18 May pm Oz)

So currently I’m looking at this build error (log):

In file included from /Rosie/Hawesy/arduino-1.8.19/libraries/Tympan_Library/src/Tympan_Library.h:82,
from /Stephen/stvh-tympan/sketch_may18b/sketch_may18b.ino:15:
/Rosie/Hawesy/arduino-1.8.19/libraries/Tympan_Library/src/BLE/ble_BC127.h:6:10: fatal error: ble/ble.h: No such file or directory
6 | #include “ble/ble.h”
| ^~~~~~~~~~~
compilation terminated.
Error compiling for board Teensy 4.1.

============================================
^ arduino-1.8.19 is the arduino gui, and sketch_may18b is the name the gui chose when I pasted and saved the TympanF_basicGain.ino sketch.

I’m looking around for a BLE or BC127 library to load into the arduino-1.8.19/libraries/ folder. The Library manager does seem to be functioning but no great suggestions, neither google. Maybe I should try gpt!

Platform IO on VS Code seems a much better way ahead!

thanks @jcamins for your article in the Tyympan_Library docs which got me onto Platform IO.

This works great on Fedora, probably Mac and any other environment incl the default Windows (anywhere you can get python). Now that I’ve installed and configured it I can see traces in the library also eg this platformio.ini file.

This is my latest ini (for RevF):
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
lib_deps =
Tympan_Library
https://github.com/PaulStoffregen/Audio.git
https://github.com/PaulStoffregen/SD.git
adafruit/Adafruit SPIFlash@^4.3.4
duff2013/Snooze@^6.3.9
paulstoffregen/SerialFlash@0.0.0-alpha+sha.2b86eb1e43
paulstoffregen/FreqMeasure@^1.2
paulstoffregen/FreqCount@^1.3
thomasfredericks/Bounce2@^2.72
lib_extra_dirs = /Rosie/Hawesy/arduino-1.8.19/libraries

I’m up to the same problem (#include “ble/ble.h” fail) with this build environment also.

Finding nothing exact online, I’m wondering if there were some git adds missed last commit for some adapter code to link to a third party library. @chipaudette maybe please can you check your last few commits?

Found as Tympan_Library/src/BLE/ble.h (where else would it be!). So maybe my problem is I’m on a caps-sensitive file system so ble/ble.h is different to BLE/ble.h. Next week …

I’ve not used platform IO myself, so I can’t offer much specific there. All I can do is guess…

The error regarding “ble/ble.h” might be because it’s in quotes I stead of in brackets? If you edit the code and change that line to be #include <ble/ble.h> does the problem go away on PlatformIO?

Oh! I just now saw your updated post. Caps sensitive…mm…that’s a good hypothesis. If that fixes your problem, let me know and I can fix the library.

Chip

The more that I look at your messages here, the more that I think that you’re right that the problem is the lower-case vs upper-case problem with the path names (“ble” vs “BLE”). Sorry! I always forget that Linux is case sensitive.

I have now updated the Tympan_Library to use (I think) the correct case for all the references to the BLE libraries.

Also, be aware that last week I released a big upgrade to the Tympan_Library in order to support the new bluetooth module in the Tympan Rev F. So, when you update your Tympan_Library to get this fix for the letter case, you’ll also be getting the update to the BLE classes. If you have any trouble, let me know!

Chip

Hi Chip,
Thanks v much! I’ll get into that and have a go tonight.
Also apologies; it would have been better for me to try it out as an idea, send a PR. I just ran out of runway.
Regards and thanks for the big upgrade,
StephenH

Thanks Chip,

Yep, those changes did the trick, after I reverted some of my other ‘fixes’.

I’ll close out the topic thread according to the original title with a couple of additional posts (tldr; Arduino IDE + teensyduino is my best way forward at least for now, and works with a very similar install+run sequence on linux (fedora) as the Tympan instruction page directs for windows).

Best regards,
Stephen

Platform IO on VS Code (not yet)

After my initial enthusiasm, this is not a path I’m following.

I quickly got mired in the .ino to .cpp depths, library inter-dependency trials, guessing include paths, also extra include paths for libraries built into the arduino ide itself (as modified by the teensyduino install). This seemed like a particularly Teensy problem at first, but is perhaps instead a reasonable response to the Arduino community’s demands.

I’d still like to keep an eye on Platform IO, perhaps as a test runner framework.

Arduino 1.8 Gui + Teensyduino binary + udev file (success)

This was successful for me including automatically resolving the additional libraries and versions. (and you can keep your Tympan_Library in your tympan repo folder and then soft-link it inside the arduino libraries folder, works fine).


(note the ports issue in this screenshot quickly resolved in the gui. Reverified with the serial monitor running and an add to the first println.)