Memory usage

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

  • Memory usage

    For an STM32F746 Discovery board i have the following questions:

    1. I would like to know if we can store the static data (images, fonts) in QSPI memory? Do you have any example?

    2. By using the code + setting below i will get an increase in to 3MB RAM for GUI?

    Source Code

    1. static void MPU_Config (void) { MPU_Region_InitTypeDef MPU_InitStruct;
    2. /* Disable the MPU */
    3. HAL_MPU_Disable();
    4. /* Configure the MPU attributes for SDRAM */
    5. MPU_InitStruct.Enable = MPU_REGION_ENABLE;
    6. MPU_InitStruct.BaseAddress = 0xC0000000;
    7. MPU_InitStruct.Size = MPU_REGION_SIZE_4MB;
    8. MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
    9. MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
    10. MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
    11. MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
    12. MPU_InitStruct.Number = MPU_REGION_NUMBER0;
    13. MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
    14. MPU_InitStruct.SubRegionDisable = 0x00;
    15. MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_DISABLE;
    16. HAL_MPU_ConfigRegion(&MPU_InitStruct);
    17. /* Enable the MPU */
    Display All

    in combination with LCDConf.c

    Source Code

    1. // Video RAM Address#define VRAM_ADDR 0xC0000000
    2. // DMA2D Buffer Address
    3. #define DMA2D_BUFFER_ADDR 0x20000000

    and GUIConf.c

    Source Code

    1. // Define the available number of bytes available for the GUI#define GUI_NUMBYTES 0x300000

    Thank you
  • Hi,

    Attached is a GUIConf.c from one of our projects. There we configure the MPU for the SDRAM region and initialize the SDRAM. This is done by HAL functions provided by STM.

    In your LCDConf.c the framebuffer address should fit to the SDRAM (starting at 0xC0000000). I would place the GUI RAM and the framebuffer into the SDRAM. There should be enough memory available.

    Attached are both, LCDConf.c and GUIConf.c from one of our projects. Also a GUI_BSP.c which contains the SDRAM init and the MPU configuration.