I’m developing an autonomous audio recorder that captures signals from a custom amplifier, uses the PMOD I2S2 ADC, and saves them to an SD card at 16-bit, 44.1 kHz (this requires MCLK).
It’s working on an ESP32, but I want to compare different MCUs, primarily to optimize power consumption. The SD data logger is functioning correctly, but I’m struggling to configure the I2S peripheral on an STM32 device since the ESP32 has its own driver.
At the moment, I'm trying to make the I2S work (without the SD connected to other SPI bus).
Before attempting to write the code directly in STM32CubeIDE, I’d like to know if anyone has implemented something similar.
I’m using a BlackPill F411CEU6 (alternatively F401 or F103). Additionally, I believe it’s possible to export code generated in STM32CubeIDE to the Arduino IDE, but I haven’t found a clear, step-by-step guide for this. If such a guide exists, I’d greatly appreciate it, as I need to test different sampling rates. Also, since I need the SPI bus for both the SD card and the ADC (with MCLK), pin management becomes challenging.
My experience with STM32CubeIDE and HAL functions is limited. The same goes for creating Arduino libraries. Any help would be appreciated.
PD: If someone thinks this task would be much easier accomplished on CubeIDE please let me know, so I won't waste mine and others time.

Thanks!