Force CMSIS functions in Simulink
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear
I am generating code for a Cortex-M target, and have installed the Embedded Coder Cortex-M Hardware Support Package to enable code replacement using the CMSIS library. The code generator succesfully replaces code of for example a 'sin' function to 'arm_sin_f32'.
I have been investigating the complete CMSIS library, and found it supports quite a lot of Cortex-M optimized functions. One of which is the Clarke transformation (and also Park and their inverse). As of now, I have manually implemented these transformations with regular Simulink blocks. Is there a way however to force Simulink to use the CMSIS Clarke transformation function arm_clarke_f32 (float32_t Ia, float32_t Ib, float32_t *pIalpha, float32_t *pIbeta)?
I have tried the user-defined Fcn block, but you can only enter an expression in function of inputs. The abovementioned function is a function of two inputs and two outputs. An Embedded Matlab function maybe?
I would also need to be able to run the model in simulation and on a SpeedGoat target, so hard-coding the function arm_clarke_f32 is not a good idea I believe. We could use variant subsystems a s a solution for that maybe.
Many thanks for any ideas,
Jonas
0 commentaires
Réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!