Build issues with MCUXpresso using SDK_2.5.0_FRDM-K82F for FRDM-K82F board

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

Build issues with MCUXpresso using SDK_2.5.0_FRDM-K82F for FRDM-K82F board

2,791 Views
venkatesh_godug
Contributor II

Hi,

I'm trying to build the application for my FRDM-K82F board using MCUXpresso IDE with SDK_2.5.0_FRDM-K82F.

I am following the below mentioned procedure.

1. Installed the MCUXpresso IDE from the NXP site
2. Generated and downloaded the SDK_2.5.0_FRDM-K82F.zip from the NXP site(https://mcuxpresso.nxp.com/en/select)

3. Opened the MCUXpresso IDE
4. At botton Quickstart Pane windows choose the New Project.
5. From SDK MCUs Choose the Target as K8x, it will show the Available boards, choose the frdm82f, then choose the default settings and click on finish
6. Open the recently added project then clean and build it, then we can see executable .axf gets generated
7. Now we will add our application codes(SDK_v2.0_mbed2.1.2->middleware->mbedtls->program->x509) into the source folder then build the project again
8. Now we are encountering headerfile missing problem.
9. We have set the system include(SDK_v2.0_mbed2.1.2->middleware->mbedtls->include) paths in Project->Properties->C/C++ Build->Settings->Tool Settings->Includes tab. So now header file issue got resolved but some other issues undefined reference to `mbedtls_x509_crt_info'. So we found that definitions are available in library directory (SDK_v2.0_mbed2.1.2->middleware->mbedtls->library), so we added this folder to the source folder of the project. But now we found different error, please see below

../source/library/bignum.c: In function 'mpi_mul_hlp':
../source/library/bignum.c:1141:1: error: r7 cannot be used in asm here
 }
 ^
source/library/subdir.mk:222: recipe for target 'source/library/bignum.o' failed
make: *** [source/library/bignum.o] Error 1
make: *** Waiting for unfinished jobs....

Kindly look at the attached image files

Kindly provide me the basic procedure to build application for FRDM-K82F using either KDS or MCUXpresso IDE with SDK.

Thanks,

venkatesh

Tags (1)
5 Replies

2,510 Views
venkatesh_godug
Contributor II

Hi Con Verse,

Thanks for your comments,

The above issue got resolved by adding the flag "-fomit-frame-pointer" to the compiler.

But now the compiler is unable to fetch the system header files("/usr/include" i'm using mcuexpresso in Ubuntu), so i'm getting errors as

"../source/library/net.c:63:10: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
          ^~~~~~~~~~~~~
compilation terminated.
Building file: ../source/library/padlock.c
source/library/subdir.mk:222: recipe for target 'source/library/net.o' failed
make: *** [source/library/net.o] Error 1
make: *** Waiting for unfinished jobs....
"

is it really searching for system header files, if so,

Now i have tried to add the system path i.e "/usr/include/sys and /usr/include/" in C/C++Build->Settings->ToolSetting tab->Includes so that it will pick the types.h file from the above location.

So now the header file missing issue got resolved but lot of other conflict and unknown type errors had generated, kindly look at the attachment log file(SW-Content-Register.txt).

Thanks,

venkatesh

0 Kudos

2,509 Views
converse
Senior Contributor V

You cannot use /usr/include (i.e. your operating systems include files) as they are for Intel Ubuntu system and not for Cortex-M4 embedded system. As you have seen they are incompatible.

The MCUXpresso compiler ships with its own 'system' header files and the compiler will search for them automatically - unless you have removed them from the compiler search path by using the -nostdinc parameter

2,510 Views
venkatesh_godug
Contributor II

Hi Con Verse.

I have verified the compiler flags and its settings, i haven't seen such kind of flag i.e -nostdinc. Then I have searched for the header files and found in the below highlighted paths so we have added path(/usr/local/mcuxpressoide-10.3.0_2200/ide/plugins/com.nxp.mcuxpresso.tools.linux_10.3.0.201811011841/tools/features/include, /usr/local/mcuxpressoide-10.3.0_2200/ide/plugins/com.nxp.mcuxpresso.tools.linux_10.3.0.201811011841/tools/redlib/include) in ToolSettings->includesbut still compiler is not able to pick the header files from that location.


../source/library/net.c:63:10: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
          ^~~~~~~~~~~~~
compilation terminated.
source/library/subdir.mk:222: recipe for target 'source/library/net.o' failed
make: *** [source/library/net.o] Error 1
make: *** Waiting for unfinished jobs....

Thanks,

venkatesh

0 Kudos

2,510 Views
converse
Senior Contributor V

Note that when adding a library, you must 

1. Specify the raw library name - so if it is called libLibrary.a, you add just "Library" in the library name field of the linker configuration

2. Add the path where it can be found, separately. o if the library is located at E:/Workspace/src/libLibrary.a, specify E:/Workspace/src in the library path field of the linker configuration

0 Kudos

2,510 Views
converse
Senior Contributor V

"Undefined Reference" is a linker reported issue, not a compiler header issue. See the first paragraph of https://community.nxp.com/thread/389070 (Note - this is NOT a C library issue)

You need to post the code in "mpi_mul_hlp" to see what is causing the error - bt it looks like you have incorrectly written some ASM inline code.