P2020RDB-PCA : Cross compiling and executing a binary.

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

P2020RDB-PCA : Cross compiling and executing a binary.

884 Views
pradeepsysargus
Contributor II

We are trying to cross compile a C programming file on host Linux Ubuntu and run the generated binary on the target board P2020RDB-PCA.

I suppose we need a tool chain for this, we are currently referring SDK 1.7 document.

Please guide in this process.

0 Kudos
6 Replies

643 Views
Pavel
NXP Employee
NXP Employee

Use the following command sequence for SDK 1.7.

Build and install the standalone toolchain with Yocto:

$ source ./fsl-setup-poky -m <machine>

$ bitbake fsl-toolchain

$ cd build_<machine>_release/tmp/deploy/sdk

$ ./fsl-networking-eglibc-<host-system>-<core>-toolchain-<release>.sh

Note: The default installation path for standalone toolchain is /opt/fsl-networking/. The install folder can be specified during the installation procedure.

Use similar command for test.c compiling:

gcc test.c --sysroot=/opt/fsl-networking/QorIQ-SDK-V1.7/sysroots/ppce500v2-fsl-linux-gnuspe/ -o test.c


Have a great day,
Pavel Chubakov

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

0 Kudos

643 Views
pradeepsysargus
Contributor II

After executing test.c, we got the following error on the target board.

./test: line 1 : syntax error: unexpected "("

test.c file is:

#include<sys/types.h>

#include<sys/stat.h>

#include<unistd.h>

#include<fcntl.h>

void main()

{

int fd;

// fd=  open("file1.txt",O_CREAT | O_WRONLY,0600);

fd= open("/dev/ttyS0",O_RDONLY);

close(fd);

}

Either I tried to create a new file file1.txt or open the file /dev/ttyS0, it is giving the same error.

Thanks,

0 Kudos

643 Views
pradeepsysargus
Contributor II

I wish I was clear, we have a requirement to use SDK 1.7, can you give me FAQ of that one if possible.

0 Kudos

643 Views
Pavel
NXP Employee
NXP Employee

Use the following page:

https://freescale.sdlproducts.com/LiveContent/web/pub.xql?c=t&action=home&pub=QorIQ_SDK_1.9&lang=en-...

Use "FAQ" for finding required page.


Have a great day,
Pavel Chubakov

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

0 Kudos

643 Views
Pavel
NXP Employee
NXP Employee

The following page contains information about toolchain building:

https://freescale.sdlproducts.com/LiveContent/web/pub.xql?action=home&pub=QorIQ_LS2085A_EAR_6.0&lang....

Build and install the standalone toolchain with Yocto:

$ source ./fsl-setup-poky -m <machine>

$ bitbake fsl-toolchain

$ cd build_<machine>_release/tmp/deploy/sdk

$ ./fsl-networking-eglibc-<host-system>-<core>-toolchain-<release>.sh

Note: The default installation path for standalone toolchain is /opt/fsl-networking/. The install folder can be specified during the installation procedure.

Use the following command for test.c compiling:

gcc test.c --sysroot=/opt/fsl-networking/QorIQ-SDK-V1.7/sysroots/ppce500v2-fsl-linux-gnuspe/ -o test.c


Have a great day,
Pavel Chubakov

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

0 Kudos

643 Views
pradeepsysargus
Contributor II

The link that you have given is not loading. It says '404 Not Found'. Please look into it .

Thanks,

0 Kudos