# Progress [TOC] ## Cortex-M55 for CMSIS-NN [ref](https://github.com/HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2/blob/main/README.md) ![image](https://hackmd.io/_uploads/SJTxjHqpke.png) - Environment setup 1. Arm GNU toolchain ```bash= 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 tar -xvf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz export PATH="$HOME/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/:$PATH" ``` 2. Clone Himax repo ```bash= git clone --recursive https://github.com/HimaxWiseEyePlus/Seeed_Grove_Vision_AI_Module_V2.git cd Seeed_Grove_Vision_AI_Module_V2 ``` 3. Package for flashing the firmware ```bash= pip install -r xmodem/requirements.txt # create virtual environment first sudo apt-get install minicom ``` - Build the firmware 1. change directory to EPII_CM55M_APP_S ```bash= cd EPII_CM55M_APP_S ``` 2. Modify the setting in `./makefile` to run the model without passing vela and using the CMSIS-NN library. ```Makefile= LIB_CMSIS_NN_ENALBE = 1 # APP_TYPE = allon_sensor_tflm APP_TYPE = allon_sensor_tflm_cmsis_nn ``` 3. create `./fast_build.sh` and compile the firmware to image file with it ```bash= #!/bin/bash # we2_build.sh # 簡易範例:移動目錄、複製檔案、並執行產生工具 make clean || { echo "make clean 失敗" exit 1 } # 0.1 make -j8 make -j8 || { echo "make -j8 失敗" exit 1 } # 1. 進入 we2_image_gen_local 目錄 cd ../we2_image_gen_local/ || { echo "切換目錄失敗,請確認路徑是否正確" exit 1 } # 2. 複製 EPII_CM55M_gnu_epii_evb_WLCSP65_s.elf 到 input_case1_secboot/ 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/ || { echo "複製檔案失敗,請確認路徑及檔名是否正確" exit 1 } # 3. 執行 we2_local_image_gen ./we2_local_image_gen project_case1_blp_wlcsp.json || { echo "we2_local_image_gen 執行失敗" exit 1 } echo "=== 指令全部執行完成 ===" ``` - Flash the firmware 1. Connect the board 2. open the permission & Setup minicom ```bash= # sudo setfacl -m u:vic:rw /dev/ttyACM0 sudo setfacl -m u:${YOUR_USERNAME}:rw ${YOUR_COM_PORT} sudo minicom -s ``` ![image](https://hackmd.io/_uploads/rylfbL5Tyg.png) 3. run python script to flash image ```bash= cd .. python xmodem/xmodem_send.py --port=/dev/ttyACM0 --baudrate=921600 --protocol=xmodem --file=we2_image_gen_local/output_case1_sec_wlcsp/output.img ``` 4. press reset button on board