This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS1227: Mibspi module dynamically modifies the data transmit length

Part Number: TMS570LS1227

Hi team,

Here's an issue from the customer may need your help:

In the hal code generator software, the user can set the length of the Mibspi's data transmission, which is the length of the group. But what should customers do if they want to dynamically modify the length of each data sent during use?

Set length to 16 and modify the tms570_mibspiSetU8Data function when sending data. The customer wants to be able to send 4 bytes of data when calling this function. However, the waveform captured by the oscilloscope found that the data sent was always 16 bytes.

void tms570_mibspiSetU8Data(mibspiBASE_t *mibspi, uint32 group, uint8 * data,uint32_t u32DataLen)
{
mibspiRAM_t *ram = (mibspi == mibspiREG1) ? mibspiRAM1 : ((mibspi == mibspiREG3) ? mibspiRAM3 : mibspiRAM5);
uint32 start = (mibspi->TGCTRL[group] >> 8U) & 0xFFU;
uint32 end = (group == 7U) ? (((mibspi->LTGPEND & 0x00007F00U) >> 8U) + 1U) : ((mibspi->TGCTRL[group+1U] >> 8U) & 0xFFU);

if (end == 0U)
{
end = 128U;
}
if(end > start + u32DataLen)
{
end = start + u32DataLen;
}
while (start < end)
{
/*SAFETYMCUSW 45 D MR:21.1 <APPROVED> "Valid non NULL input parameters are only allowed in this driver" */
ram->tx[start].data = *data;
/*SAFETYMCUSW 567 S MR:17.1,17.4 <APPROVED> "Pointer increment needed" */
data++;
start++;
}
}

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    The customer's function tms570_mibspiSetU8Data() just writes data to the buffers in MibSPI RAM, the TG size is not changed.

    1. PSTART of TGxCTRL registers should be updated

    2. CSHOLD of TXRAM should be updated too