Understand how memory device works

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

  • Understand how memory device works

    Hi, i'm trying to understand how to work with memory device using a stm32f4 discovery board with lcd resolution 320x240.
    I'm trying to manipulate the contents of a memory device, stored somewhere in sram, with the returned poiter by GUI_MEMDEV_GetDataPtr(hMem) function. This function return a null pointer (zero): is that possible?
    How can i understand where is the allocated sram area for LCD?
    I'm using keil compiler

    Thanks!

    C Source Code

    1. GUI_SelectLayer(0);
    2. GUI_MEMDEV_Handle hMem = GUI_MEMDEV_Create(0, 0, 320, 240);
    3. GUI_MEMDEV_Select(hMem);
    4. GUI_DrawLine(0, 0, 320, 240);
    5. GUI_MEMDEV_Select(0);
    6. //
    7. // Select layer 0
    8. //
    9. GUI_SelectLayer(0);
    10. //
    11. // The following line copies the Memory Device to layer 1 and not to layer 0
    12. //
    13. GUI_MEMDEV_CopyToLCD(hMem);
    14. unsigned int* ptr=(unsigned int*)GUI_MEMDEV_GetDataPtr(hMem);
    Display All

    The post was edited 2 times, last by hexfet13 ().

  • Hi,

    sounds weird. A NULL pointer is returned if the memory device handle itself is 0. Too less memory configured? A memory device of 320x240 requires a memory block of '320 x 240 x BytesPerPixel'.

    Regards,
    Jörg
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.