主题:AM62P 中讨论的其他器件
工具/软件:
TI 团队大家好
我使用的是 MCU SDK demo Display share、我发现 memcpy 的速度异常。 代码如下:
endMs = (ClockP_getTimeUsec() / 1000U);
DebugP_log("Splash -> Gen 1 buffer: %u ms\r\n", (endMs - gBoot2SplashStartMs));
{ // copy second flame
uint8_t *dst = (uint8_t*)&gFirstPipelineFrameBuf[1];
uint8_t *src = (uint8_t*)&gFirstPipelineFrameBuf[0];
size_t bytes = 5529600U; // 1920*720*4 = 5,529,600
memcpy(dst, src, bytes);
/* Ensure DDR visibility for the second frame */
CacheP_wb(dst, (uint32_t)bytes, CacheP_TYPE_ALLD);
}
endMs = (ClockP_getTimeUsec() / 1000U);
DebugP_log("Splash -> Gen 2 buffer: %u ms\r\n", (endMs - gBoot2SplashStartMs));
我得到了下面的日志:
Splash -> Gen 1 buffer: 264 ms Splash -> Gen 2 buffer: 408 ms
这意味着 memcpy 约使用了 140ms 的 5529600 位数据。
为什么这么慢?

