I found stm32 DMA periph driver bugs! when I tested stm32l431rc board. #16242
Labels
Area: cpu
Area: CPU/MCU ports
Platform: ARM
Platform: This PR/issue effects ARM-based platforms
Type: bug
The issue reports a bug / The PR fixes a bug (including spelling errors)
Description
The next issue, at cpu/stm32/periph/spi.c, The issue can run correctly, But it is just a coincidence!!!
dma_setup(spi_config[bus].tx_dma,
spi_config[bus].tx_dma_chan,
(uint32_t*)&(dev(bus)->DR),
DMA_MEM_TO_PERIPH,
0,
DMA_DATA_WIDTH_BYTE);
But the prototype of the dma_setup is:
void dma_setup(dma_t dma, int chan, void periph_addr, dma_mode_t mode,
uint8_t width, bool inc_periph);
So correctly call must be:
dma_setup(spi_config[bus].tx_dma,
spi_config[bus].tx_dma_chan,
(uint32_t)&(dev(bus)->DR),
DMA_MEM_TO_PERIPH,
DMA_DATA_WIDTH_BYTE,
0);
Although the correct result can be obtained, it is just a coincidence!!!
Steps to reproduce the issue
Expected results
Actual results
Versions
The text was updated successfully, but these errors were encountered: