Dicklessgreat / daisy-embassy

5 stars 2 forks source link

add oneshot_recorder #10

Open Dicklessgreat opened 2 months ago

Dicklessgreat commented 2 months ago

First time to use draft. I wanted to try it out to see what kind of functionality it had.

Not yet implemented

Dicklessgreat commented 2 months ago

I achieved what I expected, but there's a problem. It takes too much time to write to sdmmc, and it's blocking. That's why after it finished flushing, this program panics by SAI overrun

ERROR panicked at /Users/dicklessgreat/Documents/Rust/daisy_embassy/src/audio.rs:223:42:
called `Result::unwrap()` on an `Err` value: Overrun

I tried some forks of embedded-sdmmc that provide async interfaces. But they are outdated or not yet works. https://github.com/kalkyl/sdmmc-embassy/tree/main https://github.com/LechevSpace/embedded-sdmmc-rs/tree/feat/async-feature

kalkyl commented 2 months ago

You may wanna look at using embedded-fatfs instead of embedded-sdmmc for async support

kalkyl commented 2 months ago

...also for most apps you wanna run the audio task in an InterruptExecutor at a higher priority level, to avoid over/underrun

Dicklessgreat commented 2 months ago

Thanks! I'll try both!

Dicklessgreat commented 2 months ago

Doh! I forgot DMA requires special region for its buffer in STM32H7!!

ERROR panicked at 'DMA: error on DMA@40020000 channel 0'

Noooooo... I'm now working on mock-up fix of embedded-fatfs. https://github.com/Dicklessgreat/embedded-fatfs/tree/stm32h7_DMA I've make Bufstream inner field as a slice, but not yet replace the all buffers in SdSpi::init(). I'll try it later. Good night~~~.

Dicklessgreat commented 2 months ago

I suppressed panic by DMA error, but not yet solve the problem. SdSpi timeouts at its init().

Dicklessgreat commented 2 months ago

from https://github.com/MabezDev/embedded-fatfs/pull/30