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
I2S on NUCLEO-4F01RE
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Current status of I2S
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.
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.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: I2S on NUCLEO-4F01RE
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)
Code: Select all
// I2S buses
#define MICROPY_HW_I2S2 (1)
Code: Select all
boards/NUCLEO_F401RE/mpconfigboard.h
It might just work?
Re: I2S on NUCLEO-4F01RE
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?
I'd like to open a pull request for this. Are there any specific behaviours that need to be tested before I do?
- Mike Teachman
- Posts: 155
- Joined: Mon Jun 13, 2016 3:19 pm
- Location: Victoria, BC, Canada
Re: I2S on NUCLEO-4F01RE
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.
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.