Re: Simulink blockset: SPI configuration
The SPI block allows to modify the SPI peripheral settings in the middle of a sequence. This is useful for example when addressing sensors with various SPI clock capabilities. Sometimes, you have to initialize one sensor using a low SPI clock, then you can go with a higher clock.
Thus Update-Configuration sequence allows to modify the SPI peripheral settings on the fly.
You do not need this feature. Remove all these Update-Configuration from your sequence.
The dash '---' have no effects. Just for sequence clarity
Then let go to a solution:
Duplicate your SPI block.
In a first block, let the initialization sequence and set the sampling time to "inf" thus the block will be executed only once at startup.
In a second block, let the sampling rate to 0.01s and let the sequence to be executed periodically.
This is what you will find in examples provided.
I would advise removing the "blocking mode" option. The peripheral driver is handled in background to free most of the CPU time to calculation.