Why do I get an error using a microcontroller library with S-function builder?
2 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Kaustubha Govind
on 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 Comments
Helene
on 25 Mar 2013
1 Comment
Kaustubha Govind
on 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.
See Also
Categories
Find more on Configure Block Features for MATLAB S-Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!