ST意法半导体
直播中

南风一号

9年用户 1030经验值
擅长:EMC/EMI设计
私信 关注
[问答]

怎样去解决STM32H735G-DK DMA2D起始地址漂移的问题呢

我正在使用 CubeMX 生成起始文件而不是 BSP 示例。当我尝试设置 DMA2D 时,我发现起始地址将被移动 0xC。
  • ...
  • // setup octospi2 for hyperram, dma2d and ltdc above
  • uint32_t col;
  • uint32_t startAdd = 0x70000000; // try to write the hyperram at this address
  • // use dma2d to write 0xFF224433 to the startAdd
  • HAL_DMA2D_Start(&hdma2d, 0xFF224433, (uint32_t)startAdd, 6, 1);
  • // try to verify the data in hyperram
  • for (int i = 0; i < 272; i++) {
  •     for (int j = 0; j < 480; j++) {
  •         uint32_t add = (startAdd + (i * 480 + j) * 4);
  •         col = *(uint32_t *)add;
  •         if (col == 0xFF224433)
  •         DEBUG_PRINT_USB("find color at <%d, %d> 0x%xn", j, i, add);
  •     }
  • }
  • // the output is:
  • find color at <3, 0> 0x7000000C
  • find color at <4, 0> 0x70000010
  • find color at <5, 0> 0x70000014
  • find color at <6, 0> 0x70000018
  • find color at <7, 0> 0x7000001C
  • find color at <8, 0> 0x70000020
  • // the start address is shifted by 0xC, whatever start address x I give to the DMA2D, I always read the first value at (x+0xC), what's the problem?




回帖(1)

刘宇

2022-12-12 09:47:36
我解决了这个问题,当我设置 S70KL1281 时,延迟应该设置为 3 而不是 6。
S70KL1281_WriteCfgReg0(&hospi2, reg, HAL_OSPI_FIXED_LATENCY, OPTIMAL_FIXED_INITIAL_LATENCY); // OPTIMAL_FIXED_INITIAL_LATENCY=3
举报

更多回帖

发帖
×
20
完善资料,
赚取积分