本帖最后由 masaike 于 2023-12-12 10:13 编辑
SPI硬件延迟,好像无法关闭,就这样结束
项目用雅特力403A是可以跑40帧, 移植好后发现只能跑8帧,
lv_task_handler耗时100多毫秒, 浮点数已经打开,
搜了很久没有找到LVGL相关demo,
期待技术大佬指点一下
大概找到问题所在了, HC32 SPI DMA的波形 ,
这是雅特力的波形
这是SPI DMA配置,不知道有没有配置错误
/* Enable SPI3 clock */
FCG_Fcg1PeriphClockCmd(FCG1_PERIPH_SPI3, ENABLE);
/************************* Configure SPI3***************************/
SPI_StructInit(&stcSpiInit);
stcSpiInit.u32WireMode = SPI_3_WIRE;
stcSpiInit.u32TransMode = SPI_SEND_ONLY;
stcSpiInit.u32MasterSlave = SPI_MASTER;
stcSpiInit.u32SpiMode = SPI_MD_0;
stcSpiInit.u32BaudRatePrescaler = SPI_BR_CLK_DIV2;
stcSpiInit.u32DataBits = SPI_DATA_SIZE_8BIT;
stcSpiInit.u32FirstBit = SPI_FIRST_MSB;
stcSpiInit.u32FrameLevel = SPI_1_FRAME;
(void)SPI_Init(CM_SPI3, &stcSpiInit);
SPI_DelayStructInit(&stcSpiDelay);
stcSpiDelay.u32IntervalDelay = SPI_INTERVAL_TIME_2SCK;
stcSpiDelay.u32ReleaseDelay = SPI_RELEASE_TIME_2SCK;
stcSpiDelay.u32SetupDelay = SPI_SETUP_TIME_2SCK;
(void)SPI_DelayTimeConfig(CM_SPI3, &stcSpiDelay);
/* Enable SPI3 */
SPI_Cmd(CM_SPI3, ENABLE);
/* DMA configuration */
FCG_Fcg0PeriphClockCmd(FCG0_PERIPH_DMA1 | FCG0_PERIPH_AOS, ENABLE);
(void)DMA_StructInit(&stcDmaInit);
stcDmaInit.u32BlockSize = 1UL;
stcDmaInit.u32TransCount = 0UL;
stcDmaInit.u32DataWidth = DMA_DATAWIDTH_8BIT;
/* Configure TX */
stcDmaInit.u32IntEn = DMA_INT_ENABLE;
stcDmaInit.u32SrcAddrInc = DMA_SRC_ADDR_INC;
stcDmaInit.u32DestAddrInc = DMA_DEST_ADDR_FIX;
stcDmaInit.u32SrcAddr = (uint32_t)NULL;
stcDmaInit.u32DestAddr = (uint32_t)NULL;
(void)DMA_Init(CM_DMA1, DMA_CH0, &stcDmaInit);
AOS_SetTriggerEventSrc(AOS_DMA1_0, EVT_SRC_SPI3_SPTI);
/* IRQ sign-in */
stcIrq.enIntSrc = INT_SRC_DMA1_TC0;
stcIrq.enIRQn = INT038_IRQn;
stcIrq.pfnCallback = &INT_SRC_DMA1_TC0_IrqCallback;
(void)INTC_IrqSignIn(&stcIrq);
/* NVIC config */
NVIC_ClearPendingIRQ(INT038_IRQn);
NVIC_SetPriority(INT038_IRQn, DDL_IRQ_PRIO_01);
NVIC_EnableIRQ(INT038_IRQn);
/* Enable DMA and channel */
|