====== 双MAX9296-GMSL2摄像头接入扩展板 ====== ===== 主要特征 ===== * 适配TI-TDA系列板卡(下列板卡已测试:tda4vm evaluation kit(EVM), tda4vm-starter-kit(SK)); * 接入最多4通道摄像头(MAX9296, 2通道*2) * 使用GPIO进行电源控制,可控制每一通道摄像头供电 * 预留多相机同步触发接口,最多可实现4路像机同步触发。 * 提供部分摄像头驱动参考 ===== 发货清单 ===== * 扩展板,数量1 * 固定螺丝, 若干, (SK版:直径2.5,长度5mm; EVM版:直径2.5mm,长度11cm) ===== 总体结构 ===== {{ :扩展卡:dual_max9296_struct.png?400 |}} (随版本更新,上图会略有差异, 请以板上丝印为准) ==== 基本参数 ==== * GMSL接口通道数, 4max * 供电电压, 5-20V, USB-c, 推荐使用45W以上笔记本电源 * GMSL摄像头 POC供电电压 8.8 - 9V, 1.5A * 支持多摄头的内同步,外同步 * 支持GMSL状态指示 ===== 安装与连接 ===== **注意,必须使用合适的支撑柱及螺丝进行安装,否则可能影响稳定性** ==== SK板安装 ==== 如图所示, 扩展板与主板之间使用3颗直径2.5mm, 高5mm 的铜柱支撑。 {{ :扩展卡:dual9296_sk_stack_v5.png?direct&600 |}} {{ :扩展卡:dual9296_sk_stack_v5_1.png?direct&600 |}} ==== EVM板安装 ==== 如图所示, 扩展板与主板之间使用3颗直径2.5mm, 高11mm 的铜柱支撑。 {{ :扩展卡:dual9296_evm_stack_v4-3.png?direct&600 |}} {{ :扩展卡:dual9296_evm_stack_v4-4.png?direct&600 |}} ==== 连接电源 ==== 必须使用主板官方指定的电源, 并保证足够的功率, 否则运行过程中可能会非预期重启。 ==== 连接GMSL相机 ==== * 确认相机POC电源与扩展板是否匹配 * 如不需要节电及使用GPIO电源控制,可安装强制供电跳线。 > 还没有GMSL相机?可以试试揖越的GMSL视频输入设备:[[摄像头及视频源:gmsl2摄像头]] ===== 快速上手 ===== #: 步骤一:连接硬件 请参数上述步骤连接主板与扩展卡。必须保持二者的连接可靠。不可靠连接可能导致工作不正常甚至损坏硬件。 {{ :扩展卡:微信图片_20230226222957.jpg?direct&600 |}} :# #: 步骤二: 连接相机 附带的SD卡,预设置了一些出厂适配完成的摄像头/视频源,分别为: * 森云 IMX390 * HDMI转GMSL2 视频注入 (本公司产品) {{ :扩展卡:微信图片_20230226222909.jpg?direct&600 |}} 其它测试使用相机,可以参考[] **请注意相机电压与扩展板供电电压是否匹配** :# #: 步骤三: 主板配置 插入附带的SD卡。目前仅提供SK板的测试用SD卡。此卡官方SK板镜像相比,做了如下修改: * 显示改为由R5控制 * 视频输入使用RTOS,OPENVX框架,由R5控制 * 神经网络运行,openvx框架, OSRT支持受限 连接显示器、网线, 串口线。使用HDMI连接显示器 (默认使用HDMI显示),网线主要用于调试。 :# #: 步骤四: 上电 插上供电口USB (sk板),确认扩展板指示灯显示正常。需要注意: * Type-C USB的供电功率是否充足,推荐使用笔记本电源 * 摄像头GMSL的POC电源跳线是否接上 (各个Channel的供电由GPIO控制,可不用跳线) :# #: 步骤五: 运行测试程序 上电进入terminal,需运行以下脚本,建立工作环境。 cd /opt/vision_apps source ./vision_apps_init.sh ./run_app_single_cam.sh **注意,注意,如果摄像头连接的是CH1,需要运行针对CSIRX2_1编译的程序。** ./run_app_single_cam_ch1.sh 正常运行时的log [采购后可查看] root@j7-evm:/opt/vision_apps# ./run_app_single_cam.sh APP: Init ... !!! MEM: Init ... !!! MEM: Initialized DMA HEAP (fd=4) !!! MEM: Init ... Done !!! IPC: Init ... !!! IPC: Init ... Done !!! REMOTE_SERVICE: Init ... !!! REMOTE_SERVICE: Init ... Done !!! 535.601103 s: GTC Frequency = 200 MHz APP: Init ... Done !!! 535.601221 s: VX_ZONE_INIT:Enabled 535.601231 s: VX_ZONE_ERROR:Enabled 535.601243 s: VX_ZONE_WARNING:Enabled 535.601917 s: VX_ZONE_INIT:[tivxInitLocal:130] Initialization Done !!! 535.602127 s: VX_ZONE_INIT:[tivxHostInitLocal:86] Initialization Done for HOST !!! sensor_selection = [0] ldc_enable = [0] num_frames_to_run = [1000000000] is_interactive = [1] IttCtrl_registerHandler: command echo registered at location 0 IttCtrl_registerHandler: command iss_read_2a_params registered at location 1 IttCtrl_registerHandler: command iss_write_2a_params registered at location 2 IttCtrl_registerHandler: command iss_raw_save registered at location 3 IttCtrl_registerHandler: command iss_yuv_save registered at location 4 IttCtrl_registerHandler: command iss_read_sensor_reg registered at location 5 IttCtrl_registerHandler: command iss_write_sensor_reg registered at location 6 IttCtrl_registerHandler: command dev_ctrl registered at location 7 IttCtrl_registerHandler: command iss_send_dcc_file registered at location 8 NETWORK: Opened at IP Addr = 192.168.123.158, socket port=5000!!! 535.606638 s: ISS: Enumerating sensors ... !!! 535.607496 s: ISS: Enumerating sensors ... found 0 : ON_AR0231_9296_96705_1K_CH0 535.607506 s: ISS: Enumerating sensors ... found 1 : S_IMX390_9296_9295_2K_CH1 535.607514 s: ISS: Enumerating sensors ... found 2 : S_OX01_9296_96705_1K_S_CH1 535.607521 s: ISS: Enumerating sensors ... found 3 : S_OX08_9296_9295_4K_CH0 535.607527 s: ISS: Enumerating sensors ... found 4 : XREAL_0231_9296_9295_2K_CH0 535.607533 s: ISS: Enumerating sensors ... found 5 : XREAL_LT6911_HDMI_4K 535.607539 s: ISS: Enumerating sensors ... found 6 : XREAL_LT6911_HDMI_3K 535.607546 s: ISS: Enumerating sensors ... found 7 : XREAL_LT6911_9296_9295_4K_CH0 535.607552 s: ISS: Enumerating sensors ... found 8 : XREAL_LT6911_9296_9295_2K_CH0 Select camera port index 0-7 : [MCU2_0] 535.606849 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_CREATE [MCU2_0] 535.606969 s: set I2C mux to config serdes and camera. 0 9 registered sensor drivers a : ON_AR0231_9296_96705_1K_CH0 b : S_IMX390_9296_9295_2K_CH1 c : S_OX01_9296_96705_1K_S_CH1 d : S_OX08_9296_9295_4K_CH0 e : XREAL_0231_9296_9295_2K_CH0 f : XREAL_LT6911_HDMI_4K g : XREAL_LT6911_HDMI_3K h : XREAL_LT6911_9296_9295_4K_CH0 i : XREAL_LT6911_9296_9295_2K_CH0 Select a sensor above or press '0' to autodetect the sensor : Invalid selection . Try again 9 registered sensor drivers a : ON_AR0231_9296_96705_1K_CH0 b : S_IMX390_9296_9295_2K_CH1 c : S_OX01_9296_96705_1K_S_CH1 d : S_OX08_9296_9295_4K_CH0 e : XREAL_0231_9296_9295_2K_CH0 f : XREAL_LT6911_HDMI_4K g : XREAL_LT6911_HDMI_3K h : XREAL_LT6911_9296_9295_4K_CH0 i : XREAL_LT6911_9296_9295_2K_CH0 Select a sensor above or press '0' to autodetect the sensor : c Sensor selected : S_OX01_9296_96705_1K_S_CH1 LDC Selection Yes(1)/No(0) : LDC Selection Yes(1)/No(0) : 0 Querying S_OX01_9296_96705_1K_S_CH1 540.507882 s: ISS: Querying sensor [S_OX01_9296_96705_1K_S_CH1] ... !!! 540.508334 s: ISS: Querying sensor [S_OX01_9296_96705_1K_S_CH1] ... Done !!! YUV Input selected. VISS and AEWB nodes will be bypassed. 540.508352 s: ISS: Initializing sensor [S_OX01_9296_96705_1K_S_CH1], doing IM_SENSOR_CMD_PWRON ... !!! 540.508796 s: ISS: Initializing sensor [S_OX01_9296_96705_1K_S_CH1], doing IM_SENSOR_CMD_CONFIG ... !!! [MCU2_0] 540.508085 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_QUERY [MCU2_0] 540.508146 s: Received Query for S_OX01_9296_96705_1K_S_CH1 [MCU2_0] 540.508540 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_PWRON [MCU2_0] 540.508592 s: IM_SENSOR_CMD_PWRON : channel_mask = 0x1 [MCU2_0] 540.508637 s: OV10640s_PowerOn : chMask = 0x0 [MCU2_0] 540.508969 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_CONFIG [MCU2_0] 540.509020 s: Application requested features = 0x0 [MCU2_0] [MCU2_0] 540.509061 s: Configuring camera # 0 [MCU2_0] 540.509096 s: [MCU2_0] reset max9296 [MCU2_0] 540.608392 s: [MCU2_0] power off all cameras. [MCU2_0] 540.608438 s: [MCU2_0] Turn on surround view cameras, channel 0. [MCU2_0] 541.108387 s: [MCU2_0] turn off output serializer. [MCU2_0] 541.108432 s: Config de-serial. [MCU2_0] 541.108465 s: i2c write: Ins:3, dev:0x48, reg:0x313, val:0x0 [MCU2_0] 541.113392 s: [MCU2_0] 541.113424 s: config serializer. [MCU2_0] 541.113455 s: i2c write: Ins:3, dev:0x40, reg:0x4d, val:0xc0 [MCU2_0] 541.163879 s: Reg: 0x4d: val: 0xc0 [MCU2_0] 541.164876 s: Reg: 0x 0: val: 0x80 [MCU2_0] 541.165877 s: Reg: 0x 1: val: 0x90 [MCU2_0] 541.166391 s: i2c write: Ins:3, dev:0x40, reg:0x4, val:0x43 [MCU2_0] 541.216389 s: i2c write: Ins:3, dev:0x40, reg:0x6, val:0xab [MCU2_0] 541.266390 s: i2c write: Ins:3, dev:0x40, reg:0x34, val:0xae [MCU2_0] 541.316389 s: i2c write: Ins:3, dev:0x40, reg:0xc, val:0x80 [MCU2_0] 541.366390 s: i2c write: Ins:3, dev:0x40, reg:0x1, val:0x94 [MCU2_0] 541.416389 s: i2c write: Ins:3, dev:0x40, reg:0xb, val:0x8a [MCU2_0] 541.466390 s: i2c write: Ins:3, dev:0x40, reg:0x7, val:0x84 [MCU2_0] 541.516390 s: i2c write: Ins:3, dev:0x40, reg:0xf, val:0xbf [MCU2_0] 541.566388 s: i2c write: Ins:3, dev:0x40, reg:0x67, val:0xc4 [MCU2_0] 541.616389 s: i2c write: Ins:3, dev:0x40, reg:0x43, val:0x25 [MCU2_0] 541.666390 s: i2c write: Ins:3, dev:0x40, reg:0x48, val:0x2d [MCU2_0] 541.716388 s: i2c write: Ins:3, dev:0x40, reg:0x49, val:0x98 [MCU2_0] 541.766389 s: i2c write: Ins:3, dev:0x40, reg:0x4, val:0x83 [MCU2_0] 542.049338 s: set I2C mux to config serdes and camera. [MCU2_0] 542.050296 s: Reg: 0x 4: val: 0x83 [MCU2_0] 542.050927 s: Reg: 0x48: val: 0x2d [MCU2_0] 542.051920 s: Reg: 0x49: val: 0x98 [MCU2_0] 542.252391 s: Config de-serial. [MCU2_0] 542.252433 s: i2c write: Ins:3, dev:0x48, reg:0xb06, val:0x87 [MCU2_0] 542.257388 s: i2c write: Ins:3, dev:0x48, reg:0xc06, val:0x87 [MCU2_0] 542.295387 s: i2c write: Ins:3, dev:0x48, reg:0xb07, val:0x84 [MCU2_0] 542.300388 s: i2c write: Ins:3, dev:0x48, reg:0xc07, val:0x84 [MCU2_0] 542.305386 s: i2c write: Ins:3, dev:0x48, reg:0x11, val:0xf [MCU2_0] 542.310387 s: i2c write: Ins:3, dev:0x48, reg:0x6, val:0x1f [MCU2_0] 542.315388 s: i2c write: Ins:3, dev:0x48, reg:0xb0d, val:0x80 [MCU2_0] 542.320388 s: i2c write: Ins:3, dev:0x48, reg:0xc0d, val:0x80 [MCU2_0] 542.325386 s: i2c write: Ins:3, dev:0x48, reg:0x322, val:0x30 [MCU2_0] 542.330388 s: i2c write: Ins:3, dev:0x48, reg:0xf00, val:0x1 [MCU2_0] 542.335389 s: i2c write: Ins:3, dev:0x48, reg:0x40b, val:0x7 [MCU2_0] 542.340386 s: i2c write: Ins:3, dev:0x48, reg:0x42d, val:0x15 [MCU2_0] 542.345387 s: i2c write: Ins:3, dev:0x48, reg:0x40d, val:0x1e [MCU2_0] 542.350387 s: i2c write: Ins:3, dev:0x48, reg:0x40e, val:0x1e [MCU2_0] 542.355387 s: i2c write: Ins:3, dev:0x48, reg:0x40f, val:0x0 [MCU2_0] 542.360385 s: i2c write: Ins:3, dev:0x48, reg:0x410, val:0x0 [MCU2_0] 542.365388 s: i2c write: Ins:3, dev:0x48, reg:0x411, val:0x1 [MCU2_0] 542.370387 s: i2c write: Ins:3, dev:0x48, reg:0x412, val:0x1 [MCU2_0] 542.375387 s: i2c write: Ins:3, dev:0x48, reg:0x330, val:0x4 [MCU2_0] 542.380387 s: i2c write: Ins:3, dev:0x48, reg:0x44a, val:0xd0 [MCU2_0] 542.385387 s: i2c write: Ins:3, dev:0x48, reg:0x320, val:0x24 [MCU2_0] 542.390387 s: i2c write: Ins:3, dev:0x48, reg:0x325, val:0x80 [MCU2_0] 542.395386 s: i2c write: Ins:3, dev:0x48, reg:0x319, val:0x8 [MCU2_0] 542.400388 s: i2c write: Ins:3, dev:0x48, reg:0x316, val:0x5e [MCU2_0] 542.405387 s: i2c write: Ins:3, dev:0x48, reg:0x317, val:0xe [MCU2_0] 542.410386 s: i2c write: Ins:3, dev:0x48, reg:0x31d, val:0xc0 [MCU2_0] 542.415388 s: i2c write: Ins:3, dev:0x48, reg:0x1da, val:0x18 [MCU2_0] 542.420388 s: i2c write: Ins:3, dev:0x48, reg:0x1fa, val:0x18 [MCU2_0] 542.425387 s: i2c write: Ins:3, dev:0x48, reg:0xb0f, val:0x8 [MCU2_0] 542.430387 s: i2c write: Ins:3, dev:0x48, reg:0xc0f, val:0x8 542.635601 s: ISS: Initializing sensor [S_OX01_9296_96705_1K_S_CH1] ... Done !!! [MCU2_0] 542.635387 s: IM_SENSOR_CMD_CONFIG returning status = 0 Scaler is disabled 542.643076 s: ISS: Starting sensor [S_OX01_9296_96705_1K_S_CH1] ... !!! ========================== Demo : Single Camera w/ 2A ========================== p: Print performance statistics s: Save Sensor RAW, VISS Output and H3A output images to File System e: Export performance statistics u: Update DCC from File System x: Exit Enter Choice: Unsupported command ========================== Demo : Single Camera w/ 2A ========================== p: Print performance statistics s: Save Sensor RAW, VISS Output and H3A output images to File System e: Export performance statistics u: Update DCC from File System x: Exit Enter Choice: [MCU2_0] 542.643377 s: ImageSensor_RemoteServiceHandler: IM_SENSOR_CMD_STREAM_ON [MCU2_0] 542.643464 s: IM_SENSOR_CMD_STREAM_ON: channel_mask = 0x1 [MCU2_0] 542.643514 s: start streaming [MCU2_0] 542.643543 s: i2c write: Ins:3, dev:0x48, reg:0x313, val:0x42 [MCU2_0] 542.844203 s: Reg: 0x313: val: 0x42 [MCU2_0] 542.894188 s: Reg: 0x1dc: val: 0x 0 [MCU2_0] 542.944185 s: Reg: 0x1fc: val: 0x 1 [MCU2_0] 542.994182 s: Reg: 0x21c: val: 0x 0 [MCU2_0] 543.044186 s: Reg: 0x23c: val: 0x 0 [MCU2_0] 543.094181 s: Reg: 0x3e0: val: 0x e [MCU2_0] 543.194182 s: Reg: 0x127: val: 0x40 543.293582 s: ISS: Starting sensor [S_OX01_9296_96705_1K_S_CH1] ... !!! :# ===== 其它注意事项 ===== ==== 软件开发环境建立 ==== === 使用EVM板 === 可以直接使用,具体使用方法,请参考官方文档。 === 使用SK板 === 需要对SDK进行一些修改,请参考文档 [[TDA4VM-SK-GMSL:利用Starter-Kit开发板开发RTOS应用]] ==== 解串的地址 ==== MAX9296的默认地址 ** CH0: 0x48 ** CH1: 0x4a ==== 默认工作模式及修改 ==== === 默认工作模式 === CH0, CH1的MAX9296的默认工作模式均为:GMSL2, 6Gbps. === 通过硬件跳线修改默认工作模式 === Max9296 支持GMSL1/GMSL2, 3G/6G, coax/stp, i2c/uart 等在上电时通过分压电阻进行配置。这些配置不建议修改,但如需修改,推荐使用I2C修改寄存器的方式修改。如果确需要修改硬件,参考下图: {{ :扩展卡:whiteboard_exported_image_3_.png?direct&600 |}} 电阻的选择请参考 美信 数据手册。 === 通过软件I2C配置工作模式 === 使用I2C修改GMSL模式,参考如下代码,可以在不变更硬件的情况下,在GMSL1/GMSL2模式下切换。 具体操作,请参考:[[GMSL相关文章:软件修改MAX9296的模式及速率]] 。 ==== 配置帧同步信号 ==== 使用多个摄像头需要进行同步。当MAX9296工作于GMSL1,或GMSL2模式时,其同步配置是不同的。 具体的操作及配置,请参考:[[GMSL相关文章:MAX9296的多相机FSYNC配置]].