Undefined reference to I2C_HAL_SetBaudRate

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

Undefined reference to I2C_HAL_SetBaudRate

Jump to solution
414 Views
radunasui
Contributor II

Hi

 

I am planning to write code in KDS that will use the I2C1 module on a FRDM-KL27Z board MCU and for this I want to make use of the HAL drivers provided, i.e.  fsl_i2c_hal.h

I am trying to call I2C_HAL_SetBaudRate() function and I get the undefined reference to 'I2C_HAL_SetBaudRate' although the fsl_i2c_hal.h file is included. To be noted that I can call any inline functions defined inside this header file, but no functions that are just declared inside the fsl_i2c_hal.h and defined inside fsl_i2c_hal.c. It seems that my compiler cannot find the latter file. How could I linked it to it? I presume that it has already been compiled somewhere before.

 

Any help??

 

 

Thanks

Labels (1)
0 Kudos
1 Solution
332 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Radu,

1) IF your project is KDS+sdk without PE , please first build the KSDK lib here :

Freescale\KSDK_1.3.0\lib\ksdk_platform_lib\kds\KL27Z644

then it will generate one ksdk_platform_lib.a under "lib\ksdk_platform_lib\kds\KL27Z644\debug"

add the .a file  in the compiler :

pastedImage_0.png

then you can use the functions under fsl_i2c_hal.h .  If it still can not work , please take a screenshot about the error and sen your project to me.

and tell me you use which version of KSDK.

2) If you create project with KSDK+PE, you can directly use the I2C_HAL_SetBaudRate function .


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
1 Reply
333 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Radu,

1) IF your project is KDS+sdk without PE , please first build the KSDK lib here :

Freescale\KSDK_1.3.0\lib\ksdk_platform_lib\kds\KL27Z644

then it will generate one ksdk_platform_lib.a under "lib\ksdk_platform_lib\kds\KL27Z644\debug"

add the .a file  in the compiler :

pastedImage_0.png

then you can use the functions under fsl_i2c_hal.h .  If it still can not work , please take a screenshot about the error and sen your project to me.

and tell me you use which version of KSDK.

2) If you create project with KSDK+PE, you can directly use the I2C_HAL_SetBaudRate function .


Have a great day,
Alice Yang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos