I am fairly new in the stm32 world and i am using a stm32h743ZI2 board in simulink for coding. Basically the board is connected to multiple sensors through I2C, SPI, CAN etc. And what I want to do is implement an SPI card reader to log the data transmited through Simulink to inspect it later on a computer for example. The SPI module is this one : Spi SD Controller I know that there are a few tutorials already online do developp the necessary code :1st Tuto and 2nd Tuto on CubeMX or Cube Mx IDE, the problem is how do I adapt the code to work with Simulink and transmit the data.
I was thinking of using a S-function to transmit the data or to call the library, but I am not sure on how to do it. I was thinking of something like this: S-function example where the bus would have all the data I want to log, and possibly at different timestep ( for example one group at 10ms and one at 100ms) The other way around would be to use The spi transfer block but the recovery data process would be super complicated.