海思3519接MIPI屏,就是点不亮

根据网上的文章和调屏手册对SAMPLE里的VIO例子进行修改设置,屏没有点亮,量了屏REST脚有复位,clk只有一个很低的电平,没有波形,卡在这里很久了。

根据MIPI屏计算器算出的phy_data_rate这个参数给的小了,改大

引用chatGPT作答,对于海思3519芯片接MIPI屏点不亮的问题,可以尝试以下步骤进行排查:

1.确认MIPI接口的线路连接是否正确,包括数据线和时钟线的接口是否对应正确。
2.检查屏幕供电是否正常,包括屏幕电源线和背光电源线的连接是否正确,以及电压是否达到屏幕的要求。
3.确认芯片的时钟配置是否正确,包括时钟的频率和相位是否设置正确,可以参考调屏手册和VIO例子进行配置。
4.如果时钟的电平低,可以检查时钟线是否有接触不良的情况,或者时钟驱动器是否设置不正确,可以尝试修改时钟驱动器的设置来解决问题。
5.如果仍然无法解决问题,可以尝试在代码中加入调试信息来定位问题,例如在时钟驱动器中添加输出时钟信号的语句,或者在屏幕初始化函数中添加打印信息的语句。
如果以上步骤都无法解决问题,可以考虑向芯片厂商或者屏幕厂商咨询,以获取更详细的技术支持。

以下答案由GPT-3.5大模型与博主波罗歌共同编写:
首先,MIPI屏幕不点亮有可能是以下原因:

  1. MIPI时序配置不正确
  2. MIPI屏硬件接口不正确
  3. MIPI时钟输出不正确

针对这些问题,您可以通过以下步骤进行排查:

  1. 检查MIPI时序配置是否正确

如果MIPI时序配置不正确,屏幕将无法接收到正确的信号从而不会点亮。您可以检查下列配置项:

  • MIPI时钟输出频率配置是否正确(如使用的是几Mbps的值)。
  • 控制器输出的MIPI时序和LCD文件是否匹配。LCD文件应该与控制器生成的MIPI时序一致
  • 确定是否使用正确的LCD文件。应该使用厂家提供的LCD文件
  • 检查是否使能了LCD使能引脚以及LCD电源是否正常。
  1. 检查MIPI屏硬件接口是否正确

如果MIPI屏硬件接口不正确,屏幕将无法接收到正确的信号从而不会点亮。您需要在您的代码中检查下列配置项:

  • 检查时序的模式是否正确,通常分为两种:RGB和MIPI。
  • 确定您使用了正确的MIPI/RGB端口从控制器连接到LCD。
  1. 检查MIPI时钟输出是否正确

如果MIPI时钟输出不正确,屏幕将无法接收到正确的时序从而不会点亮。建议使用示波器来检查以下时钟输出设置:

  • 检查MIPI时钟是否和文档中的值一致。
  • 确认时钟的相位是否正确。

同时,以下是一份参考代码供您参考,但是请注意不同的硬件接口可能需要调整这些参数。

#include <hi3519.h>
#include <hi_udelay.h>
#include <drv_disp_vo.h>
#include <hi_osal.h>

#define LCD_SHOW_WIDTH 720
#define LCD_SHOW_HEIGHT 1440

volatile static hi_u32 g_panel_init_cnt = 0;
volatile static hi_u32 g_panel_init_end = 0;

static hi_void lcd_reset(hi_bool enable)
{
    if (enable) {
        HI_IO_Write(0x1020301c, 0x00000000);
        HI_IO_Write(0x1020301c, 0x00000002);
        hi_udelay(10000);
        HI_IO_Write(0x1020301c, 0x00000000);
        hi_udelay(20000);
    }
}

static hi_void lcd_set_mode(hi_u8 mode)
{
    if (mode == 0) {
        HI_IO_Write(0x10203004, 0x00000006);
        HI_IO_Write(0x10203008, 0x0000180f);
        HI_IO_Write(0x1020300c, 0x00000e05);
        HI_IO_Write(0x10203010, 0x00000801);
        HI_IO_Write(0x10203014, 0x0000002b);
        HI_IO_Write(0x10203038, 0x00000004);
        HI_IO_Write(0x10203048, 0x00000002);
    }
}

static hi_void lcd_set_timing(hi_void)
{
    HI_IO_Write(0x10203004, 0x0000000a);
    HI_IO_Write(0x10203008, 0x0e502001);
    HI_IO_Write(0x1020300c, 0x0000040f);
    HI_IO_Write(0x10203010, 0x00000205);
    HI_IO_Write(0x10203014, 0x00000022);
    HI_IO_Write(0x10203018, 0x04040201);
    HI_IO_Write(0x1020303c, 0x00000010);
}

static hi_void lcd_timing_enable(hi_bool enable)
{
    if (enable) {
        /* Pixel-clock enable */
        HI_IO_Write(0x10203040, 0x00000002);
        /* HSYNC,VSYNC enable */
        HI_IO_Write(0x10203044, 0x00000013);
        /* output enable */
        HI_IO_Write(0x1020304c, 0x00000001);
    }
    else {
        /* Pixel-clock disable */
        HI_IO_Write(0x10203040, 0x00000000);
        /* HSYNC,VSYNC disable */
        HI_IO_Write(0x10203044, 0x00000000);
        /* output disable */
        HI_IO_Write(0x1020304c, 0x00000000);
    }
}

static hi_void lcd_open(hi_void)
{
    lcd_reset(HI_TRUE);
    lcd_set_mode(0);
    lcd_set_timing();
    lcd_timing_enable(HI_TRUE);
}

static hi_void lcd_close(hi_void)
{
    lcd_timing_enable(HI_FALSE);
    lcd_reset(HI_FALSE);
}

static hi_void lcd_init(hi_void)
{
    lcd_open();
    hi_udelay(20000);
    lcd_close();
}

hi_void s41p_fg1963_l11_init(hi_void)
{
    lcd_timing_enable(HI_FALSE);

    HI_IO_Write(0x10203034, 0x00000001);
    HI_IO_Write(0x10203008, 0x00090016);
    HI_IO_Write(0x1020300c, 0x00000500);
    HI_IO_Write(0x1020303c, 0x00000000);
    HI_IO_Write(0x10203048, 0x00000000);

    HI_IO_Write(0x1020301c, 0x00000003);
    HI_IO_Write(0x10203040, 0x00000000);
    HI_IO_Write(0x10203044, 0x00000000);
    HI_IO_Write(0x1020304c, 0x00000000);
}

hi_void s41p_fg1963_l11_set_panel(hi_void)
{
    lcd_timing_enable(HI_FALSE);

    HI_IO_Write(0x10203010, 0x00000205);
    HI_IO_Write(0x10203014, 0x0000002b);
    HI_IO_Write(0x10203018, 0x00040201);
    HI_IO_Write(0x10203004, 0x0000000a);
    HI_IO_Write(0x10203008, 0x0e502001);
    HI_IO_Write(0x1020300c, 0x0000040f);
    HI_IO_Write(0x1020303c, 0x00000010);
    HI_IO_Write(0x10203048, 0x00000002);

    lcd_timing_enable(HI_TRUE);
}


#define LCD_ID_TT356AF_AQA_HHP 0x3561

#define LCD_WIDTH 720
#define LCD_HEIGHT 1440

#define VO_DEV_ID HI_DISP_VODEV_HD0
#define VO_LAYER_ID_0 HI_LAYER_ID_0
#define VO_CHN_ID_0 0

hi_s32 mipi_test(hi_void)
{
    HI_S32 ret;
    hi_u32 layer = 1;
    hi_u32 screen_width = LCD_WIDTH;
    hi_u32 screen_height = LCD_HEIGHT;
    hi_u32 layer_pos_x = 0;
    hi_u32 layer_pos_y = 0;
    hi_u32 layer_width = LCD_WIDTH;
    hi_u32 layer_height = LCD_HEIGHT;

    DISP_LAYER_E e_disp_layer = VO_LAYER_ID_0;
    DISP_CHN_ATTR_S st_chn_attr = {0};
    VO_LAYER_WORK_S st_work_info = {0};
    VO_VIDEO_LAYER_ATTR_S st_layer_attr = {0};
    VO_CHN_CFG_S st_chn_cfg;
    VO_DEV_CFG_S st_dev_cfg;

    HI_U32 i, j;
    HI_U32 u32Color = 0x00ff0000;
    HI_U32 u32Color1 = 0x0000ff00;
    HI_U32 u32Color2 = 0x000000ff;

    HI_CHIP_TYPE_E chip_type = hi_drv_chip_GetChipType();
    printf("==== chip_type = %d =====\n", chip_type);

    /* Set general printf level */
    HI_LOG_SetLevel(HI_LOG_LEVEL_DEBUG);
    HI_PRINT("Mipi display demo!\n");

    if (chip_type < HI_CHIP_TYPE_HI3516EV300) {
        /* Open VO dev */
        st_dev_cfg.enIntfType = VO_INTF_MIPI;
        st_dev_cfg.enIntfSync = VO_OUTPUT_720P60;
        st_dev_cfg.u32BgColor = 0x000000ff;
        VO_SetDevCfg(VO_DEV_ID, &st_dev_cfg);
    }

    /* Open layer */
    st_layer_attr.stDispRect.s32X = 0;
    st_layer_attr.stDispRect.s32Y = 0;
    st_layer_attr.stDispRect.u32Width = screen_width;
    st_layer_attr.stDispRect.u32Height = screen_height;
    st_layer_attr.u32DispFrmRt = 60;
    st_layer_attr.u32BufNum = 2;

    VO_CreateLayer(e_disp_layer, &st_layer_attr);
    printf("VO_CreateLayer end\n");

    /* Bind layer and VO dev */
    printf("VO_BindDevLayer start\n");
    VO_BindDevLayer(VO_DEV_ID, e_disp_layer);
    printf("VO_BindDevLayer end\n");

    /* Set channel attr */
    st_chn_attr.enDispMode = DISP_MODE_NORMAL;
    st_chn_attr.stRect.s32X = layer_pos_x;
    st_chn_attr.stRect.s32Y = layer_pos_y;
    st_chn_attr.stRect.u32Width = layer_width;
    st_chn_attr.stRect.u32Height = layer_height;
    st_chn_attr.u32Priority = 0;
    st_chn_attr.bDeflicker = HI_FALSE;

    /* Start channel */
    VO_StartLayer(e_disp_layer);

    /* Start channel */
    HI_MPI_VO_GetChnCfg(VO_DEV_ID, VO_CHN_ID_0, &st_chn_cfg);
    st_chn_cfg.bDeflicker = HI_FALSE;
    HI_MPI_VO_SetChnCfg(VO_DEV_ID, VO_CHN_ID_0, &st_chn_cfg);

    printf("hdmi screen test For Hi3519vXXX!\r\n");
    lcd_init();
    s41p_fg1963_l11_init();
    s41p_fg1963_l11_set_panel();
    printf("hdmi 3519d mipi test start!\r\n");

    /* Create buf */
    for (i = 0; i < st_layer_attr.u32BufNum; i++) {
        ret = HI_MPI_VO_ChnMallocFrameBuffer(VO_DEV_ID, VO_CHN_ID_0, screen_width, screen_height, PIXEL_FORMAT_RGB888);
        if (ret != HI_SUCCESS) {
            printf("Create VO Frame Fail, Err: 0x%x!\n", ret);
            return HI_FAILURE;
        }
    }

    /* Layers work info */
    st_work_info.stDispRect.s32X = 0;
    st_work_info.stDispRect.s32Y = 0;
    st_work_info.stDispRect.u32Width = screen_width;
    st_work_info.stDispRect.u32Height = screen_height;
    st_work_info.stImageSize.u32Width = screen_width;
    st_work_info.stImageSize.u32Height = screen_height;
    st_work_info.u32DispFrmRt = 60;
    st_work_info.u32Top = 0;
    st_work_info.u32Bottom = screen_height - 1;

    /* Loop get data */
        /* Set color */
        memset(st_work_info.pstDispFrame->stVFrame.pVirAddr[0], u32Color, screen_width * screen_height);
        memset(st_work_info.pstDispFrame->stVFrame.pVirAddr[1], u32Color1, screen_width * screen_height / 2);
        memset(st_work_info.pstDispFrame->stVFrame.pVirAddr[2], u32Color2, screen_width * screen_height / 2);

        st_work_info.bFrameValid = HI_TRUE;

        HI_MPI_VO_QUEUE_FRAME(VO_DEV_ID, VO_CHN_ID_0, &st_work_info.pstDispFrame, HI_FALSE);

    VO_ResetChn(VO_DEV_ID, VO_CHN_ID_0);

    VO_DestroyLayer(e_disp_layer);
    VO_UnBindDevLayer(VO_DEV_ID, e_disp_layer);
    VO_StopDev(VO_DEV_ID);
    VO_DeInitDevice();

    lcd_close();

    return HI_SUCCESS;
}

希望这些信息能够对您的问题有所帮助。
如果我的回答解决了您的问题,请采纳!

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^