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.
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!
-----------------------------------------------------------------------------------------------------------------------
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,
I wish I was clear, we have a requirement to use SDK 1.7, can you give me FAQ of that one if possible.
Use the following page:
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!
-----------------------------------------------------------------------------------------------------------------------
The following page contains information about toolchain building:
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!
-----------------------------------------------------------------------------------------------------------------------
The link that you have given is not loading. It says '404 Not Found'. Please look into it .
Thanks,