AnsweredAssumed Answered

STM32-MAT Simulink SPI "Type_SPI" bug

Question asked by Goossens.Sebastiaan on Apr 24, 2017
Latest reply on Apr 27, 2017 by Imen D

I was trying to get Simulink to communicate to a sensor using SPI, but I encountered the following issue:

When opening the parameter screen of the SPI block by double clicking on it, the "Type_SPI" field contains "No_Configuration_Type" instead of "Full_duplex". This does not happen with any of the three other modes for this field (Half_Duplex, Receive_Only and Transmit_Only).


Due to this bug it is not possible to configure the SPI peripheral as full duplex.

This happens in all SPI ports.


This specifically has to do with the "SPI1.Direction=SPI_DIRECTION_1LINE" rule of the .ioc file.

If this value is set to SPI_DIRECTION_2LINES (as required for full duplex config), simulink will parse it as any other invalid value. The SPI_DIRECTION_1LINE value will be parsed correctly as half duplex.


This seems like a bug in the processing of the .ioc file, any ideas?


Full duplex setting has wrong Type_SPI


Application versions:

Matlab r2016b (with all the required toolboxes)

STM32CubeMX 4.20.1 with STM32F4 package 1.16.0

SW4STM32 v1.14.0