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

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

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

Jump to solution
1,674 Views
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 Kudos
Reply
1 Solution
1,540 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Please  include fsl_gpio.h in fsl_host.c.

Regards,

Jing

View solution in original post

2 Replies
1,541 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Please  include fsl_gpio.h in fsl_host.c.

Regards,

Jing

1,540 Views
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 Kudos
Reply