不過說除了用 Arduino IDE 之外,也可以用 Standard SDK.
然後就是說參考: 就 follow Project README: clone , untar tools, export PATH.
然後就可以開始 build example 了。
因為 build 最後的 tool 有分 linux 版的 *.linux 和 windows 版的 *.exe。
這個 repo 的 linux file attibute 沒有設定對,build 的時候會出現 Error。
所以先去把所有的 *.linux 加上 execution.
開始 build..
cd ambpro2_sdk/project/realtek_amebapro2_v0_example/GCC-RELEASE/build/ cmake .. -G"Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DVIDEO_EXAMPLE=ON cmake --build . --target flash_nn -j4build 完,會是剛剛 --target 寫的 flash_nn.bin
燒錄是 tools/Pro2_PG_tool,把 zip 解開。把剛剛build 好的 flash_nn.bin copy 過來。
和用 Arduino IDE 一樣, HUB 8735 進入 download mode:
- 短路 A5, 3V3 pin
- 按一下 reset buuton
README 的說明 -b 2000000,會出現 ucf fail,看 ./uartfwburn.linux --help, -b 是 baudrate 的意思。
所以改成 9612000 後成功:
~/ambpro2_sdk/tools/Pro2_PG_tool _v1.3.0$ ./uartfwburn.linux -p /dev/ttyUSB0 -f flash_ntz.nn.bin -b 921600 -U /dev/ttyUSB0 opened ping ok ucfg ok Uart boot programing [========================================] 100% 77824/ 77824 bytes programing done. uboot ok reset device /dev/ttyUSB0 opened ping ok ucfg ok download to offset 0x0 masked area [0x0, 0x0] dowload 0, [0x0, 0xd9e000] fw_len = 0xd9e000 programing [========================================] 100% 14286848/ 14286848 bytes programing done. done for download 0 download success然後把 A5. 3V3 短路 pin 解開。reset
用 uart 115200 看到開機 log:
== Rtl8735b IoT Platform == [Normal mode] BootFromNORFlash [Start Boot ROM...] === Load PARTBL === === Load Done === === Load ISP_IQ === [fcs chk pass] ISP_IQ @ 0x8401080, 0x2cf80, 0x0 mfcs_data version 0x00010001 fcs_data version 0x00010101 === Process ISP_IQ === === Load Done === === Load BL === [Image Start Table @ 0x18200] === Load Done === == Boot Loader == Jul 12 2023:11:11:05 === Load FCS Para === === Load Done === [crc pass] === Load ISP_IQ Sensor === ISP_IQ @ 0x8401080, 0x2cf80 === Process ISP_IQ === === Load Done === === Load FW1 === FW_ISP_IQ @ 0x8081080, 0x2ef80 === Process FW_ISP_IQ === DRAM_TYPE is DDR2 128MB. ddr_freq = 533 VOE flash @ 0x80b0080, 0x7ef80 FCS KM_status 0x00002081 err 0x0000200a Wait KM fcs done 0 us FCS TM_status 0x003f0000 store fcs data for application RAM TM_STATUS 0x00bf0000 status 0x00000080 RAM TM_STATUS 0x00bf1208 err 0x00001208 read fcs_status 0x000000bf read fcs_status 0x000000bf == Process VOE IMG === [Image Start Table @ 0x20106200] RAM Load @ 0x812f100->0x20106200, 0x6a58 DDR Load @ 0x8136080->0x70100000, 0x19f574 === FW Load Done === Boot Loader <== == RAM Start == Build @ 15:20:47, Sep 13 2023 $8735b>interface 0 is initialized interface 1 is initialized cfg_size_lib = 29, cfg_size_user = 29 Initializing WIFI ...[Driver]: [HALMAC] 11692M HALMAC_MAJOR_VER = 1 HALMAC_PROTOTYPE_VER = 4 HALMAC_MINOR_VER = 20 HALMAC_PATCH_VER = [Driver]: The driver include MP [Driver]: Ver = libwlan:2023.07.21.14.18_b9.5_a20c848742482c5f0ee2b39dd14c0c200435e46b - download_firmware_88xx HALMAC_RET_SUCCESS RFE type = 0 start_addr=(0x4000), end_addr=(0x8000), buffer_size=(0x4000), smp_number_max=(2048) WIFI initialized [FAST_CONNECT] Fast connect profile is empty, abort fast connection init_thread(49), Available heap 0x6b847e0 use ATW0, ATW1, ATWC to make wifi connection wait for wifi connection... #最後的 # 是按下 Enter 後出現的 prompt,因為 README 說要下命令 config wifi..
ATW0=<WiFi_SSID> : Set the WiFi AP to be connected ATW1=<WiFi_Password> : Set the WiFi AP password ATWC : Initiate the connection下完之後,開始 scan , connect...
Interface 0 IP address : 172.24.1.117 init_thread(49), Available heap 0x6b82200 [video_voe_presetting] fps:30 w:1920 h:1080 voe heap size = 13455104 fwin(1),enc_en(0),IQ_OFFSET = 0x16520 fwin(1),enc_en(0),SENSOR_OFFSET = 0x2e560 sensor id 1 iq_data 16520 sensor_data 2e560 hal_voe_ready 0x0 0xbf1208 read fcs_status 0x000000bf [video_init] uvcd iq is null, use default. [video_init] uvcd SNR is null, use default. IQ:FW size (98342) sensor:date 2023/7/18 version:RTL8735B_VOE_1.4.4.0 sensor:FW size (1812) sensor timestamp: 2023/07/18 iq timestamp: 2023/05/15 14:48:54 ISP:1 ENC:1 H265:1 NN:1 hal_voe_ready 0x0 0xbf1208 voe :RTL8735B_VOE_1.4.4.0 sensor:RTL8735B_VOE_1.4.4.0 hal :RTL8735B_VOE_1.4.4.0 load time sensor:52us iq:2722us itcm:0us dtcm:0us ddr:0us ddr2:0us RTSP[0] port: 554 fwin(1),enc_en(0),IQ_OFFSET = 0x16520 connect successful sta mode fwin(1),enc_en(0),SENSOR_OFFSET = 0x2e560 sensor id 1 iq_data 16520 sensor_data 2e560 hal_voe_ready 0x0 0x1718 npu[7045d6e0] gck vip_drv_init, video memory heap base: 0x77000000, size: 0x01000000 NN IRQ default priority : 0, set to 9 npu[7045d6e0] HASHMAP 0x0x703fa994(process ID) INIT SUCCESS npu[7045d6e0] HASHMAP 0x0x703fb6a0(memory wrap) INIT SUCCESS npu[7045d6e0] HASHMAP 0x0x703fc2ec(network information) INIT SUCCESS npu[7045d6e0] HASHMAP 0x0x703fcf10(segment information) INIT SUCCESS VIPLite Drv version 10c00 set yolo confidence thresh to 0.500000 set yolo NMS thresh to 0.300000 Deploy YOLOv4t ...開啟 vlc 連到 rtsp://172.24.1.117:554,就可以看到 yolov4 objection detection 的輸出。
沒有留言:
張貼留言