MCUXpresso Link Errors on Code Bundle

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

MCUXpresso Link Errors on Code Bundle

Jump to solution
1,688 Views
kk7xo
Contributor III

I installed MCUXpresso 11.0.0 and imported the code bundle for the LPC845 via the file system.  When I try to build the multi_timer_blinky example I get link errors.

pastedImage_1.png

I also tried building the peripherals_lib and received this error:

pastedImage_2.png

I tried uninstalling and re-installing MCUXpresso several times, rebooting, etc. but it did not fix the problem.  Can you help me?

0 Kudos
Reply
1 Solution
1,513 Views
kk7xo
Contributor III

Hi Omar.  All projects, including the ones you mentioned, were open and the build still fails.  However, I did find the problem.

The problem occurs when compiling peripherals_lib.  gpio.c compiles correctly, then the compilation of i2c.c fails as follows:

13:54:22 **** Build of configuration flash for project peripherals_lib ****
make -r all
Building file: ../src/gpio.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -D__USE_CMSIS -DDEBUG -D__CODE_RED -DCORE_M0PLUS -DCR_INTEGER_PRINTF -D__LPC84X__ -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/peripherals_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/utilities_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/common/inc" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs -MMD -MP -MF"src/gpio.d" -MT"src/gpio.o" -MT"src/gpio.d" -o "src/gpio.o" "../src/gpio.c"
Finished building: ../src/gpio.c
 
Building file: ../src/i2c.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -D__USE_CMSIS -DDEBUG -D__CODE_RED -DCORE_M0PLUS -DCR_INTEGER_PRINTF -D__LPC84X__ -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/peripherals_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/utilities_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/common/inc" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs -MMD -MP -MF"src/i2c.d" -MT"src/i2c.o" -MT"src/i2c.d" -o "src/i2c.o" "../src/i2c.c"
In file included from ../src/i2c.c:10:
/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/peripherals_lib/inc/i2c.h:24:10: fatal error: lpc8xx.h: No such file or directory
 #include "lpc8xx.h"
          ^~~~~~~~~~
compilation terminated.
src/subdir.mk:27: recipe for target 'src/i2c.o' failed
make: *** [src/i2c.o] Error 1
"make -r all" terminated with exit code 2. Build might be incomplete.

13:54:22 Build Failed. 3 errors, 0 warnings. (took 495ms)

Here is how I fixed it.  In i2c.h, find the following include statement:

#include "lpc8xx.h"

This statement fails on Linux because the search is case sensitive, and the file it is searching for is named LPC8xx.h (capital letters on LPC) contained in common.  I believe this will not fail under Windows because Windows is not case-sensitive about file names.

Note that i2c.c and gpio.c both have the correct include statement, but i2c.h does not, and i2c.h is encountered during the compilation of i2c.c.  Since the compiler cannot find lpc8xx.h it flags an error and the peripherals library is not built.

I changed the include statement in i2c.h from lpc8xx.h to LPC8xx.h and now everything works. :smileyhappy:

Also, I found another instance of the same problem:  In the Ctimer_PWM example, Ctimer_PWM_main.c includes Ctimer_PWM.h, however the file is actually named Ctimer_pwm.h.  Also, Ctimer_PWM_main.c includes SWM.h but the file is actually named swm.h. 

I suspect there are more of these, so it might be worth checking the other examples.

Thanks for your assistance, Omar, and please let the people at NXP know the problem so they can correct it on the next revision.

View solution in original post

0 Kudos
Reply
4 Replies
1,513 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello kk7xo@yahoo.com

Please try to import the example through this option:

pastedImage_1.png

This tab will open, then you have to select the device you are using; in this case it is an LPC845.

pastedImage_2.png

There you should select the example you want and common, peripherals and utilities.

pastedImage_3.png

Importing those 4 files into your workspace will allow you avoid the errors you had.

Let me know if this helps

Best regards

 

Omar

--------------------------------------------------------------------------------------------------------------------

Note:

- If this post answers your question, please click the "Mark Correct" button. Thank you!

--------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
1,513 Views
kk7xo
Contributor III

Hi Omar.  Thanks for responding to my post.  The procedure you presented above is exactly the procedure I followed after installing MCUXpresso, as I stated in my original post.  The only difference is that I selected all examples, not just 4.  Should I try to install just those 4 examples instead of importing all of them?

Oh, I forgot to mention, I installed MCUXpresso on Ubuntu 18.04.

Albert

0 Kudos
Reply
1,513 Views
Omar_Anguiano
NXP TechSupport
NXP TechSupport

Hello Albert Pion

When you build the example please make sure that common, peripherals and utilities are open.

pastedImage_1.png

Let me know if this helps. If you have another specific question do not hesitate to ask me.

Best regards,

Omar

0 Kudos
Reply
1,514 Views
kk7xo
Contributor III

Hi Omar.  All projects, including the ones you mentioned, were open and the build still fails.  However, I did find the problem.

The problem occurs when compiling peripherals_lib.  gpio.c compiles correctly, then the compilation of i2c.c fails as follows:

13:54:22 **** Build of configuration flash for project peripherals_lib ****
make -r all
Building file: ../src/gpio.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -D__USE_CMSIS -DDEBUG -D__CODE_RED -DCORE_M0PLUS -DCR_INTEGER_PRINTF -D__LPC84X__ -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/peripherals_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/utilities_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/common/inc" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs -MMD -MP -MF"src/gpio.d" -MT"src/gpio.o" -MT"src/gpio.d" -o "src/gpio.o" "../src/gpio.c"
Finished building: ../src/gpio.c
 
Building file: ../src/i2c.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -D__USE_CMSIS -DDEBUG -D__CODE_RED -DCORE_M0PLUS -DCR_INTEGER_PRINTF -D__LPC84X__ -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/peripherals_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/utilities_lib/inc" -I"/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/common/inc" -O0 -fno-common -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs -MMD -MP -MF"src/i2c.d" -MT"src/i2c.o" -MT"src/i2c.d" -o "src/i2c.o" "../src/i2c.c"
In file included from ../src/i2c.c:10:
/home/albert/Documents/MCUXpresso_11.0.0_2516/workspace/peripherals_lib/inc/i2c.h:24:10: fatal error: lpc8xx.h: No such file or directory
 #include "lpc8xx.h"
          ^~~~~~~~~~
compilation terminated.
src/subdir.mk:27: recipe for target 'src/i2c.o' failed
make: *** [src/i2c.o] Error 1
"make -r all" terminated with exit code 2. Build might be incomplete.

13:54:22 Build Failed. 3 errors, 0 warnings. (took 495ms)

Here is how I fixed it.  In i2c.h, find the following include statement:

#include "lpc8xx.h"

This statement fails on Linux because the search is case sensitive, and the file it is searching for is named LPC8xx.h (capital letters on LPC) contained in common.  I believe this will not fail under Windows because Windows is not case-sensitive about file names.

Note that i2c.c and gpio.c both have the correct include statement, but i2c.h does not, and i2c.h is encountered during the compilation of i2c.c.  Since the compiler cannot find lpc8xx.h it flags an error and the peripherals library is not built.

I changed the include statement in i2c.h from lpc8xx.h to LPC8xx.h and now everything works. :smileyhappy:

Also, I found another instance of the same problem:  In the Ctimer_PWM example, Ctimer_PWM_main.c includes Ctimer_PWM.h, however the file is actually named Ctimer_pwm.h.  Also, Ctimer_PWM_main.c includes SWM.h but the file is actually named swm.h. 

I suspect there are more of these, so it might be worth checking the other examples.

Thanks for your assistance, Omar, and please let the people at NXP know the problem so they can correct it on the next revision.

0 Kudos
Reply