can you clarify some of the documentation eg SPI size parameter doesnt specify bytes or words
This is a documentation bug/request really, but I recently was trying out the HAL_SPI functions for the first time, and had set up the peripheral for 16 bit transfers.
The documentation for HAL_SPI_TransmitReceive and related functions, for several of the families, across several documents and pdfs found on the internet and ST's site, all simply say that the size parameter 'Size: amount of data to be sent and received'
I found a number of erroneous exmaples that use sizeof(buffer), as well as several question on this forum with incorrect information; for the record, from reading the HAL code, the size is measured in units of 16 bits (or whatever your SPI is configured for). while that makes total sense, I wish the docs made this clearer as it tripped me up - and many others. I was overrunning my buffer by a factor of 2, leading to bizarre behaviour, faults etc.
took a while to unpick.
For the DMA functions, I dont know yet if the size of the DMA transfer configuration (half word or word) matters... I will find out the hard way I guess, as the docs are silent on the matter :)
I hope this helps someone - SPI_Transmit size is measured in words, not bytes :)
(The same documentation scarcity is true for I2S and SAI peripherals also, for what it's worth... I haven't stumbed into other areas yet)
