Dear All
I was looking for an example code for UJA1169 in s32ds and I have found for s32k142evb board.
But I think you should check once the code line which I am sharing line(1627)
while compiling it shows error in Command because it is const,so how in code it is getting modify.
status_t SBC_DataTransfer(const sbc_register_t regName,
const uint8_t* const sendData, uint8_t* const receiveData)
{
status_t status = STATUS_SUCCESS;
const uint8_t command[2] = {0U, 0U};
uint8_t readOnlyMask = 0x00U;
uint8_t readData[2] = {0U, 0U};
/* Test if there is data for sending. */
if(sendData == NULL)
{
/* This transfer is read only. */
readOnlyMask = 0x01U;
command[0] = 0U;
}
else
{
command[0] = *sendData;
}
/* Address of device with read only bit. */
command[1] = (uint8_t)((SBC_UJA_REG_ADDR_F(regName) | readOnlyMask) & 0xFFU);
status = LPSPI_DRV_MasterTransferBlocking(g_drvConfig.lpspiIntace, command,
readData, 2U, SBC_UJA_TIMEOUT );
if( readData[1] != command[1])
{
status = SBC_COMM_ERROR;
}
/* Copy content of register to receive data. */
if(receiveData != NULL)
{
*receiveData = readData[0];
}
return status;
}
Note: if( readData[1] != command[1])
{
status = SBC_COMM_ERROR;
}
Due you think readDATA[1] will ever be equal to command[1] because in my case it is always SBC_COMM_ERROR.
I have S32k118evb so I have taken only UJA1169driver..So can you run this code and flash on s32k142 to check whether this code is running fine or not .
I am Using S32k118evb which have inbuilt UJA1169TK so can I use this code sbc part for flashing.
PFA images for more clearity
B.R
Ashish