Test Application
In the kernel sources, ./tools/spi/spidev_test.c is a test application within the kernel that can be cross compiled to show a C application interacting with the SPI peripheral.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hii all,
I want to reads part no of SPI Flash memory and when i am building test application(spidev_test.c) for SPI flash memory(w25q64) through Code Composer Studio. I am getting fatal error.
I am building through this tool linux-devkit(IN SDK).
**** Build of configuration Debug for project spidev_test ****
/home/astra/ti/ccs1220/ccs/utils/bin/gmake -k -j 8 all -O
Building file: "../spidev_test.c"
Invoking: Arm Compiler
"/home/astra/ti/ccs1220/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl" -mv4 --code_state=32 --include_path="/home/astra/workspace_v12/spidev_test" --include_path="/home/astra/ti/ccs1220/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include" -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="spidev_test.d_raw" "../spidev_test.c"
>> Compilation failure
subdir_rules.mk:7: recipe for target 'spidev_test.obj' failed
"../spidev_test.c", line 25: fatal error #1965: cannot open source file "fcntl.h"
1 catastrophic error detected in the compilation of "../spidev_test.c".
Compilation terminated.
gmake: *** [spidev_test.obj] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
Please help me to fix this issue.
Regards
Niraj Kumar
Thanks Jianzhong
I got spidev_test.c from here.
Test Application
In the kernel sources, ./tools/spi/spidev_test.c is a test application within the kernel that can be cross compiled to show a C application interacting with the SPI peripheral.
Now I am getting this type of error when I am building.
**** Build of configuration Debug__TICLANG for project spidev_test ****
/home/astra/ti/ccs1220/ccs/utils/bin/gmake -k -j 8 all -O
Building file: "../spidev_test.c"
Invoking: Arm Compiler
"/home/astra/ti/ccs1220/ccs/tools/compiler/ti-cgt-armllvm_2.1.2.LTS/bin/tiarmclang" -c -mfloat-abi=soft -mbig-endian -marm -O0 -I"/home/astra/workspace_v12/spidev_test" -I"/home/astra/ti/ccs1220/ccs/tools/compiler/ti-cgt-armllvm_2.1.2.LTS/include" -Dam3359 -gdwarf-3 -Werror=ti-pragmas -Werror=ti-macros -Werror=ti-intrinsics -fno-short-wchar -fcommon -MMD -MP -MF"spidev_test.d_raw" -MT"spidev_test.o" -std=gnu90 -o"spidev_test.o" "../spidev_test.c"
subdir_rules.mk:7: recipe for target 'spidev_test.o' failed
tiarmclang: error: architecture 'arm' does not support 'ARM' execution mode
tiarmclang: error: big endian not supported for subtarget.
gmake: *** [spidev_test.o] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
Regards
Niraj Kumar
In the kernel sources, ./tools/spi/spidev_test.c is a test application within the kernel that can be cross compiled to show a C application interacting with the SPI peripheral.
Now I am getting this type of error when I am building.
**** Build of configuration Debug__TICLANG for project spidev_test ****
/home/astra/ti/ccs1220/ccs/utils/bin/gmake -k -j 8 all -O
if you want to build the spidev_test.c program you need to cross-compile this with the cross toolchain part of the SDK (not using CCS!). Once you install the SDK (from https://www.ti.com/tool/PROCESSOR-SDK-AM335X), you can find the cross toolchain at <SDK_INSTALL_DIR>/linux-devkit. Activate the cross toolchain using the source environment-setup command from within that folder, and then you should be able to build spidev_test.c using the $CC command, something like this:
a0797059@dasso:~/ti $ source ti-processor-sdk-linux-am335x-evm-08.02.00.24/linux-devkit/environment-setup [linux-devkit]:~/ti> cd ~/git/linux [linux-devkit]:~/git/linux> $CC ./tools/spi/spidev_test.c -o spidev_test [linux-devkit]:~/git/linux> ll spidev_test -rwxrwxr-x 1 a0797059 a0797059 26756 Jul 31 15:56 spidev_test* [linux-devkit]:~/git/linux> file spidev_test spidev_test: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped [linux-devkit]:~/git/linux>
Regards, Andreas