2025-07-14 4:57 AM
Hello,
I’ve configured SPI in CubeMX with DataSize = 12 bits. However, when I use the HAL function HAL_SPI_Transmit, the pData argument seems to require a uint16_t (or at least 16-bit aligned) buffer.
I'm a bit confused about how this works in practice. Since I'm sending a 16-bit word, but only configured 12-bit frames, does the SPI peripheral transmit just the lower 12 bits of each word? Or do I need to pack the 12-bit values differently?
I'm still fairly new to STM32 development, so I appreciate any clarification you can offer!
Best regards,
Kewin
Solved! Go to Solution.
2025-07-14 5:04 AM
Solved after reviewing the declaration again. I just misunderstood something. :))
2025-07-14 5:04 AM
Solved after reviewing the declaration again. I just misunderstood something. :))