-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
HowToCompile.txt
41 lines (28 loc) · 4.91 KB
/
HowToCompile.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#to compile for HiSilicon
export SDK_CODE=0x3516E200
#export PATH=/home/home/src/openipc/output/host/bin:$PATH
#this compiles but giver error on cam
#make CROSS_COMPILE=arm-openipc-linux-musleabi- CHIPARCH=hi3516ev200
# This will compile it correctly ! Set CHIPARCH and SDK_CODE accordingly !!!
```
make \
PATH="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin:/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/sbin:/home/home/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin" AR="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gcc-ar" AS="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-as" LD="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-ld" NM="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gcc-nm" CC="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gcc" GCC="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gcc" CPP="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-cpp" CXX="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-g++" FC="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gfortran" F77="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gfortran" RANLIB="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-gcc-ranlib" READELF="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-readelf" STRIP="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-strip" OBJCOPY="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-objcopy" OBJDUMP="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-objdump" AR_FOR_BUILD="/usr/bin/ar" AS_FOR_BUILD="/usr/bin/as" CC_FOR_BUILD="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/ccache /usr/bin/gcc" GCC_FOR_BUILD="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/ccache /usr/bin/gcc" CXX_FOR_BUILD="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/ccache /usr/bin/g++" LD_FOR_BUILD="/usr/bin/ld" CPPFLAGS_FOR_BUILD="-I/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/include" CFLAGS_FOR_BUILD="-O2 -I/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/include" CXXFLAGS_FOR_BUILD="-O2 -I/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/include" LDFLAGS_FOR_BUILD="-L/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/lib -Wl,-rpath,/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/lib" FCFLAGS_FOR_BUILD="" DEFAULT_ASSEMBLER="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-as" DEFAULT_LINKER="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/arm-openipc-linux-musleabi-ld" CPPFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 " CXXFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 " LDFLAGS="" FCFLAGS=" -Os -g0" FFLAGS=" -Os -g0" PKG_CONFIG="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/bin/pkg-config" STAGING_DIR="/home/home/src/openipc/output/per-package/hisilicon-opensdk/host/arm-buildroot-linux-musleabi/sysroot" INTLTOOL_PERL=/usr/bin/perl \
CHIPARCH=hi3516ev200 SDK_CODE=0x3516E200 -C /home/home/src/openhisilicon/libraries all
```
copy driver to device:
scp /home/home/src/openhisilicon/libraries/sensor/hi3516ev200/sony_imx335_fpv/libsns_imx335.so [email protected]:/usr/lib/sensors/libsns_imx335ex.so
CHIPARCH=hi3516ev200
export SDK_CODE=0x3516E200
or
CHIPARCH=gk7205v200
export SDK_CODE=0x7205200
# To compile via copying over current drivers:
Compile OpenIPC for Hisilicon in ```/home/home/src/openipc/```.
Change code and copy over stock drivers:
cp imx335_sensor_ctl.c /home/home/src/openipc/output/build/hisilicon-opensdk/libraries/sensor/hi3516ev200/sony_imx335
cp imx335_cmos.c /home/home/src/openipc/output/build/hisilicon-opensdk/libraries/sensor/hi3516ev200/sony_imx335
cp Makefile /home/home/src/openipc/output/build/hisilicon-opensdk/libraries/sensor/hi3516ev200/sony_imx335
This will rebuild it:
make -C /home/home/src/openipc/output/ hisilicon-opensdk-rebuild
copy driver to device:
scp /home/home/src/openipc/output/build/hisilicon-opensdk/libraries/sensor/hi3516ev200/sony_imx335/libsns_imx335.so [email protected]:/usr/lib/sensors/libsns_imx335ex.so