cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753 SPI Transmission

CZuercher_Ilm
Associate II

Hi,

 

I'm using the STM32H753-NUCLEO Board for some SW development, and I'm having some issues with the SPI Handling.

I'm attempting to transmit a single 16-bit data packet, however on the scope I'm transmitting two 16-bit data packets. When I change my data packet type to 8 bits, I'm transmitting 4 8-bit data packets.

I've scoured the RM0433 manual but cannot find the register which tells the peripheral to only transmit a single data packet.

Could someone point me to the correct register and what it should be set to to achieve this please?

1 REPLY 1
TDK
Super User

Use byte or half-word writes to DR, otherwise it does data packing.

// half-word write
*(volatile uint16_t*)&SPIx->TXDR = .;

// byte write
*(volatile uint8_t*)&SPIx->TXDR = .;

 

https://github.com/STMicroelectronics/stm32h7xx-hal-driver/blob/dbfb749f229e1aa89e50b54229ca87766e180d2d/Inc/stm32h7xx_ll_spi.h#L2504

 

If you feel a post has answered your question, please click "Accept as Solution".