Why do I get an error using a microcontroller library with S-function builder?
이전 댓글 표시
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
답변 (2개)
Kaustubha Govind
2013년 3월 21일
0 개 추천
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.
Helene
2013년 3월 25일
댓글 수: 1
Kaustubha Govind
2013년 3월 25일
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.
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!