05-30-2017 06:53 PM
I am new with the petalinux. Currently I am working on a algorithm and I have the C implementation of the code and it runs well. The code includes many files and several dependencies. My question is how could I port all the code to the petalinux and run on the ARM core?
Thanks in advance.
06-03-2017 08:25 AM
You could potentially configure petalinux with build tools and compile/run natively on your target machine but that is very unusual.
What you gotta do is to build your application ELF on windows or linux (assumed x86) using a cross-compiler (arm-none-eabi-gcc). Typically this is done inside the Vivado SDK.
After you created your ELF, you would want to either embed it inside your image file(s) or push to your target machine using SSH or similar in realtime.
06-04-2017 02:19 PM
Thanks very much I am trying to generate the application ELF file.
Since my application depends a library fftw3 :https://github.com/FFTW/fftw3.
On the Server I need to install the library first and then to use it.
However I don't know how to install it on the SDK.
I followed an instruction : https://www.xilinx.com/html_docs/xilinx2017_1/SDK_Doc/index.html?q=/html_docs/xilinx2017_1/SDK_Doc/SDK_tasks/sdk_t_create_new_libproj.html to build the library.
What I did is I added the whole folder of "fftw3" and then built it. And it not worked.
I past the message from the console:
2017-06-04 14:02:26 Extracting devices & boards... Loading repos summaries... Parsing cached content file "/home/vivado_project/arm_core_with_library_01/Packages/.cache/.content_www_keil_com_pack.xml"... File does not exist, ignored. Parsing cached content file "/home/vivado_project/arm_core_with_library_01/Packages/.cache/.content_gnuarmeclipse_sourceforge_net_packages.xml"... File does not exist, ignored. Identifying installed packages... Found no installed packages. Completed in 4ms. No installed packages. Completed in 8ms.
Identifying installed packages... Found no installed packages.
How did I installed it on SDK?
Thanks in advance.
06-04-2017 09:01 PM
I tried to get you a full run but got stuck at some point. Here's what I would do:
1. install MSYS2 (shell for windows)
2. install build essentials
3. download fftw
# fill these
# set environment
CFLAGS="-O2 -fmessage-length=0 -mcpu=cortex-a9 -mfloat-abi=softfp"
# download and untar
rm -rf fftw-$FFTW_VER
tar xzf fftw-$FFTW_VER.tar.gz
# configure and compile
./configure --with-slow-timer --enable-float --host=arm-xilinx-eabi --enable-single --enable-neon --disable-fortran "CC=$CC $CFLAGS"
The glitch is building libbench2 which are benchmarks for fftw. FFTW uses some sort of dynamic optimization, ie it tries several options and checks what is the best. The problem is that it needs a cycle counter or, if you use --with-slow-timer, it will default to gettimeofday(). However it is somehow creating a link error in the end in
timer.c:89:2: error: #error "timer not defined"
The problem is, on baremetal there is no such thing as gettimeofday() since it will need not only a cycle counter but also the entire GLIB. it should be available on FreeRTOS or Linux though. if that is the case then you have to set up the SDK tools to reflect that you are using that OS.
Another option would be to hack into libbench2/timer.c and patch it with your own code (eg AXITimer).