Why do I get an error using a microcontroller library with S-function builder?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello every one, I am currently working with a microcontroler (dsPIC33) and I am trying to programm it with SIMULINK.
I would like to use the S-function Builder block. I already read the associated documentation and found several examples.
I wish to import a library used by MPLAB for microcontroler's programming. I made a copy of it and managed to import it with the S-function Builder but when I try to use one of the functions (__delay32 for example) I have the following error :
error LNK2001: unresolved external symbol __delay32
Does anyone have tried to do something similar?
Thanks for your help. Helene
0 commentaires
Réponses (2)
Kaustubha Govind
le 21 Mar 2013
Where is __delay32 defined? Assuming that it is in an external library/source file, you need to add that file to the 'Library/Object/Source files' textbox in the Libraries pane of the S-function Builder Dialog Box.
0 commentaires
Helene
le 25 Mar 2013
1 commentaire
Kaustubha Govind
le 25 Mar 2013
So it appears that __delay32 is only defined for the microcontroller, but not for a host/PC target? Since the Simulink model runs the S-function on the host machine during simulation, you may want to use an OS-equivalent for __delay32 (or make it a no-op) in the S-function Builder. Then, modify the generated TLC file to call __delay32 instead of its replacement, so that the generated embedded code calls __delay32, but not the S-function itself.
Voir également
Catégories
En savoir plus sur Simulink Coder dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!