Processor Expert -> Undefined Reference in Peripheral Init

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Processor Expert -> Undefined Reference in Peripheral Init

Jump to solution
888 Views
KevinRosenbaum
Contributor I

I'm starting a new Kinetis project with the MKL15Z128VFM4.  I'm using Processor Expert (PE) on another Kinetis project for some lower level peripheral initialization components, but I'm having trouble with this project.  PE compiles fine, but when I include a PDD routine (in my case one of the GPIO or ADC routines) I get an "undefined reference" error to that routine.  If I use the higher level components, it compiles and works fine.  Is there anything obvious I need to setup first?

For example, when I add the following to my main(), I get the error "undefined reference to 'ADC_PDD_StartCalibration'.

ADC_PDD_StartCalibration(ADC0_DEVICE);

I have CW 10.4 and just made sure everything else is up-to-date.

Thanks!

Labels (1)
0 Kudos
1 Solution
545 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi KevinRosenbaum,

       After reading your problem, I create a CW project based on PE. After test, I think if you want to use PDD, two points you should take care.Now I still take ADC_PDD as an example.

      1, You should include the PDD.h which you used in your main.c

              If you use the ADC_PDD_StartCalibration(ADC0_DEVICE); Add the following:

                 #include "ADC_PDD.h"

           Because ADC_PDD_StartCalibration() is defined in ADC_PDD.h as follows:

    #define ADC_PDD_StartCalibration(PeripheralBase) ( \

    ADC_SC3_REG(PeripheralBase) |= \

     ADC_SC3_CAL_MASK \

  )

     2, Make sure your ADC0_DEVICE is the correct peripheral base address.

         eg, I use ADC_PDD_StartCalibration(ADC0_BASE_PTR);

       you can find ADC0_BASE_PTR in the IO_Map.h

After these 2 points, I compile the project with no error!

I hope my answer helps you!

Best regards!

Jing

View solution in original post

0 Kudos
3 Replies
546 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi KevinRosenbaum,

       After reading your problem, I create a CW project based on PE. After test, I think if you want to use PDD, two points you should take care.Now I still take ADC_PDD as an example.

      1, You should include the PDD.h which you used in your main.c

              If you use the ADC_PDD_StartCalibration(ADC0_DEVICE); Add the following:

                 #include "ADC_PDD.h"

           Because ADC_PDD_StartCalibration() is defined in ADC_PDD.h as follows:

    #define ADC_PDD_StartCalibration(PeripheralBase) ( \

    ADC_SC3_REG(PeripheralBase) |= \

     ADC_SC3_CAL_MASK \

  )

     2, Make sure your ADC0_DEVICE is the correct peripheral base address.

         eg, I use ADC_PDD_StartCalibration(ADC0_BASE_PTR);

       you can find ADC0_BASE_PTR in the IO_Map.h

After these 2 points, I compile the project with no error!

I hope my answer helps you!

Best regards!

Jing

0 Kudos
545 Views
KevinRosenbaum
Contributor I

That was it.  Thank you!

0 Kudos
545 Views
kerryzhou
NXP TechSupport
NXP TechSupport
you are welcome!
0 Kudos