Toolchain in provide in SDK Yocto build environmen

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Toolchain in provide in SDK Yocto build environmen

9,403 次查看
hitusharma
Contributor II

Hi

I am trying to write the simple programe on Freeescale SDK 1.6. Can you tell me how to use the Toolchain in provide in SDK Yocto build environment?

标签 (2)
0 项奖励
回复
21 回复数

4,977 次查看
hitusharma
Contributor II

Hi Yiping

I am able to execute the command and the output is test.exe

Is that correct or the output should be  linux compatible??

regds

Hitu

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi yiping

Following is the path where sysroots/i686-linux/usr/bin/ppce500v2-fsl-linux-gnuspe is installed

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/sysroots/i686-linux/usr/bin/ppce500v2-fsl-linux-gnuspe$

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/sysroots/i686-linux/usr/bin/ppce500v2-fsl-linux-gnuspe$ {CC} test.c -o hello

Traceback (most recent call last):

  File "/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/lib/python2.7/site.py", line 569, in <module>

    main()

  File "/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/lib/python2.7/site.py", line 551, in main

    known_paths = addusersitepackages(known_paths)

  File "/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/lib/python2.7/site.py", line 278, in addusersitepackages

    user_site = getusersitepackages()

  File "/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/lib/python2.7/site.py", line 253, in getusersitepackages

    user_base = getuserbase() # this will also set USER_BASE

  File "/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/lib/python2.7/site.py", line 242, in getuserbase

    from sysconfig import get_config_var

  File "/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/lib/python2.7/sysconfig.py", line 10, in <module>

    'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',

AttributeError: 'module' object has no attribute 'lib'

and the similar error while executing

$ powerpc-fsl-linux-gnuspe-gcc test.c

regds

HItu

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,

Please make sure you have already executed  "source environment-setup-ppce500v2-fsl-linux-gnuspe" first.

Please make sure python on your target is greater than 2.7.3.

If you have already  installed python to other path, please use "export PATH=$PYTHON_PATH/bin:$PATH" to export it.

If your problem remains, please capture and attach your shell log to help me to understand your current status.


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

I have installed Python ver 2.7.6 ai have exported it to the suggested path.

Still the compiler is not able to colate the test.c file which i saved in the SDK installation folder.

Error:

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y$ powerpc-fsl-linux-gnuspe-gcc test.c--sysroot

powerpc-fsl-linux-gnuspe-gcc: error: test.c--sysroot: No such file or directory

powerpc-fsl-linux-gnuspe-gcc: fatal error: no input files

compilation terminated.

If you can tell me that where to save the user file "test.c" so that compiler can compile the code.

Regards

Hitu

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,

Please use "powerpc-fsl-linux-gnuspe-gcc test.c  --sysroot=<toolchain_install_path>/sysroots/ppce500v2-fsl-linux-gnuspe -o test".

There is a space between test.c and --sysroot.

Thanks,

Yiping

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

HI Yiping

the output is like this

embedded@embedded-HP-Z210-SFF-Workstation:~$ cd /home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/
embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release$ powerpc-fsl-linux-gnuspe-gcc test.c  --sysroot=cd /home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/ppce500v2-fsl-linux-gnuspe -o test".
>
I can't conclude it..plz help it.

regrds

Hitu

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,

Why do you add "cd" after "--sysroot"?

Please use the following command.

powerpc-fsl-linux-gnuspe-gcc test.c  --sysroot=/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/ppce500v2-fsl-linux-gnuspe -o test


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,980 次查看
hitusharma
Contributor II

Hi Yiping

I got Following errors:

embedded@embedded-HP-Z210-SFF-Workstation:~$ cd /home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y$ powerpc-fsl-linux-gnuspe-gcc test.c  --sysroot= /home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/ppce500v2-fsl-linux-gnuspe -o test

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find crt1.o: No such file or directory

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find crti.o: No such file or directory

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find crtbegin.o: No such file or directory

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find /home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/ppce500v2-fsl-linux-gnuspe: File format not recognized

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find -lgcc

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find -lgcc_s

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find -lc

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find -lgcc

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find -lgcc_s

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find crtend.o: No such file or directory

/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y/sysroots/i686-fslsdk-linux/usr/bin/powerpc-fsl-linux/../../libexec/powerpc-fsl-linux/gcc/powerpc-fsl-linux/4.8.1/ld: cannot find crtn.o: No such file or directory

collect2: error: ld returned 1 exit status

regds

Hitu

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

Following is the error I AM GETTING , when I saved the test.c in sdk folder

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk$ powerpc-fsl-linux-gnuspe-gcc test.c  --sysroot=/opt/fsl-networking/QorIQ-SDK-V1.6/sysroots/ppce500v2-fsl-linux-gnuspe -o hello

test.c:1:19: fatal error: stdio.h: No such file or directory

#include <stdio.h>

                   ^

compilation terminated.

regds

Hitu

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,

The sysroot path depends on where you have installed the Toolchain, "/opt/fsl-networking/QorIQ-SDK-V1.6/sysroots/ppce500v2-fsl-linux-gnuspe" is for the default installation path, you could use "--sysroot=<your_install_path>/sysroots/ppce500v2-fsl-linux-gnuspe", please check whether it indeed exists.

I suggest you use the following command, CC is already defined in the environment-setup-ppce500v2-fsl-linux-gnuspe.

>>>>${CC} test.c -o test


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

My source file is test.c which has a simple program of helloworld, please confirm where should I save my notepad file ie test.c on the system.

regds

Hitu

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

Following are the logs I revived, I have installed SDK in Y

I have saved my helloworld program in SDK in Case 1 and in meta-fsl-ppc-toolchain folder for case 2.

Case 1

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release$ powerpc-fsl-linux-gnuspe-gcc test.c--sysroot
powerpc-fsl-linux-gnuspe-gcc: error: test.c--sysroot: No such file or directory
powerpc-fsl-linux-gnuspe-gcc: fatal error: no input files
compilation terminated.

Case 2

embedded@embedded-HP-Z210-SFF-Workstation:~/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/sdk/y$ powerpc-fsl-linux-gnuspe-gcc test.c--sysroot

powerpc-fsl-linux-gnuspe-gcc: error: test.c--sysroot: No such file or directory

powerpc-fsl-linux-gnuspe-gcc: fatal error: no input files

compilation terminated

regds

Hitu

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,


test.c  is the source file, it is only an example, you need to create by your own.


You could use

${CC} <your_soure>  -o <out_put>


or

powerpc-fsl-linux-gnuspe-gcc <your_soure>  --sysroot=/opt/fsl-networking/QorIQ-SDK-V1.6/sysroots/ppce500v2-fsl-linux-gnuspe -o <out_put>


There is a space before --sysroot.

Thanks,

Yiping

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

Is there any IDE for the standalone tool chain?

regds

Hitu

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

HI Yiping

It is not recognizing stdio.h, do I have to Include the header files and libraries separately.

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,


The standalone Toolchain is easy to use, please remember to add "--sysroot".


For your problem, would you please share your source file and build log?


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

Instead of using the standard tool chain in the SDK I have installed the stand alone tool chain and it has been installed successfully in the SDK folder of QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/deploy/SDK.

I wan to know how I can use the same to write simple C application.

Kindly suggest any standard document which can explain it step by step.

regds

Hitu

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,

It seems that I have already mentioned about how to use standalone Toolchain in your previous query.

After install the standalone toolchain, you need to execute the script "source environment-setup-ppce500v2-fsl-linux-gnuspe"

The you could use the following command to build program.

"${CC} test.c -o test "

Or

"powerpc-fsl-linux-gnuspe-gcc test.c

--sysroot=/opt/fsl-networking/QorIQ-SDK-V1.6/sysroots/ppce500v2-fsl-linux-gnuspe -o test".


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,984 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Hello Hitu,

After run "bitbake fsl-image-core" to set up the build environment, the Toolchain is deployed in <install_path>/build_p2020rdb_release/tmp/sysroots/x86_64-linux/usr/bin/ppce500v2-fsl_networking-linux-gnuspe folder.

$ export PATH=<install_path>/build_p2020rdb_release/tmp/sysroots/x86_64-linux/usr/bin/ppce500v2-fsl_networking-linux-gnuspe:$PATH

Then use the following command to compile a c source file.

$ powerpc-fsl_networking-linux-gnuspe-gcc -m32 -mcpu=8548 -mabi=spe -mspe -mfloat-gprs=double test.c -o test --sysroot=<install_path>/build_p2020rdb_release/tmp/sysroots/p2020rdb/


Have a great day,
Yiping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

4,984 次查看
hitusharma
Contributor II

Hi Yiping

I have installed "bitbake fsl-image-full"

The folders in the cd /home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/sysroots is i686-linux/usr/bin/ppce500v2-fsl_networking-linux-gnuspe:$PATH

bash: export: `/home/embedded/QorIQ-SDK-V1.6-20140619-yocto/build_p2020rdb_release/tmp/sysroots/i686-linux/usr/bin/ppce500v2-fsl-linux-gnuspe:cd': not a valid identifier

regads

Hitu

0 项奖励
回复