Associate
June 11, 2026
Question
STM32N6570_DK not receiving data at CSI receiver
- June 11, 2026
- 2 replies
- 101 views
Hi Team,
We are trying to send camera feed through the TP2860 video decoder to STM32N6570_DK. We have confirmed the configuration of the TP2860 and receiving data at the TP2860 MIPI output, but not receiving packets at the STM32n6570 CSI end. We are positive the CSI configuration is done correctly, but please let us know if we are missing anything sharing the function and also attaching the log :
void stm32n6_mipi_host_enable(void)
{
/* =========================================================================
* STEP 1: FORCE MIPI CORE INTO SHUTDOWN / DISABLED STATE
* =========================================================================
* Clear PEN (Bit 1) in CSI_PRCR and clear power bits in CSI_PCR.
* This releases the write-protection lock on the configuration registers.
*/
CSI_PRCR &= ~(1 << 1);
CSI_PCR &= ~0x0000000F;
k_msleep(5); // Wait for internal finite state machines to safely idle
/* =========================================================================
* STEP 2: CONFIGURE LANE MERGER (Static Configuration while CSIEN = 0)
* =========================================================================
* Configures: 2 valid data lanes, 1-to-1 physical-to-logical lane mapping.
*/
CSI_LMCFGR = 0x00210200;
k_msleep(5);
/* =========================================================================
* STEP 3: ENABLE CSI HOST CONTROLLER BASE
* =========================================================================
* Must be enabled AFTER lane merger, but BEFORE configuring Virtual Channels.
*/
CSI_CR = (1 << CSI_CR_CSIEN_BIT);
k_msleep(5);
/* =========================================================================
* STEP 4: CONFIGURE VIRTUAL CHANNEL (Strict Data Type Filtering)
* =========================================================================
* Configures VC0 for Individual Data Type mode (ALLDT = 0)
* Enables Data Type 0 (DT0EN = 1)
* Maps DT0 to MIPI Code 0x1E (Strictly YUV422 8-bit)
* Sets DT0 Format to 8-bit words (DT0FT = 0x02 / BPP8)
*/
CSI_VC0CFGR1 = 0x023E0002;
k_msleep(5);
/* =========================================================================
* STEP 5: WATCHDOG CONFIGURATION
* =========================================================================
* Leaving CSI_WDR at 0x0 disables the watchdog feature for easier bring-up.
*/
CSI_WDR = 0x00000000;
/* =========================================================================
* STEP 6: POWER ON PHYSICAL D-PHY LANES
* =========================================================================
* Power up physical layers: DL1EN=1, DL0EN=1, CLEN=1, PWRDOWN=0
*/
CSI_PCR = 0x0000000E;
k_msleep(5);
/* Take physical D-PHY receiver core out of digital reset (PEN = 1) */
CSI_PRCR |= (1 << 1);
k_msleep(25); // Give clock recovery phase-locked loops (PLL) time to stabilize
/* =========================================================================
* STEP 7: KICKOFF DATA RECEPTION
* =========================================================================
* Fire the start pulse for Virtual Channel 0 while keeping CSIEN enabled.
* Note: Because VC0START is a write-only pulse bit, we write directly
* without using '|=' to avoid side effects.
*/
CSI_CR = (1 << CSI_CR_VC0START_BIT) | (1 << CSI_CR_CSIEN_BIT);
return 0;
}
