I’m attempting to port over CubeIDE generated initialization code for I2S to PIO for the Portenta H7, since as far as I can tell nobody is using I2S on the Portenta, and Arduino’s libraries do not support I2S on the Portenta.
When I bring in the generated header files from Cube and include them, I get a few compiler errors, but they appear to be within the ArduinoMbed-Core, and it isn’t (yet) complaining about the initialization functions.
In file included from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/device.h:38:0,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/platform.h:28,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:25,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:41,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/variants/PORTENTA_H7_M7/pins_arduino.h:2,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:76,
from src/main.cpp:1:
/Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/objects.h:55:5: error: 'RNG_HandleTypeDef' does not name a type; did you mean 'I2S_HandleTypeDef'?
RNG_HandleTypeDef handle;
^~~~~~~~~~~~~~~~~
I2S_HandleTypeDef
/Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/objects.h:73:5: error: 'SPI_HandleTypeDef' does not name a type; did you mean 'I2S_HandleTypeDef'?
SPI_HandleTypeDef handle;
^~~~~~~~~~~~~~~~~
I2S_HandleTypeDef
/Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/objects.h:141:5: error: 'ADC_HandleTypeDef' does not name a type; did you mean 'I2C_HandleTypeDef'?
ADC_HandleTypeDef handle;
^~~~~~~~~~~~~~~~~
I2C_HandleTypeDef
/Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/objects.h:150:5: error: 'QSPI_HandleTypeDef' does not name a type; did you mean 'EXTI_HandleTypeDef'?
QSPI_HandleTypeDef handle;
^~~~~~~~~~~~~~~~~~
EXTI_HandleTypeDef
In file included from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/device.h:38:0,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/platform.h:28,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/platform/include/platform/FileHandle.h:25,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/macros.h:41,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/variants/PORTENTA_H7_M7/pins_arduino.h:2,
from /Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/Arduino.h:76,
from src/main.cpp:1:
/Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/objects.h:193:5: error: 'DAC_HandleTypeDef' does not name a type; did you mean 'I2C_HandleTypeDef'?
DAC_HandleTypeDef handle;
^~~~~~~~~~~~~~~~~
I2C_HandleTypeDef
/Users/trylaarsdam/.platformio/packages/framework-arduino-mbed/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/objects.h:204:5: error: 'FDCAN_HandleTypeDef' does not name a type; did you mean 'MDMA_HandleTypeDef'?
FDCAN_HandleTypeDef CanHandle;
^~~~~~~~~~~~~~~~~~~
MDMA_HandleTypeDef
*** [.pio/build/portenta_h7_m7/src/main.cpp.o] Error 1
I’m somewhat stuck with how to get I2S working on the Portentas. I can’t use pure CubeIDE without the massive pain of adding in the Arduino bootloader functionality and losing drivers for WiFi/BLE.
Any guidance on methods for getting I2S ported and working would be helpful. Thanks!