This repo contains hardware and firmware of Baidu boteye sensor.
If you purchase the hardware from Kinco Automation(a third party manufacturer), which is already loaded with the latest firmware, you can skip the following steps.
Hardware Introduction
Firmware supports three hardware versions: XP, XP2, and XP3.
You can get fx3_firmware_linux.tar.gz and cyusb_linux_1.0.4.tar.gz, then extract to root directory of this repo.
Install arm gcc compiler
sudo apt-get install gcc-arm-none-eabi
Make sure your arm compiler is arm-none-eabi-gcc version 4.8.2
arm-none-eabi-gcc --version
Install gcc compiler
sudo apt-get install build-essential
Modify SDK config file
Configure build type in the file cyfx3sdk/fw_build/fx3_fw/fx3_build_config.mak
Change CYCONFOPT=fx3_debug to CYCONFOPT=fx3_release
Configure the arm compiler info in the file cyfx3sdk/fw_build/fx3_fw/fx3_armgcc_config.mak
Change LDLIBS += section to your lib locations, most likely located in /usr/arm-linux-gnueabi/lib/libc.a and /usr/lib/gcc/arm-none-eabi/4.8.2/libgcc.a, and replace the default like this:
The ARM toolchain location and the version are taken from environment variables
LDLIBS += \
/usr/lib/arm-none-eabi/lib/libc.a \
/usr/lib/gcc/arm-none-eabi/4.8.2/libgcc.a \
EXEEXT = elf
Compile img format convert tools: elf2img
To convert elf to img file, you need to compile cyfx3sdk/util/elf2img/elf2img.c
cd cyfx3sdk/util/elf2img
gcc elf2img.c -o elf2img -O3
Compile Firmware
If everything is all set, you can run ./build.sh within boteye_sensor/firmware, which generates cyfxuvc.img.
FX3 Image Download Tool Install
Install libusb-dev
sudo apt-get install libusb-1.0-0-dev
Install FX3 tools, please read the README in ./cyusb_linux_1.0.4.
cd cyusb_linux_1.0.4
make
chmod +x install.sh
sudo ./install.sh
If you find an error qmake-qt4: command not found, please install qt4 by running
Use cyusb_linux to flash your img file to the board flash. If the sensor has an img on flash, it will
go into auto-run mode with red LED blinking for 1s. If the sensor doesn’t have an img on flash, the red LED will
be always on. We can use ./sensor/host_bin/spi_test to erase the img on flash so that we can download a new one.
example: ./sensor/host_bin/spi_test /dev/video0
Firmware Tools
There are two tools you can use in firmware/host_bin.
spi_test: erase flash
version_test: read hardware and software version.
You can also install luvcview or other camera view tools to test the camera. However, you will most likely see green and red ghost images due to the custom formatting of the stereo raw images.
About Version
Hardware version:
You can use command dmesg to check USB Product attribute, it will show the hardware version.
Example: Baidu_Robotics_vision_XP2
Software version:
You can also use dmesg to check USB SeriaNumber attribute, it will show the software version.
Example: V0.3.7-839610e-commit [version num - commit hash - commit/dirty]
boteye_sensor
This repo contains hardware and firmware of Baidu boteye sensor. If you purchase the hardware from Kinco Automation(a third party manufacturer), which is already loaded with the latest firmware, you can skip the following steps.
Hardware Introduction
Firmware supports three hardware versions:
XP,XP2, andXP3.FX3 SDK Installation
In order to compile, you need cypress FX3 sdk (http://www.cypress.com/documentation/software-and-drivers/ez-usb-fx3-software-development-kit).
Download the sdk here http://www.cypress.com/file/221546
You can get
fx3_firmware_linux.tar.gzandcyusb_linux_1.0.4.tar.gz, then extract to root directory of this repo.Install arm gcc compiler
Make sure your arm compiler is
arm-none-eabi-gcc version 4.8.2Install gcc compiler
Modify SDK config file
Configure build type in the file
cyfx3sdk/fw_build/fx3_fw/fx3_build_config.makChange
CYCONFOPT=fx3_debugtoCYCONFOPT=fx3_releaseConfigure the arm compiler info in the file
cyfx3sdk/fw_build/fx3_fw/fx3_armgcc_config.makChange
LDLIBS +=section to your lib locations, most likely located in/usr/arm-linux-gnueabi/lib/libc.aand/usr/lib/gcc/arm-none-eabi/4.8.2/libgcc.a, and replace the default like this:Compile img format convert tools:
elf2imgTo convert elf to img file, you need to compile
cyfx3sdk/util/elf2img/elf2img.cCompile Firmware
./build.shwithinboteye_sensor/firmware, which generatescyfxuvc.img.FX3 Image Download Tool Install
Install
libusb-devInstall FX3 tools, please read the README in
./cyusb_linux_1.0.4.If you find an error
qmake-qt4: command not found, please install qt4 by runningAdd execute premission of
cyusb_linuxAdd the following two lines to
~/.bashrc, runsource ~/.bashrc, and assignCYUSB_ROOTto the corresponding file path.Image Download
cyusb_linuxto flash your img file to the board flash. If the sensor has an img on flash, it will go into auto-run mode with red LED blinking for 1s. If the sensor doesn’t have an img on flash, the red LED will be always on. We can use./sensor/host_bin/spi_testto erase the img on flash so that we can download a new one../sensor/host_bin/spi_test /dev/video0Firmware Tools
firmware/host_bin.spi_test: erase flashversion_test: read hardware and software version.luvcviewor other camera view tools to test the camera. However, you will most likely see green and red ghost images due to the custom formatting of the stereo raw images.About Version
dmesgto check USBProductattribute, it will show the hardware version.Baidu_Robotics_vision_XP2dmesgto check USBSeriaNumberattribute, it will show the software version.V0.3.7-839610e-commit[version num - commit hash - commit/dirty]