2020-06-15 01:59 AM
I use Nucleo board (STM32L053R8) to connect SPI slave. The SPI command had been sent to slave correctly, and slave also return the expected value (0x2C). But Nucleo SPI master cannot get the return data correctly. The RXNE is raised without problem, but the content of DR is wrong. it was 0xff. attachment is the trace diagram from logic analyzer. is there any other thing need to be configured? thank you.
2020-06-15 04:09 AM
MISO is 0xFF for 3 bytes before it's 0x2C. Sure you're just not reading it enough? SPI returns a byte for every byte sent.
2020-06-15 06:03 PM
Thanks for the reply.
I only get one interrupt. I also try to read content for 2 times (16-bit data format) in ISR. it's still 0xffff.
2020-06-15 07:09 PM
Post minimal but complete compilable program exhibiting the problem.
JW
2020-06-15 10:04 PM
I change to polling and read after every write. I can get the correct response from device now. thank you.