Undefined reference to I2C_HAL_SetBaudRate

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Undefined reference to I2C_HAL_SetBaudRate

跳至解决方案
895 次查看
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

标签 (1)
0 项奖励
回复
1 解答
813 次查看
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 项奖励
回复
1 回复
814 次查看
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 项奖励
回复