I am using STM32F767ZI nucleo board. I have configured SPI with 750kBits/sec. I have tested the hardware connections for max31856 and they are good. I ran a mBed code to test the Max31856 and it works well and sends the correct temperature. But I am not able to replicate that with HAL libraries - STM32CubeIDE alone with Max31856.
I am sending 0xFD to CR0 address and I am receiving 0x7e. I am sending 0x04 to CR1 address and I am receiving 0x02. I feel I am seeing a missing bit - LSB while receiving it or while sending it. I am not sure where the missing bit happens. I have tested with 0x08 and I get back 0x04. It looks like a clock or timing issue in my code. My code below.
https://gist.github.com/jayaram12391/31e060bd7fb97092cc3bf4eddcb7dadf
Any suggestions appreciated.