Comipiling Guide
Before compiling:
- Install Toolchain and make sure it works properly( reference: "Toolchain_Guide")
- Download SDK,extract related source
u-boot compiling method
u-boot can be compiled independently. ISVP board level compiler as example,Under u-boot source code directory:
SFC start u-boot:
make isvp_t10_sfcnor
or make isvp_t10_sfcnor_config;make
MSC1(TF card)start u-boot:
make isvp_t10_msc0
or make isvp_t10_msc0_config;make
Notes:After modifying the board.h file, run "make distclean" before compiling again.
Chip u-boot configuration instructions:
-
T10:
- isvpt10sfcnor
- isvpt10msc0 --MSC card
-
T20:
- isvpt20sfcnor
- isvpt20sfcnor_ddr128M --T20X(1Gbit DDR release)
- isvpt20msc0 --MSC card
- isvpt20msc0ddr128M --MSC card,T20X(1Gbit DDR release),it is recommended to use 512MB's configurations if the card will be used only for NorFlash.
kernel compiling method
kernel can be compiled independently. Under kernel source code directory:
select default config:
make isvp_mango_defconfig
compile uImage:
make uImage
compile zImage:
make zImage
compile modules(In kernel source):
make modules
Chip kernel configuration instructions:
- isvpmangodefconfig --T10 default kernel configurations
- isvpmangomini_defconfig --mini T10 default kernel configurations
- isvpbulldefconfig --T20 default kernel configurations
ko compiling method
except the non-related kernel's ko compiling,this relies on kernel,and kernel has to be compiled first. example:
ISP driver:
cd opensource/drivers/isp/tx-isp
make
Sensor drivers(depend on ISP driver not kernel). We can compile them after compiling kernel and ISP drivers:
cd opensource/drivers/sensors/ov9732
make
Notes:
- Everytime kernel is modified,it might cause incompatibility's issues, so we need to compile the drivers again.
- First compile ISP driver then the sensor drivers.
busybox compiling method
busybox compiling is similar to kernel compiling. First "make defconfig" then "make" and finally "make install", it will automatically place the installed files under busybox/_install directory.
make isvp_glibc_defconfig
make
make install
Configuration instructions:
- isvpglibcdefconfig --glibc defaultconfig
- isvpglibcmini_defconfig --glibc mini default config
- isvpuclibcdefconfig --uclibc default config
- isvpuclibcmini_defconfig --uclibc mini default config
Application comipiling metod
Some points:
- About the difference between glibc and uclibc compilation, please refer to "Toolchain_Guide"
- About API library's link order:[IVS library] [mxulibrary] [libimp/libsysutils] [libalog]
- libimp depends on C++ libraries,so we need to use mips-linux-gnu-g++ to link,if gcc link is used, we need to add LD_FLAGS+=stdc++ manually.
-
Optimization of elf files' size:
- Compiler level select "O2":C_FLAGS/CXX_FLAGS += -O2
- LDFLAG += -Wl,-gc-sections,Do not link unnecessary segments
- About elf files, run mips-linux-gnu-strip,Link then delete the unncessary segments
- If the system has multiple elf files which need to link to library files, we can use dynamic link's mode,if it is only one file to link to the library files just use static link mode(Note that there is only one instance of libimp related functions in the system). Dynamic link mode can be convenient for debugging and problem feedback.