- Hold the link in resetKeep
rstn_ilow until the PHY reports the lanes ready. - Identify the coreRead
ID(expect 0xA715EC01) andVERSION(0x03040001 for v3.4.1). ReadHWCFGfor the lane count, build, output and embedded data output. - Configure the linkWrite
PIX_BITandLINE_LENGTH. CRC build: writeCRC_OPTION= 1 and set the sensor’s CRC Option on. ECC build: writeECC_OPTION(1 or 2, as the sensor) andECC_BLOCK. - Optional cropWrite
VID_LINE_SKIP,VID_WIDTHandVID_HEIGHT. These may also be changed later, while streaming. - Start the sensorRelease
rstn_iand start streaming from the sensor. - Check the linkRead
VID_FRAME_INFO:FRAMESshould count up with every frame andLINESshould equal the image height after the crop.HDR_CRC_ERR_CNTandVID_OVF_CNTshould stay 0 andCRC_ERR_LINE[31]should read 0. With the embedded data output built,EBD_FRAME_INFOcounts the frames that sent metadata. - MonitorRead the error counters periodically:
HDR_CRC_ERR_CNTin both builds,PAY_CRC_ERR_CNTandCRC_ERR_LINEin the CRC build,C_ERR_CNTandECC_FAIL_CNTin the ECC build. Clear them withERR_CNT_CTRL.CLEAR, and the overflow status withVID_CTRL.OVF_CLRandVID_CTRL.EBD_OVF_CLR.
The same sequence with plain register accesses, for a 2-lane CRC build receiving 5328-pixel RAW12 lines with the CRC footer, cropped to 1920 x 1080:
/* base = address of slvs_ec_rx_0 in the Vivado address editor */
#define RX(off) (base + (off))
if (Xil_In32(RX(0x00)) != 0xA715EC01) return -1; /* ID */
u32 ver = Xil_In32(RX(0x04)); /* VERSION 3.4.1 */
u32 hwcfg = Xil_In32(RX(0x08)); /* lanes, build */
Xil_Out32(RX(0x10), 12); /* PIX_BIT RAW12 */
Xil_Out32(RX(0x14), 5328); /* LINE_LENGTH pixels */
Xil_Out32(RX(0x1C), 1); /* CRC_OPTION check CRC32 footer */
Xil_Out32(RX(0x30), 8); /* VID_LINE_SKIP */
Xil_Out32(RX(0x34), 1920); /* VID_WIDTH */
Xil_Out32(RX(0x38), 1080); /* VID_HEIGHT */
/* ... release rstn_i, start the sensor ... */
u32 info = Xil_In32(RX(0x40)); /* VID_FRAME_INFO */
u32 frames = info >> 16; /* counts up every frame */
u32 lines = info & 0xFFFF; /* 1080 after the crop */
if (Xil_In32(RX(0x54)) & 0x80000000) { /* CRC_ERR_LINE: an error since clear */
u32 hdr = Xil_In32(RX(0x4C)); /* bad copies [15:0], lost [31:16] */
u32 pay = Xil_In32(RX(0x50)); /* payload CRC32 failures */
}
The software driver supplied with the core performs these steps for you, including the
ECC_BLOCK computation; see Software.