cancel
Showing results for 
Search instead for 
Did you mean: 

SPI Problem in STM32H743

Chopra.Deepak
Associate II

I would like to read multiple 32 bit data,after sending one 16 bit address,how it will done by stm32h7xx?

4 REPLIES 4
S.Ma
Principal

Are you reading from serial memory? Then better use if possible QSPI or OctoSPI IPs for this as HW assist SW the most by mapping the external memory into the MCU's

Otherwise, use DMA TX and RX dual channels to perform data transfer. If the transaction takes time and you need to do other things in parallel, then implement an interrupt state machine in bare metal, or use RTOS.

No,I am not using any memory,I am using any ic that communicate 16 and 32 bit spi communication, after receive 16 bit address that ic send bunch of data on miso pin,in this time mcu should not send any data on mosi ​pin.i have some confusion on stm32h SPI hal library,in hal_spi_transmit_receive function,how we select one one 16 bit half word transmit and no. Of 32 bit word receive.

S.Ma
Principal

Even when reading, you need to transmit to generate the clock pulses to read.... At first, put the spi in 8 bit mode and make your transfer work as baseline, before optimizing, or you may burn more.debug time than needed.

@Chopra.Deepak​ - Some pointers on long SPI transfers here:

https://community.st.com/s/question/0D50X00009q4MRTSA2/stmf4-external-interrupt-dma-20bit-spi-xfer-completion-interrupt-to-isr

Hope that helps,

Best Regards, Dave