跳到主要内容

GMSL2 摄像头中继器快速入门

概述

GMSL2 中继器由深圳市森云智能科技有限公司设计,可实现一路 GMSL2 输入和一路 GMSL2 输出,用于延长传输距离。

关键特性
  • 无损数据传输
  • 完整兼容 GMSL/GMSL2
  • 超低延迟(微秒级)
  • 极低插入损耗
GMSL2_摄像头_Repeater

技术规格

参数
传输协议GMSL / GMSL2
输入端口1
输出端口1
输入接口1× GMSL2
输出接口1× GMSL2
支持的数据速率1.5Gbps, 3Gbps, 6Gbps
最大分辨率最高 3840×2160
输出同步精度< 10μs
电源
连接器Fakra Z 型
工作温度范围-40°C 至 +85°C
尺寸87.5mm × 70.6mm × 20mm
颜色黑色
重量< 150g

尺寸

GMSL2_摄像头_Repeater 尺寸

硬件概述

框图

GMSL2_摄像头_Repeater 框图

I2C 地址信息

设备I2C 地址(8-bit)
1中继器:ECU0x80
2中继器:摄像头0x94
3SENSING 摄像头0x70

连接器引脚定义

GMSL2_摄像头_Repeater 连接器
连接器 组件料号制造商/备注
中继器设备连接器50352-0400Molex
线束 连接器50351-0400Molex
电源Pin3, Pin49~12V DC
Pin1, Pin2公共地

线束定义

GMSL2_摄像头_Splitter 线束

产品型号

产品型号输入通道输出通道分辨率支持处理器数据传输速率
SG2-BP0101-GMSL1CH1CH最高 1920×1080@30fpsMAX967051.5Gbps
SG8-BP0101-GMSL21CH1CH最高 3840×2160@30fpsMAX9295A6Gbps

快速入门

1. GMSL2 摄像头中继器与客户自研平台集成

连接不同域控制器时使用中继器:

中继器框图

中继器框图 - 连接域控制器的配置

操作步骤

  1. 按上图连接系统。
  2. 先给中继器上电。
  3. 初始化控制器,控制器会上电并初始化 Repeater-ECU。
  4. 由控制器执行正常操作命令以启动摄像头。

运行逻辑

  1. 中继器上电后会自动配置已连接摄像头。
  2. 域控制器只需像配置摄像头一样配置中继器,然后正常触发即可激活成像链路。
提示

可参考以下软件流程和示例代码开发自定义驱动实现。

2. 控制器软件开发示例代码

  1. 驱动开发:
/* Example code for MAX9296 I2C initialization */
#define MAX9296_I2C_ADDR 0x90 // 8-bit address

int max9296_init() {
// Initialize I2C bus
i2c_init();

// Disable MIPI output during configuration
i2c_write(MAX9296_I2C_ADDR, 0x0313, 0x00);
delay_ms(100);
// Configure link settings for GMSL2 (6Gbps)
i2c_write(MAX9296_I2C_ADDR, 0x0001, 0x02);

// Configure linkA and linkB settings for GMSL2 selection (default value)
i2c_write(MAX9296_I2C_ADDR, 0x0006, 0xC0);

// Configure MIPI rate to 1200Mbps
i2c_write(MAX9296_I2C_ADDR, 0x0320, 0x2C);

// Enable MIPI output
i2c_write(MAX9296_I2C_ADDR, 0x0313, 0x02);

return 0;
}
  1. 中继器配置:
/* Example code for Repeater initialization */

#define MAX9295A_I2C_ADDR 0x80 // 8-bit address

int Splitter_init() {
// Initialize deserializer first
max9296_init();

// Reset ISP
i2c_write(MAX9295A_I2C_ADDR, 0x02BE, 0x10); // MFP0 high

// Configure essential registers
i2c_write(MAX9295A_I2C_ADDR, 0x0057, 0x12);
i2c_write(MAX9295A_I2C_ADDR, 0x005B, 0x11);

// Configure datatype to YUV422 8bit
i2c_write(MAX9295A_I2C_ADDR, 0x0318, 0x5E);

// Camera trigger sequence: MFP7 low to high
i2c_write(MAX9295A_I2C_ADDR, 0x02D3, 0x00); // MFP7 low
delay_ms(300);
i2c_write(MAX9295A_I2C_ADDR, 0x02D3, 0x10); // MFP7 high

// Initialize sensor,if without ISP, skip this step
sensor_init();

return 0;
}

int sensor_init() {
// Initialize sensor
i2c_write(sensor_I2C_ADDR, 0x0102, 0x0001);
// Additional sensor initialization parameters
// (Refer to Camera Information documentation for the complete sensor register configuration)
}

集成步骤

  1. BSP 集成:

    • 修改设备树以加入 GMSL2 接口配置
    • 将摄像头驱动加入内核构建配置
    • 配置摄像头的 media controller pipeline
    • 配置 Repeater-ECU
  2. 应用开发:

/* Example code for capturing camera frames */
#include "camera_api.h"

int main() {
// Open camera device
int fd = open("/dev/video0", O_RDWR);
if (fd < 0) {
perror("Failed to open camera device");
return -1;
}

// Configure video capture format
struct v4l2_format fmt = {0};
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 1920;
fmt.fmt.pix.height = 1536;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;

if (ioctl(fd, VIDIOC_S_FMT, &fmt) < 0) {
perror("Failed to set format");
close(fd);
return -1;
}

// Request and map buffers
// ... (buffer setup code) ...

// Start streaming
// ... (streaming code) ...

// Capture and process frames
// ... (frame processing code) ...

// Cleanup
close(fd);
return 0;
}

步骤 2:数据处理

通过 MIPI CSI 接口接收模块数据后:

  • 数据接收
    • 实现 GMSL2 协议
    • 配置数据速率
  • 图像处理流水线
    • 解析 YUV422 8bit 数据
    • 图像格式转换

技术支持

  • 文档

    • 完整寄存器说明
    • 集成指南
  • 工程支持

    • 技术咨询
    • 调试协助
    • 性能优化
提示

SENSING Technology 可为大多数平台集成提供专业技术支持。如需详细文档、示例代码和技术协助,请联系支持团队。