Jump to content

MAX23

Members
  • Posts

    2
  • Joined

  • Last visited

  1. Hi, the related memory isn't in the gDisplay-Structure, but the memory allocated by the driver. This memory is allocated in "gdisp_lld_init(GDisplay *g)": // The private area is the display surface + flush window structure. g->priv = gfxAlloc(sizeof(UC1610_Window) + GDISP_SCREEN_WIDTH * GDISP_SCREEN_HEIGHT / UC1610_PAGE_HEIGHT); After that line, the first 4 Bytes of the memory pointed to by g->priv read as 0xA0001404 on my target. This area seems to be used to store some coordinates. As far as I can see, the y-coordinates stored here are never written before flushing the display the first time. And this leads to an invalid pointer calculated in gdisp_lld_flush(): x1 = PRIV(g)->x1; y1 = PRIV(g)->y1; // reads as "0xA000" which is far outside of the display area .... // write each page segment from RAM(g) to display RAM for (c = RAM(g) + xyaddr(x1, y1) ; y1 <= y2 ; c += GDISP_SCREEN_WIDTH, y1 += UC1610_PAGE_HEIGHT) { write_data(g, c, cx); //exception is thrown in this function because "c" is invalid } Clearing the memory in g->priv solves the problem for me. Aside from this problem, the display is working now :-)
  2. I had trouble initializing µGFX on my PIC32. issue: The function gdisp_lld_init(GDisplay *g) in gdisp_lld_UC1610.c allocates memory, but it is used uninitialized. On the first call of gdisp_lld_flush(GDisplay* g) during init my device crashed, because y1 = PRIV(g)->y1; contained some invalid data (a high negative value). Since the ram-pointer is calculated using y1, a invalid pointer is calculated. My solution is to memset the allocated ram-area for the driver before using it. This solves the crash My understanding of the driver and µGFX is not good enough, to be certain this is really a bug, or if I have some other issue. It may be worth looking into. My setup: - Device: PIC32MX470, XC32 v1.44 compiler, MPLABX, bare metal
×
×
  • Create New...