-
-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Portenta H7 Compatability #900
Comments
I tried to google the topic I2S and Portenta and I did not find a single example. It seems that the challenge is really that there is no I2S library: this is a general problem for all STM processors. But looking of the cost of these processors, my motivation is quite low... |
With my last commit you might be able to use the AnalogAudioStream with the help of the Arduino_AdvancedAnalog library and PWMAudioOutput |
I was able to compile on the Portenta with the latest commit. Trying out AnalogAudioStream now. |
Here's what I get when I try out the basic stream-generator-analog example: #include "WiFi.h"
#include <Arduino.h>
#define ARDUINO_ARCH_MBED_PORTENTA
#include "AudioTools.h"
typedef int16_t sound_t; // sound will be represented as int16_t (with 2 bytes)
AudioInfo info(44100, 2, 16);
SineWaveGenerator<sound_t> sineWave(32000); // subclass of SoundGenerator with max amplitude of 32000
GeneratedSoundStream<sound_t> sound(sineWave); // Stream generated from sine wave
AnalogAudioStream out;
StreamCopy copier(out, sound); // copies sound into i2s
void setup() {
Serial.begin(9600);
while(!Serial);
AudioLogger::instance().begin(Serial, AudioLogger::Info);
// // start the analog output
audio_tools::AnalogConfig config = out.defaultConfig(TX_MODE);
config.copyFrom(info);
// out.begin(config); // causes Mbed panic
// // Setup sine wave
// sineWave.begin(info, N_B4);
// Serial.println("started...");
}
void loop() {
// copier.copy();
} It seems like only the ESP32 define will enable TX mode. I will need to do RX eventually, but for now, I want to get TX working since that's also a requirement. In the meantime, I'm going to look at just implementing the I2S protocol on the Portenta in my own library, but let me know if there is a way to enable TX through your library - no reason to reinvent the wheel. |
I don't understand your problem: This example is just compiling fine and just gives some warnings - but no errors! Maybe you should test the example from the Arduino_AdvancedAnalog library first to make sure that this is really working. |
I think it is more efficient, when you create a fork and do the corrections yourself right away. As I said, I do not have any of these boards, so I cant test it myself... ps. This this is just a message, which has no futher impact on the functionality. Nevertheless I commented it out for your case |
I did the same thing by just bypassing it, unfortunately, later calls in the Here's what logging gets sent before the crash:
I'll let you know if I get something working, I'm attempting to create an I2S lib similar to the one you made from a CubeIDE project for the STM32F4. The Portenta not being compatible out of the box with CubeIDE because of the Arduino bootloader doesn't make that process easy though. Thanks for your guidance! |
I was able to get I2S working on the Portenta by bringing in the CubeMX initialization functions and created a very simple PIO library. I haven't tried DMA as I still need to bring over some other code from Cube for that, but calling I don't have time to work on a PR to include this into the STM32 mode of this lib, but I'd be happy to test something out if you add in the code. Thanks again for your help |
Looks promising. Unfortunately I am currently very sick and will not be able to work on this. |
Hi there,
I've been trying out this library in PlatformIO for use with a Portenta H7, since I saw it was referenced in the Nicla Voice documentation from Arduino, and figured I'd give it a shot on the Portenta.
I got the library to compile by undefining Arduino's absolute value implementation and defining use int24 from int
However I ran into an issue where I2SStream is not defined by default. I then tried defining
STM32
to enable the STM32 mode:But that results in an error saying I am then missing the
stm32-i2s.h
header.Just for fun, and not expecting it to work since the Arduino I2S library doesn't support the Portenta :/ I defined
USE_I2S
, but since the Arduino I2S library is not present it obviously does not compile.So, if the Portenta is supported, what am I missing, otherwise, would there be any plans to support it in the future? I recognize it's fairly new and stuck in between Arduino and ST's ecosystems so it's not the easiest board in the world.
Thanks
The text was updated successfully, but these errors were encountered: