Page 1 of 1

I2S on NUCLEO-4F01RE

Posted: Fri Oct 01, 2021 1:55 pm
by tstokes
I've just built and flashed v1.17 to my NUCLEO in the hope of gaining I2S support but I've now realised it's not supported in this release.

Is there some physical limitation preventing this or just a case of it not yet having been implemented?

Is there any feeling for the work involved to get this running? (I work on embedded C but I'm new to micropython)

Thanks

Toby

Current status of I2S

Posted: Sat Oct 02, 2021 8:52 am
by pythoncoder
I don't know about that particular board but I2S is still under development. This pull request is necessary for reliable playback. If you plan to use uasyncio, this pull request is also needed to avoid allocation problems.

That said, the maintainers do seem very committed to implementing I2S and, with those PR's, I have achieved reliable CD quality playback on a Pyboard D. However you do need a data source with adequate bandwidth. I have doubts that CD quality is currently achievable on a platform without an inbuilt SD card. But I believe Mike Teachman (I2S guru) is working on a solution to this.

Re: I2S on NUCLEO-4F01RE

Posted: Wed Oct 06, 2021 4:35 am
by Mike Teachman
tstokes wrote:
Fri Oct 01, 2021 1:55 pm
I've just built and flashed v1.17 to my NUCLEO in the hope of gaining I2S support but I've now realised it's not supported in this release.
I2S on the STM32 port was released for the boards that I could physically test with: pyboard v1.1 and pyboard D

I2S might work on your NUCLEO board by enabling the feature in ports/stm32/boards/<your board>/mpconfigboard.h and then compiling. Take a look at ports/stm32/boards/PYBV11/mpconfigboard.h

There are 2 macros that are used to enable the feature on a F4 processor

Code: Select all

#define MICROPY_HW_ENABLE_I2S       (1)
and

Code: Select all

// I2S buses
#define MICROPY_HW_I2S2             (1)
I added these 2 lines to

Code: Select all

 boards/NUCLEO_F401RE/mpconfigboard.h
and the code compiled and linked without error.

It might just work?

Re: I2S on NUCLEO-4F01RE

Posted: Fri Dec 17, 2021 12:39 pm
by tstokes
I can confirm that this does indeed work once configured into the build. Thank you for the clear instructions (and your GH examples which were very useful for verification).

I'd like to open a pull request for this. Are there any specific behaviours that need to be tested before I do?

Re: I2S on NUCLEO-4F01RE

Posted: Sat Dec 18, 2021 1:04 am
by Mike Teachman
Hey, that's great news.

For testing, it would be good to try I2S with both a DAC (Tx mode) and a microphone (Rx mode), but seeing it work on one of these should be adequate.