Top level model: JVCB3_TEST_TOP.
Change the MBD_S32K1xx_Config_Information to point to the COM port for your board (or switch to OpenSDA if you're using an evaluation board).
Go to Modelling tab and click on "Update Model".
Go to the "Apps" tab and click on Embedded Coder.
Click on "Build" and upload the model to the board. Observe that there is no SPI communication. Notice that the signal being fed into the LPSPI_Master_Transfer block is declared as "uint8 (4)" on the simulink model.
Navigate to the generated code at "<model root>\JVCB3_TEST_TOP_mbd_rtw\JVCB3_TEST_TOP.c"
Note on line 57:
/* Send data */
LPSPI_DRV_MasterTransferBlocking(1,
&JVCB3_TEST_TOP_B.TmpSignalConversionAtLPSPI_Master_TransferInport1[0],
&JVCB3_TEST_TOP_B.LPSPI_Master_Transfer[0], 1, 50);
}
And on line 42:
/* SignalConversion generated from: '<Root>/LPSPI_Master_Transfer' */
JVCB3_TEST_TOP_B.TmpSignalConversionAtLPSPI_Master_TransferInport1[0] =
rtb_byte_out;
JVCB3_TEST_TOP_B.TmpSignalConversionAtLPSPI_Master_TransferInport1[1] =
rtb_byte_out;
JVCB3_TEST_TOP_B.TmpSignalConversionAtLPSPI_Master_TransferInport1[2] =
rtb_byte_out;
JVCB3_TEST_TOP_B.TmpSignalConversionAtLPSPI_Master_TransferInport1[3] =
rtb_byte_out;
Navigate to JVCB3_TEST_TOP.h.
Note on line 37:
/* Block signals (default storage) */
typedef struct {
uint8_T TmpSignalConversionAtLPSPI_Master_TransferInport1[4];
uint8_T LPSPI_Master_Transfer[4]; /* '<Root>/LPSPI_Master_Transfer' */
} B_JVCB3_TEST_TOP_T;
The generated code is clearly a C array of 4 unit8's. However LPSPI_DRV_MasterTransferBlocking in being passed a length of 1 byte.