Jump to content

Modifying uGFX driver for ED060SC4


Arvind

Recommended Posts

Hello,

I am trying to interface my LB060X01-RD01 eink display with an STM32L152 processor and was successfully able to use the existing driver for ED060SC4 to display content on the display. However, the ED060SC4 driver is for 800*600 resolution but my LB060X01-RD01 eink screen has a resolution of 1024*768. As of now, only 800*600 portion of the display can be utilised, but when I try to change the resolution for the display in the file gdisp_lld_ED060SC4.c in the foll lines:

#ifndef GDISP_SCREEN_HEIGHT
#define GDISP_SCREEN_HEIGHT 760
#endif

#ifndef GDISP_SCREEN_WIDTH
#define GDISP_SCREEN_WIDTH 1020
#endif

The program stops working. It resumes working when I change the resolution back to 800*600, the interesting thing is that other combinations of resolution works, for example 1020*600 is a resolution that works as well as 760*840 and 640*920. I was also able to learn that the program stops responding precisely in gdriver.c after this line:

if (vmt->postinit)
vmt->postinit(pd);//Stops here

This is called through the function _gdispInit() in gdisp.c, which in turn is called from gfxInit(). Can you please tell me how I can increase the resolution in this driver to 1020*760 and what the function: vmt->postinit(pd); does and where its action is defined. Thank you.

 

Link to comment
Share on other sites

Postinit is a call to a routine in the driver called gdisp_lld_postinit().

It is useful where the display initialisation must happen at one bus speed but the data thereafter can be sent at a higher bus speed. Postinit is called after all driver initialisation has completed but before any drawing is done to the display.

Most drivers do not define such a routine.

I am not sure what the ed driver is doing in that routine. Have a look at that routine to find the problem.

Link to comment
Share on other sites

The driver doesn't have to implement gdisp_lld_postinit(). It is optional and that is why you can't find it: The ED060SC4 driver doesn't implement it.

My first guess would have been that you run out of memory as the ED060SC4 driver allocates frame buffer(s). However, as you mentioned that it works with larger resolutions we can safely assume that this isn't a memory problem.
I'd recommend you to further debug the program (eg. single-step through the init function) to find out where the actual problem is. As the driver doesn't implement the postinit() I'm pretty sure that this is not the source of the problem.

We didn't write that driver ourselves, it was a contribution by one of our community members. I'll try to reach out to him. Maybe he has an idea. That might save some time :) 

Link to comment
Share on other sites

Hi Joel, thank you so much for your help. I was able to find the action for postinit() in _gdispPostInitDriver() in gdisp_driver.h. I was able to sort out why the program halted after:

if (vmt->postinit)
vmt->postinit(pd);//Stops here
It was due to a dual definition of: 
GDISP_STARTUP_LOGO_TIMEOUT in gdisp.c and gfxconf.h

However, now after changing the resolution the new problem is that the program halts after these lines in function: fillarea(GDisplay *g) in gdisp.c:
for(; g->p.y < y1; g->p.y++, g->p.x = x0)
      for(; g->p.x < x1; g->p.x++)
           gdisp_lld_draw_pixel(g);//Stops after this
g->p.y = y0;

The program halts whenever the function: gdispFillArea() is called. The function: gdisp_lld_draw_pixel(g); itself doesn't halt, the program halts just after the main for loop.

Link to comment
Share on other sites

We spoke to the author of the driver and he mentioned that the most likely cause of this problem is a bug in the block buffer allocation & management code which might cause an overflow for certain resolutions.

There's not much more we can do for you as we don't have the hardware (display + required circuitry) to try it ourselves. This driver was a contribution - we haven't written it ourselves.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...