SPI loosing last read byte on NUCLEO_F401RE

06 Jun 2016

Hi,

I'm currently interfacing a NUCLEO F401RE to a CC1201 rf transceiver chip through the SPI interface. It seems, though, that SPI.write() command "looses" the last received byte when called multiple times in a row. I've hooked a logic analyzer to the circuit and confirmed the chip is returning the right value, it's just the SPI.write() routine that seems to ignore the last received byte.

In the example below the last byte (0x00) was sent as a dummy to retrive the value 0x21, otherwise the first call to SPI.write(0) would have returned 0x00. I also suspect it has something to do with receiving a zero, but not sure yet. /media/uploads/BrunoPires/mbed_psi_bug.png

I'm guessing it's a HAL bug, thanks in advance for any help.