SPI wrong readDataSizePtr value

readDataSizePtr should inform how many bytes was read. But system always returns original value. Problem is in functions le_spi_ReadHD, le_spi_WriteReadFD, le_spi_WriteReadHD.

  uint8_t Data[40];
  size_t S = NUM_ARRAY_MEMBERS(Data);
  Res = le_spi_ReadHD(SPIHandle, Data, &S);
  if(Res == LE_OK)
  	char Str[10];
  	sprintf(Str, "%d", S);
    //S value is always 40 does not matter if system receives 2,3,10 or 20 bytes, S is incorrect 
    //and it is always 40. 


I don’t have SPI hardware available to test but from Legato SPI library code review, it seems that readDataLength is not updated in le_spiLib_ReadHD() function:

I guess we should add the following line before “result = LE_OK;”:

*readDataLength = transferResult;

Could try to rebuild Legato with this mod?