• DMA itself is relatively basic - 'read X bytes from Y and copy them to Z'. Handling FAT32 with it would be a no go. Potentially there's the ability to re-write bits of the FAT library to use DMA and become async, but that'd require a new filesystem API as well and is a big chunk of work :(

    So the other option is to use DMA for the Waveform output itself. That's definitely possible and could potentially be a second mode of operation for Waveforms. The problem I have is that when you move away from the current software solution, things are so interconnected that you can no longer hide the complexity from the user - which is what I've been trying to avoid with Espruino.

    If I did waveforms with DMA you wouldn't be allowed to do it if you were also using PWM on certain other pins because you need to hijack a timer from somewhere to drive DMA. Doing two waveforms would be even more tricky, and overlapping them on the same output would be impossible. Suddenly instead of copying 6 lines of JS from the website you've got to read a 1000 page STM32 reference manual.

    ... and if you're willing to read that manual you can actually set up DMA right now with the peek and poke functions. It's just that nobody ever does because it's such a nightmare :)

About

Avatar for Gordon @Gordon started