🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Error connecting Custom DLL to STM32F302R8 GPIO or PWM

User: "Osei Kay"
Altair Community Member
Updated by Osei Kay

I created a custom DLL to be used in Altair Embed 2021.1. The user block works fine if it runs alone. But when I try to download it to STM32F302R8, I get  an error:

" C:\Altair\Embed2021\cg/Diagram1_21.c:41: undefined reference to `cgMain'

c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: Diagram1_21.o: in function `main':

C:\Altair\Embed2021\cg/Diagram1_21.c:77: undefined reference to `cgMainSS' c:/program files (x86)/gnu arm embedded toolchain/10 2021.10/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe:

imageC:\Altair\Embed2021\cg/Diagram1_21.c:80: undefined reference to `cgMainSE' collect2.exe: error: ld returned 1 exit status".

I have attached a screenshot of the message. Any help?

Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "Girish Karamadi_21849"
    New Altair Community Member
    Updated by Girish Karamadi_21849

    User Blocks works for simulation not for codegen . 

    May I know what are you trying to achieve??

    Regards,

    Girish

    User: "Osei Kay"
    Altair Community Member
    OP
    Updated by Osei Kay

    I appreciate your response. 

    I am trying to implement a controller for a motor. I am trying to implement an advanced controller, that requires complex algorithms that cannot be easily implemented using the blocks. I have written the code in C/C++. 

    Any help or suggestions will be appreciated. 

    Regards,

    Kay

    User: "Girish Karamadi_21849"
    New Altair Community Member
    Updated by Girish Karamadi_21849

    You can use extern blocks to use the external code. Attached the simple example using extern block.

     

    Regards,

    Girish

    User: "Osei Kay"
    Altair Community Member
    OP
    Updated by Osei Kay

    Okay. I will try that. I will update this platform on the response.