cancel
Showing results for 
Search instead for 
Did you mean: 

Callback, Drivers and Linker

Daniele Mirri
Associate II
Posted on March 17, 2017 at 10:17

Hi all,

I am working on SPC560B-DIS, and i have more than one problem:

1) I'm starting writing the firmware from the test app that the wizard provides but, if I start for instance from PWM-ICU test Application by default it enables eMIOS driver but if i want to enable the PIT (for instance but it happens with every driver i enable) the generator doesn' t add me the needed libraries, Am I wrong thinking that he should do it automatically??? If is not, should I just add the header config file??

2) if I have  any driver that should invoke a callback at certain point I put the name of the callback funcion in the relative text box in the driver'ssetting tab for instance call_back _f

than I write the funcion body in the main file: void call_back_f(void) {count++;}

but the funcion is never called.

Is there something that i'm missing??

3) if I want to add  an header file with relative source file: I just select the source folder in my project then new>Header file and then new>Source file and i'm naming them file.h and file.c respectively.  The problem here is that the linker doesn't link the files or eventually it links but anyway the funcion are not called. i say eventually cause indeed it doesn't happens every time.

I hope to dont have oveerloaded the community and Erwan overall.

Thanks all.

Daniele.

#source-file #linker #driver #header-files
1 REPLY 1
Erwan YVIN
ST Employee
Posted on June 14, 2017 at 11:15

Hello Daniele ,

Sorry for the late answer ,

Automotive MCUs Community was not tracked by me

1) Starting from a test application (from appWizard) is a good point

   if you enable EMIOS in the components , you should save and generate the code

   (Cf SPC5Studio help section in Eclipse)

2) the callback is function pointer in all the driver 

    You have to define the callback and set your current function pointer with your callback.

    you can put a breakpoint in your interruption vector to check you enter well in the interruption routine

3) Yes , you have to add in the source folder. (the user files)

    a link issue issue maybe due to a missed header file.

    

    Best regards

                       Erwan