Got undefined reference to `GPIO_ReadPinInput' in one MCUXpresso C++ Project but not in another similar Project

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Got undefined reference to `GPIO_ReadPinInput' in one MCUXpresso C++ Project but not in another similar Project

ソリューションへジャンプ
3,512件の閲覧回数
yinni
Contributor III

Hello,

I am new to MCU and have been trying to incorporate an USB SDK example (usb_device_msc_sdcard_lite_bm) for twrk60d100m board into my own MCUXpresso C++ project based on MK50DN512CLL10. 

The example is a C project which is beyond my control when importing the SDK example from MCUXpresso.

I took three steps:

1. Modify the clockConfig.c in the example to suit my board and make it work (Has finished with help from Mark from NXP community)

2. Create a new C++ project with board MK50DN512CLL10 in MCUXpresso, and copied the source files and other required folders from the working USB example to the newly created C++ project (named MK50DN512exPrj), disabled the main () in disk_sdcard.c, added USB_DeviceApplicationInit and USB_DeviceMscAppTask functions in disk_sdcard.h, finally made it work

3. Copy the source files and the required folders from the step 2 project my C++ project, surprisingly it doesn't work when I add USB_DeviceApplicationInit() function in the main () of my project and the error is undefined reference to `GPIO_ReadPinInput'. But I did not have this problem in the step 2 project.

I could not figure out what's wrong. The attached are the two C++ project, MK50DN512exPrj is working while Kinetis Firmware_20191129_usb3 has the aforementioned problem.

Any advice is appreciated much!

0 件の賞賛
返信
1 解決策
3,378件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Please  include fsl_gpio.h in fsl_host.c.

Regards,

Jing

元の投稿で解決策を見る

2 返答(返信)
3,379件の閲覧回数
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Please  include fsl_gpio.h in fsl_host.c.

Regards,

Jing

3,378件の閲覧回数
yinni
Contributor III

Hi Jing,

It's working! But I still don't understand why in MK50DN512exPrj_cpp fsl_gpio.h don't have to be included and works well.

Many thanks!

0 件の賞賛
返信