AnsweredAssumed Answered

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

Question asked by on Nov 29, 2019
Latest reply on Dec 3, 2019 by



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!