You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using SPI with DMA and "transfer" in an ISR the first time it's called malloc will be called and fail as it's not allowed.
You can workaround it by ensuring you have used transfer before even if it's a dummy transaction.
Perhaps we should link during enabling DMA or SPI object creation?
The text was updated successfully, but these errors were encountered:
Hmm yeah that is an issue, but I'm not sure if there's an easy way around it other than doing what you said. TBH I'm not sure if we want to actually support doing DMA SPI from an ISR, but I can imagine there are some uses for it so IDK if we want to disallow it entirely.
DMA in an ISR is incredibly useful when dealing with fast continual conversion ADC's etc.
Should we just link it when enabling DMA? it's unlikely you would want to do that in an ISR, at least we would not lose functionality.
Maybe the way to go is to add a configuration option like target.spi-always-allocate-dma (or something). If set, it would allocate DMA channels when a SPI is initially constructed, so that it is guaranteed to work from an ISR, at the cost of more RAM usage when constructing each SPI.
mbed-os/targets/TARGET_STM/stm_dma_utils.c
Line 634 in e712230
When using SPI with DMA and "transfer" in an ISR the first time it's called malloc will be called and fail as it's not allowed.
You can workaround it by ensuring you have used transfer before even if it's a dummy transaction.
Perhaps we should link during enabling DMA or SPI object creation?
The text was updated successfully, but these errors were encountered: