cancel
Showing results for 
Search instead for 
Did you mean: 

Code Generation is slow, callbacks call in Simulink take's more than 3 seconds, specially for the ADC Blocks

JSerr.441
Associate

For example, I create a new Project (either Matlab 2018a or 2019a using previous STM32mat or latest STM32mat 5.1.0 using cube 4.23 or either cube 5.1.0), Chose for example a STM32F4 discovery board, activate ADC Channels create a new Simulink model and ADC Block)

tic;ADC_Read_callback('Ch1');toc

takes for active channels more than 3 seconds, for inactive channels 0.016 second which would be ok

For a complex System Code Generation takes 5 minutes, most of the time is updaten callbacks of the ADC Registers.

I am doing something wrong or it is normal that it takes so much time?

Many thanks *** nice regards

Jaume

3 REPLIES 3
Cyril FENARD
ST Employee

Hi @JSerr.441​  ,

Yes, you should know that in some cases, mask processing can be slow, especially for very complex Simulink blocks such as TIMERs and ADCs.

There are several reasons we are knowing and you should be informed that I started some optimizations.

Some of these could be included in the next STM32-MAT / TARGET v5.4.0 delivery scheduled for late 2019.

Thanks for your feedback.

Regards.

Cyril.

Hi Cyril,
thanks for the fast answer!
We are implementing a complex project and we are using Matlab trying to reduce the time to market. As the project has become more complex including more ADC’s and Timers the compilation got much slower, so that the benefit of the code generation gets partly lost. If is any possible workaround that I could use before the next release, I would be happy if you can contact me.
Many thanks and nice regards
Jaume
Cyril FENARD
ST Employee

Hi @JSerr.441​ ,

The STM32-MAT/TARGET V5.6.0 was released in the last days of March 2020.

This release is paired with STM32CubeMx V5.6.0 and with MATLAB R2018b.

This is the consolidation of the previous version V5.4.0 with some enablers for the NUCLEO-H743ZI2.

Regards.

Cyril.