Hello abhishek.kumar@chassisbrakes.com,
I've found the problem:
In MPC5744.h, at line 17064, there is the following define
#define SPI_0 ((SPI_Type *)SPI_0_BASE)
At the same time, in the model you've sent me, the name of the SPI Master transfer block is SPI_0. A variable generated to be used as input/output for that block is named SPI_0, as MATLAB codegen has no idea that it should not use that exact name; it just puts the name of the block there. So this is what is actually going on.
typedef struct {
uint8_T SPI_0; /* '<S2>/SPI_0' */
} B_FET_predriver_MC34GD3000;
void FET_predriver_MC34GD3000(uint8_T rtu_MPC_SPI_Data,
B_FET_predriver_MC34GD3000 *localB)
{
/* S-Function (spi_mpc574x_master_transfer): '<S2>/SPI_0' */
{
DSPI_UpdateCS(0, 0);
DSPI_MasterTransfer(0, &rtu_MPC_SPI_Data,
&localB->SPI_0, 1U);
}
}
Took a while to find the culprit, but the fix is simple - just rename the SPI Master transfer block from SPI_0 to something else (e.g: SPI_zero or SPI_00).
Please let me know if you have further issues with it.
Kind regards,
Razvan.