sensorium / Mozzi

sound synthesis library for Arduino

Home Page:https://sensorium.github.io/Mozzi/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compatability/Compilation Issues w/ Nano 33 BLE Sense

sacerd-OS opened this issue · comments

Board: Nano 33 BLE Sense
Version: GitHub Latest
Steps to Reproduce: Attempt to compile empty sketch onto Nano 33 BLE Sense with MozziGuts.h included

The issue seems to stem from the fact that Mozzi considers the Nano 33 BLE Sense to be of the MBED family (I don't know what this means so I can't interpret). In AudioConfigMBED.h, Mozzi therefore assumes the 33 BLE Sense is compatable with the Arduino AdvancedAnalog library, which it isn't and assumes the board has a pin A13 which it doesn't.

The result is failed compilation and what seems to be a bunch of issues related to the AdvancedAnalog library. Unfortunately this isn't my jam so I can't help fix.

Related: #200 .

Is this the same board actually?
I don't have one of these, but will try to have a quick look at some point (or someone else).
Thanks for reporting!

Not my wheelhouse, but they don't appear to be the same. The sense is based on nRF52840 and the IOT is based on the SAMD21. The pin layouts seem different, at least. It seems to be in the mbed class of Arduinos, with its own separate listing as mbed_nano for compatability checks.

IIRC, the Nano 33 BLE used to work before we added the MBED port (for Arduino Giga/Portenta). Probably it's simply and over-eager hardware detection inside hardware_defines.h, then. Could you try modifiying that file? If you change this line https://github.com/sensorium/Mozzi/blob/cf9e173cd181f2a893f31923aaa0f2ec8e39efbc/hardware_defines.h#L59C6-L59C30 to #if (0), do things work?

If so, at least, we know what's going on, and just need to adjust that define.

IIRC, the Nano 33 BLE used to work before we added the MBED port (for Arduino Giga/Portenta). Probably it's simply and over-eager hardware detection inside hardware_defines.h, then. Could you try modifiying that file? If you change this line https://github.com/sensorium/Mozzi/blob/cf9e173cd181f2a893f31923aaa0f2ec8e39efbc/hardware_defines.h#L59C6-L59C30 to #if (0), do things work?

If so, at least, we know what's going on, and just need to adjust that define.

I get a different error, unfortunately

.../Mozzi/MozziGuts_impl_STM32duino.hpp:13:10: fatal error: HardwareTimer.h: No such file or directory
#include "HardwareTimer.h"
^~~~~~~~~~~~~~~~~
compilation terminated.

exit status 1

Compilation error: exit status 1

On version 1.10 I get an error that I'm missing <STM32ADC.h> (hardware_defines.h line 52), so it wasn't working on that version either.

I see now what you already pointed out long ago: The Nano 33 BLE is entirely different from the Nano 33 IoT, with a different CPU, and a different core, too. So it really seems we never supported the BLE so far, despite the fact that the IoT has been reported to work with Mozzi.

It is probably not going to be exceedingly difficult to provide at least basic support for the Nano 33 BLE, but we're currently in the middle of restructuring some internals, and so touching those parts of the code right now would add a lot of complexity. The restructuring will also add some more flexibility for configuration, and with some luck, I think the BLE may actually work out of the box in a PWM mode, with analog input disabled.

Feel free to remind us, should we forget to revisit this issue.