Hi, ALL
I compiled a hello world program in Virtual Machine Ubuntu 10.
But It can't be run on EVK.
My project requires that an application should be compiled in Virtual Machine Ubuntu 10
and the application is run on EVK.
What should I do?
***************************
//test.c
#include
int main(int argc, char *argv[])
{
printf("Hello World\n");
}
arm-linux-gcc -o test test.c // I also tried [gcc -o test test.c]
***************************
Then I logged in the EVK, doing the follows
***************************
root@freescale /tmp/test$ ftpget -u s -p s 10.0.0.51 test test
***************************
ran test
***************************
root@freescale /tmp/test$ chmod 777 test
root@freescale /tmp/test$ ./test
-sh: ./test: not found
***************************
Hi, Jay
You helped my once again.
I installed arm-none-linux-gnueabi-gcc into my virtual machine ubuntu and compile test.c as follows.
arm-none-linux-gnueabi-gcc -o test test.c
The [test] can be run on imx28 evk.
Great thanks.
Jay William Stubblefield said:
I suspect that you're not building correctly for the Target Processor. I suspect that 'test' might run under Ubuntu.
This is what I did to get an application working on the MX28 EVK.
I used the gcc that I downloaded for the MX28 EVK. Namely I downloaded L2.6.35_10.12.01_SDK_source_bundle.tar.gz.
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc to build your progam. I setup Eclipse (see Application Note AN3870 - "Developing an Application for the i.MX Devices on the Linux Platform") to do the build for me. I got the results below for uart_appnote.c:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
**** Clean-only build of configuration MX28-Debug for project uart_appnote ****
make clean
rm -rf ./src/uart_appnote.o ./src/uart_appnote.d uart_appnote
**** Build of configuration MX28-Debug for project uart_appnote ****
make all
Building file: ../src/uart_appnote.c
Invoking: GCC C Compiler
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -I/home/jays1/imx28/ltib/rpm/BUILD/linux/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/uart_appnote.d" -MT"src/uart_appnote.d" -o"src/uart_appnote.o" "../src/uart_appnote.c"
Finished building: ../src/uart_appnote.c
Building target: uart_appnote
Invoking: GCC C Linker
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -L/home/jays1/imx28/ltib/rootfs/lib -L/home/jays1/imx28/ltib/rootfs/usr/lib -o"uart_appnote" ./src/uart_appnote.o
Finished building target: uart_appnote
make --no-print-directory post-build
Copy binaries to TFTP directory
cp ~/workspace/uart_appnote/MX28-Debug/uart_appnote /tftpboot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The above listing is from my console in Eclipse. I had some struggles setting up Eclipse (still running into some problems),
but the fact that I can build with it and it generates the makefiles that it uses makes it useful. I also can do source level debugging on the Target (with GDBServer over Ethernet). I had to use 3.5 (Galileo) instead of 3.4 (couldn't get to come up under Ubuntu 10.04.3). I downloaded and installed the Galileo version of Eclipse from http://www.eclipse.org/downloads/packages/release/galileo/sr2. Choose “Eclipse IDE for C/C++ Developers” for Linux, 32-bit (eclipse-cpp-galileo-SR2-linux-gtk.tar.gz). I had to install "OpenJDK Java 6 Runtime" from the Ubuntu Software Center before installing Eclipse as Java is required for Eclipse to run.
Hope this helps.
One way to build an app is to use LTIB. Download the documentation bundle, L2.6.35_10.12.01_SDK_docs.tar.gz from freescale.com and read the app note Linux_HelloWorld_AN.pdf. It shows how to create a spec file and a makefile for your app and use LTIB to build it for the i.mx28 target.
I suspect that you're not building correctly for the Target Processor. I suspect that 'test' might run under Ubuntu.
This is what I did to get an application working on the MX28 EVK.
I used the gcc that I downloaded for the MX28 EVK. Namely I downloaded L2.6.35_10.12.01_SDK_source_bundle.tar.gz.
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc to build your progam. I setup Eclipse (see Application Note AN3870 - "Developing an Application for the i.MX Devices on the Linux Platform") to do the build for me. I got the results below for uart_appnote.c:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
**** Clean-only build of configuration MX28-Debug for project uart_appnote ****
make clean
rm -rf ./src/uart_appnote.o ./src/uart_appnote.d uart_appnote
**** Build of configuration MX28-Debug for project uart_appnote ****
make all
Building file: ../src/uart_appnote.c
Invoking: GCC C Compiler
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -I/home/jays1/imx28/ltib/rpm/BUILD/linux/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/uart_appnote.d" -MT"src/uart_appnote.d" -o"src/uart_appnote.o" "../src/uart_appnote.c"
Finished building: ../src/uart_appnote.c
Building target: uart_appnote
Invoking: GCC C Linker
/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc -L/home/jays1/imx28/ltib/rootfs/lib -L/home/jays1/imx28/ltib/rootfs/usr/lib -o"uart_appnote" ./src/uart_appnote.o
Finished building target: uart_appnote
make --no-print-directory post-build
Copy binaries to TFTP directory
cp ~/workspace/uart_appnote/MX28-Debug/uart_appnote /tftpboot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The above listing is from my console in Eclipse. I had some struggles setting up Eclipse (still running into some problems),
but the fact that I can build with it and it generates the makefiles that it uses makes it useful. I also can do source level debugging on the Target (with GDBServer over Ethernet). I had to use 3.5 (Galileo) instead of 3.4 (couldn't get to come up under Ubuntu 10.04.3). I downloaded and installed the Galileo version of Eclipse from http://www.eclipse.org/downloads/packages/release/galileo/sr2. Choose “Eclipse IDE for C/C++ Developers” for Linux, 32-bit (eclipse-cpp-galileo-SR2-linux-gtk.tar.gz). I had to install "OpenJDK Java 6 Runtime" from the Ubuntu Software Center before installing Eclipse as Java is required for Eclipse to run.
Hope this helps.