This is a repository which step by step teaches you how to build your own examples and run on Seeed Grove Vision AI Module V2. Finally, teach you how to restore to the original factory settings and run SenseCraft AI from Seeed Studio.
-
How to build the firmware?
-
How to flash the firmware?
-
How to restore to the original factory settings?
-
How to build face mesh scenario app exmple and run on WE2?
This part explains how you can build the firmware for Grove Vision AI Module V2.
Note: The following has been tested to work on Ubuntu 20.04 PC
- Step 1: Install the following prerequisites
sudo apt install make
- Step 2: Download Arm GNU Toolchain (arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz)
cd ~ wget https://developer.arm.com/-/media/Files/downloads/gnu/13.2.rel1/binrel/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
- Step 3: Extract the file
tar -xvf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
- Step 4: Add arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/: to PATH
export PATH="$HOME/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/:$PATH"
- Step 5: Clone the following repository and go into HIMAX_WE2_Rabboni folder
git clone https://github.com/HimaxWiseEyePlus/HIMAX_WE2_Rabboni cd HIMAX_WE2_Rabboni
- Step 6: Compile the firmware
cd EPII_CM55M_APP_S make clean make
- Output elf file:
./obj_epii_evb_icv30_bdv10/gnu_epii_evb_WLCSP65/EPII_CM55M_gnu_epii_evb_WLCSP65_s.elf
- Step 7: Generate firmware image file
cd ../we2_image_gen_local/ cp ../EPII_CM55M_APP_S/obj_epii_evb_icv30_bdv10/gnu_epii_evb_WLCSP65/EPII_CM55M_gnu_epii_evb_WLCSP65_s.elf input_case1_secboot/ ./we2_local_image_gen project_case1_blp_wlcsp.json
- Output firmware image:
./output_case1_sec_wlcsp/output.img
Note: The steps are almost the same as the Linux environment except Step 7
.
- Step 7: Generate firmware image file (using
./we2_local_image_gen_macOS_arm64
for MacOS)cd ../we2_image_gen_local/ cp ../EPII_CM55M_APP_S/obj_epii_evb_icv30_bdv10/gnu_epii_evb_WLCSP65/EPII_CM55M_gnu_epii_evb_WLCSP65_s.elf input_case1_secboot/ ./we2_local_image_gen_macOS_arm64 project_case1_blp_wlcsp.json
- Step 1: Install the
make
command for prerequisites - Step 2: Download Arm GNU Toolchain arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip
- Step 3: Extract the file
tar -xvf arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi.zip
- Step 4: Add arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi/bin/: to PATH
setx PATH "%PATH%;[location of your gnu-toolchain-13.2 ROOT]\arm-gnu-toolchain-13.2.rel1-mingw-w64-i686-arm-none-eabi\bin"
- Step 5: Clone the following repository and go into HIMAX_WE2_Rabboni folder
git clone https://github.com/HimaxWiseEyePlus/HIMAX_WE2_Rabboni cd HIMAX_WE2_Rabboni
- Step 6: Compile the firmware
cd EPII_CM55M_APP_S make clean make
- Output elf file:
./obj_epii_evb_icv30_bdv10/gnu_epii_evb_WLCSP65/EPII_CM55M_gnu_epii_evb_WLCSP65_s.elf
- Step 7: Generate firmware image file
cd ../we2_image_gen_local/ cp ../EPII_CM55M_APP_S/obj_epii_evb_icv30_bdv10/gnu_epii_evb_WLCSP65/EPII_CM55M_gnu_epii_evb_WLCSP65_s.elf input_case1_secboot/ we2_local_image_gen project_case1_blp_wlcsp.json
- Output firmware image:
./output_case1_sec_wlcsp/output.img
This part explains how you can flash the firmware to Grove Vision AI Module V2.
- Driver
- If you find that the Grove Vision AI V2 is not recognised after connecting it to your computer, you should install the driver which can reference here.
- Grove Vision AI Module V2
- Connection cable
- Micro usb cable: connect to EVB (as Power/UART)
- Software Tools
Serial terminal emulation application
- In the following description,
TeraTerm
andMinicom
will be used.- Serial terminal emulation application Setting
- Baud Rate 921600 bps
- Data 8 bit
- Parity none
- Stop 1 bit
- Flow control none
- please check xmodem protocol is supported.
- Minicom (for Linux PC)
- Install minicom command
sudo apt-get install minicom
- Burn application to flash by using xmodem send application binary.
- Open the permissions to access the device
sudo setfacl -m u:[USERNAME]:rw /dev/ttyUSB0 # in my case # sudo setfacl -m u:kris:rw /dev/ttyACM0
- Open minicom
sudo minicom -s
- Setup serial port and COM Port name
- Tips for finding the COM Port name.
- You can use google chrome to connect to Seeed SenseCraft AI, select
Grove Vision(V2)
and pressConnect
. - Then, you would get the COM Port name.
- You can use google chrome to connect to Seeed SenseCraft AI, select
- Tips for finding the COM Port name.
- Install minicom command
- TeraTerm (for Windows PC)
- Serial terminal emulation application Setting
- In the following description,
Following steps update application in the flash.
- Step 1: Open
Minicom
, setup serial port and COM Port name-> connect to Grove Vision AI Module V2. (Please reference the minicom part of System Requirement) - Step 2: Hold down any key on the keyboard (except the Enter key) and press the reset button to reset Grove Vision AI Module V2 and the startup options will be displayed.
- Step 3: Press button “1” and Grove Vision AI Module V2 will enter receiving mode after then.
- Step 4: Press
Ctrl+A
on keyboard to enter minicom menu, and then presss
on keyboard to upload file and selectxmodem
. - Step 5: Select the firmware image at
HIMAX_WE2_Rabboni\we2_image_gen_local\output_case1_sec_wlcsp\output.img
and pressenter
to burn. - Step 6: After burning is compelete, press any key to be continue.
- Step 7: Then, you will see the message "Do you want to end file transmission and reboot system? (y)" is displayed. Press button
y
to restart. - Step 8: You will see the uart on
minicom
which is runing your algorithm.
Following steps update application in the flash.
- Step 1: Open
TeraTerm
and select File -> New connection, connect to Grove Vision AI Module V2. - Step 2: Hold down any key on the keyboard (except the Enter key) and press the reset button to reset Grove Vision AI Module V2 and the startup options will be displayed.
- Step 3: Press button “1” and Grove Vision AI Module V2 will enter receiving mode after then. Select target flash image(output.img) by File->Transfer->XMODEM->Send.
- Step 4: After the firmware image burning is completed, the message "Do you want to end file transmission and reboot system? (y)" is displayed. Press button
y
to restart. - Step 5: You will see the uart on
TeraTerm
which is runing your algorithm.
- Prerequisites for xmodem
- Please install the package at xmodem/requirements.txt
pip install -r xmodem/requirements.txt
- Please install the package at xmodem/requirements.txt
- Disconnect
Minicom
- Make sure your
Seeed Grove Vision AI Module V2
is connect to PC. - Open the permissions to acceess the deivce
sudo setfacl -m u:[USERNAME]:rw /dev/ttyUSB0
# in my case
# sudo setfacl -m u:kris:rw /dev/ttyACM0
- Open
Terminal
and key-in following command - port: the COM number of your
Seeed Grove Vision AI Module V2
, for example,/dev/ttyACM0
- baudrate: 921600
- file: your firmware image [maximum size is 1MB]
python3 xmodem/xmodem_send.py --port=[your COM number] --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local/output_case1_sec_wlcsp/output.img # example: # python3 xmodem/xmodem_send.py --port=/dev/ttyACM0 --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local/output_case1_sec_wlcsp/output.img
- It will start to burn firmware image.
- Please press
reset
buttun onSeeed Grove Vision AI Module V2
. - It will success to run the algorithm.
- Prerequisites for xmodem
- Please install the package at xmodem/requirements.txt
pip install -r xmodem/requirements.txt
- Please install the package at xmodem/requirements.txt
- Disconnect
Tera Term
- Make sure your
Seeed Grove Vision AI Module V2
is connect to PC. - Open
CMD
and key-in following command - port: the COM number of your
Seeed Grove Vision AI Module V2
- baudrate: 921600
- file: your firmware image [maximum size is 1MB]
python xmodem\xmodem_send.py --port=[your COM number] --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local\output_case1_sec_wlcsp\output.img # example: # python xmodem\xmodem_send.py --port=COM123 --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local\output_case1_sec_wlcsp\output.img
- It will start to burn firmware image automatically.
- Please press
reset
buttun onSeeed Grove Vision AI Module V2
. - It will success to run the algorithm.
-
Update the flash image
Seeed_SenseCraft_AI*.img
to Grove Vision AI Module V2 and pressreset
buttun. -
Disconnect the
Minicom
: -
Open the permissions to acceess the deivce
sudo setfacl -m u:[USERNAME]:rw /dev/ttyUSB0 # in my case # sudo setfacl -m u:kris:rw /dev/ttyACM0
-
After doing the above steps, you can run the SenseCraft AI on Grove Vision AI Module V2.
- Introduction : https://wiki.seeedstudio.com/grove_vision_ai_v2/
- Connect Grove Vision AI Module to NB USB port
- Open "Google Chrome" browser
- Open SenseCraft Homepage
- Select "Grove Vision AI(WE2)" and connect (serial port)
- Update the flash image
Seeed_SenseCraft AI*.img
to Grove Vision AI Module V2 and pressreset
buttun. - Disconnect the
TeraTerm
. - After doing the above steps, you can run the SenseCraft AI on Grove Vision AI Module V2.
- Introduction : https://wiki.seeedstudio.com/grove_vision_ai_v2/
- Install CH343 UART driver (CH343SER.ZIP) (Optional)
- Connect Grove Vision AI Module to NB USB port
- Open "Microsoft Edge" browser
- Open SenseCraft Homepage
- Select "Grove Vision AI(WE2)" and connect (serial port)
- Change the
APP_TYPE
totflm_fd_fm
at makefileAPP_TYPE = tflm_fd_fm
- Build the firmware reference the part of Build the firmware at Linux environment
- How to flash firmware image and model at model_zoo?
- Prerequisites for xmodem
- Please install the package at xmodem/requirements.txt
pip install -r xmodem/requirements.txt
- Please install the package at xmodem/requirements.txt
- Disconnect
Minicom
- Make sure your
Seeed Grove Vision AI Module V2
is connect to PC. - Open the permissions to acceess the deivce
sudo setfacl -m u:[USERNAME]:rw /dev/ttyUSB0 # in my case # sudo setfacl -m u:kris:rw /dev/ttyACM0
- Open
Terminal
and key-in following command- port: the COM number of your
Seeed Grove Vision AI Module V2
, for example,/dev/ttyACM0
- baudrate: 921600
- file: your firmware image [maximum size is 1MB]
- model: you can burn multiple models "[model tflite] [position of model on flash] [offset]"
- Position of model on flash is defined at ~/tflm_fd_fm/common_config.h
python3 xmodem/xmodem_send.py --port=[your COM number] --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local/output_case1_sec_wlcsp/output.img --model="model_zoo/tflm_fd_fm/0_fd_0x200000.tflite 0x200000 0x00000" --model="model_zoo/tflm_fd_fm/1_fm_0x280000.tflite 0x280000 0x00000" --model="model_zoo/tflm_fd_fm/2_il_0x32A000.tflite 0x32A000 0x00000" # example: # python3 xmodem/xmodem_send.py --port=/dev/ttyACM0 --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local/output_case1_sec_wlcsp/output.img --model="model_zoo/tflm_fd_fm/0_fd_0x200000.tflite 0x200000 0x00000" --model="model_zoo/tflm_fd_fm/1_fm_0x280000.tflite 0x280000 0x00000" --model="model_zoo/tflm_fd_fm/2_il_0x32A000.tflite 0x32A000 0x00000"
- Position of model on flash is defined at ~/tflm_fd_fm/common_config.h
- It will start to burn firmware image and model automatically.
- port: the COM number of your
- Please press
reset
buttun onSeeed Grove Vision AI Module V2
. - It will success to run the algorithm.
- Prerequisites for xmodem
- Change the
APP_TYPE
totflm_fd_fm
at makefileAPP_TYPE = tflm_fd_fm
- Build the firmware reference the part of Build the firmware at Windows environment
- How to flash firmware image and model at model_zoo?
- Prerequisites for xmodem
- Please install the package at xmodem/requirements.txt
pip install -r xmodem/requirements.txt
- Please install the package at xmodem/requirements.txt
- Disconnect
Tera Term
- Make sure your
Seeed Grove Vision AI Module V2
is connect to PC. - Open
CMD
and key-in following command- port: the COM number of your
Seeed Grove Vision AI Module V2
- baudrate: 921600
- file: your firmware image [maximum size is 1MB]
- model: you can burn multiple models "[model tflite] [position of model on flash] [offset]"
- Position of model on flash is defined at ~/tflm_fd_fm/common_config.h
python xmodem\xmodem_send.py --port=[your COM number] --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local\output_case1_sec_wlcsp\output.img --model="model_zoo\tflm_fd_fm\0_fd_0x200000.tflite 0x200000 0x00000" --model="model_zoo\tflm_fd_fm\1_fm_0x280000.tflite 0x280000 0x00000" --model="model_zoo\tflm_fd_fm\2_il_0x32A000.tflite 0x32A000 0x00000" # example: # python xmodem\xmodem_send.py --port=COM123 --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local\output_case1_sec_wlcsp\output.img --model="model_zoo\tflm_fd_fm\0_fd_0x200000.tflite 0x200000 0x00000" --model="model_zoo\tflm_fd_fm\1_fm_0x280000.tflite 0x280000 0x00000" --model="model_zoo\tflm_fd_fm\2_il_0x32A000.tflite 0x32A000 0x00000"
- Position of model on flash is defined at ~/tflm_fd_fm/common_config.h
- It will start to burn firmware image and model automatically.
- port: the COM number of your
- Please press
reset
buttun onSeeed Grove Vision AI Module V2
. - It will success to run the algorithm.
- Prerequisites for xmodem
- Disconnect the uart at your
Tera Term
orMinicom
first. - You can use the Himax AI web toolkit which we provide, download it and unzip it to local PC, and double click
index.html
. - Please check you select
Grove Vision AI(V2)
and pressconnect
button - Select your own COM.
- You will see the preview result on website.
- Tip
- Windows:
- Please use "Microsoft Edge" browser
- Linux:
- Open the permissions to acceess the deivce
sudo setfacl -m u:[USERNAME]:rw /dev/ttyUSB0 # in my case # sudo setfacl -m u:kris:rw /dev/ttyACM0
- Please use "Google Chrome" browser
- Open the permissions to acceess the deivce
- Windows:
You can reference the scenario app allon_sensor_tflm , allon_sensor_tflm_freertos and tflm_fd_fm. Take allon_sensor_tflm for example, you should only modify the allon_sensor_tflm.mk from cis_ov5647 to cis_imx219 or cis_imx477.
#CIS_SUPPORT_INAPP_MODEL = cis_ov5647
CIS_SUPPORT_INAPP_MODEL = cis_imx219
#CIS_SUPPORT_INAPP_MODEL = cis_imx477
So that, it can support cis_imx219 or cis_imx477 camera.
- Modify the setting at the makefile
- Enable the flag
LIB_CMSIS_NN_ENALBE
to build CMSIS-NN libraryLIB_CMSIS_NN_ENALBE = 1
- You can reference the scenario app example about allon_sensor_tflm_cmsis_nn which is the example running the model without passing vela and using the CMSIS-NN library.
- Change the
APP_TYPE
toallon_sensor_tflm_cmsis_nn
at the makefileAPP_TYPE = allon_sensor_tflm_cmsis_nn
- Change the
- Enable the flag