distortion in swipelist

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • distortion in swipelist

      Hi All i have created one swipelist window and when we click on this window one popup comes which is a child window of that. the issue is when that popup is created, below swipelist got distorted slightly i.e swipelist separator lines are misplaced. there complete line is not distorted but a part of it which is near to that child window.
      we are using non blocking Dma operation in our system, and when we changed to blocking the issue is not happening. Can Someone explain why in non blocking operation we are seeing this issue.
      Also i want to know how "GUI_DrawLine" works. ? According to me this call also will go through DMA only if i am not wrong. But the question is if everything is happening through DMA then Why this issue is happening.

    • Not sure if this is what is occurring for you, but figured I'd mention what I was seeing just in case.. I'm currently working on a project using an STM32H7.. using the DMA2D transfers, which is pretty much how all transfers are done with the lower level driver that emWin calls..

      Anyhow, I was seeing a bunch of distortion as well, especially when trying to use the non-blocking/interrupt driven DMA functions. I ended up going back to using blocking, as the interrupt-driven still is not quite right, getting distortion.

      But along with that, I did have to change a couple of things (really prob. only need one of these)

      1) if using external ram, set the config params to be WRITETHROUGH

      2) OR, do a 'dcache flush' before any DMA operations
    • Hi MikeFlyersFan Thanks for the reply. Can you clarify whether You are using blocking or non blocking. and whatever 2 things you suggested are required in non blocking or blocking and which one you used and resolved?
      "if using external ram, set the config params to be WRITETHROUGH"
      in the above line did you mean lcd config file or microcontroller?
    • Hi,

      So, currently I'm still using 'blocking' mode as you are, as I still see corruption when using non-blocking (ie DMA interrupt mode). I don't know yet what that actual issue is, but I didn't really see any advantage to using non-blocking anyhow, so I'm sticking with this for now.

      *In either case, as I mentioned, you need to make sure any memory you are using for LCD operations is either 'flushed' before any DMA, or your memory is setup as 'WRITETHROUGH' so it cannot be cached.... I was using DCACHE flushes before I noticed the MPU setup to configure writethrough, so I actually still have both 1) & 2) below in my project, but you should really only need one or the other....

      (in the STM32 examples for STemWin that come with the CubeMx FW packages, they setup WRITETHROUGH for the external RAM)

      more info: (stm32.agg.io/#dcache-on-stm32f7)

      1) If using STM32, flush DCACHE before any DMA operations, ie: SCB_CleanDCache();

      2) if using STM32, setup MPU region for your external ram/sdram/etc to be WRITETHROUGH:

      Source Code

      1. /**
      2. * @brief Configure the MPU attributes as Write Through for External SDRAM.
      3. * @note The Base Address is SDRAM_DEVICE_ADDR .
      4. * The Configured Region Size is 32MB because same as SDRAM size.
      5. * @param None
      6. * @retval None
      7. */
      8. static void MPU_Config(void)
      9. {
      10. MPU_Region_InitTypeDef MPU_InitStruct;
      11. /* Disable the MPU */
      12. HAL_MPU_Disable();
      13. /* Configure the MPU attributes as WT for SDRAM */
      14. MPU_InitStruct.Enable = MPU_REGION_ENABLE;
      15. MPU_InitStruct.BaseAddress = SDRAM_DEVICE_ADDR;
      16. MPU_InitStruct.Size = MPU_REGION_SIZE_32MB;
      17. MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
      18. MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
      19. MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
      20. MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
      21. MPU_InitStruct.Number = MPU_REGION_NUMBER1;
      22. MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
      23. MPU_InitStruct.SubRegionDisable = 0x00;
      24. MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
      25. HAL_MPU_ConfigRegion(&MPU_InitStruct);
      26. /* Enable the MPU */
      28. }
      Display All