Thursday, April 26th 2018, 9:48am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

JimPow

Beginner

Date of registration: Jul 10th 2015

Posts: 4

Location: Manchester

Occupation: Company Director

1

Friday, April 13th 2018, 1:48am

SEPS525 Driver Issue

Dear Segger
I am struggling getting emWin5 to drive an OLED display using the SEPS525 driver provided as part of the STM Cube environment. I am using Crossworks V4 for development.
The OLED with SEPS525 driver is connected to an STM32F429 using the FMC in 8 bit LCD data bus mode and I am attempting to drive without cache.
My edited config file is shown below.


void LCD_X_Config(void)
{
GUI_DEVICE * pDevice;
CONFIG_FLEXCOLOR Config = {0};
GUI_PORT_API PortAPI = {0};
/* Set display driver and color conversion */
pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565 , 0, 0);

/* Display driver configuration, required for Lin-driver */
LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
/* supported parameters: GUI_SWAP_XY, GUI_MIRROR_X, GUI_MIRROR_Y or any combination of these paramters */
/* Orientation */
Config.Orientation = 0;

#if (NUM_BUFFERS > 1)
GUI_MULTIBUF_ConfigEx(0, NUM_BUFFERS);
#endif
GUIDRV_FlexColor_Config(pDevice, &Config);
//
// Set controller and operation mode
//
PortAPI.pfWrite8_A0 = LcdWriteReg;
PortAPI.pfWrite8_A1 = LcdWriteData;
PortAPI.pfWriteM8_A1 = LcdWriteDataMultiple;
PortAPI.pfReadM8_A1 = LcdReadDataMultiple;

GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66718 , GUIDRV_FLEXCOLOR_M16C0B8);
}

I have created the LcdWriteReg, LcdWriteData etc, functions as required.
I am 100% confident that these functions, my FMC and hardware is working fine as these register access functions are used to initialise the display and can be used subsequently with c test routines from the display manufacturer to control the display perfectly.
My OLED initialisation does get called by emWin:
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
int r;
(void) LayerIndex;
(void) pData;

switch (Cmd) {
case LCD_X_INITCONTROLLER: {

/* Component Initialization */
LCDController_Init();
//Run_test_demo();

return 0;
}
default:
r = -1;
}
return r;
}
Unfortunately when emWIn tries to access the display I am getting strange results. As a starter, Lines and Circles get drawn in the correct position on the display, but drawing is not the correct colour, pixels seem to be missing and simple text is again in the correct place but garbage.
Attached is a screen shot of drawing 7 lines of different colours R, G, B ,W, C, M, Y. and the simple text "abcde" using the default font.
I have tried various changes to program heap allocations and stack etc (which tend to fix these sort of things) and the different versions of the GCC libraries supplied through the cube. I am getting the same results whatever I do.
Have you any idea what may be going on here as I am beginning to think that the selected F66718 library with 8 bit data no cache, is not sending the correct data to the register access functions.
Many thanks
James
JimPow has attached the following image:
  • SEP525.jpg

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 562

2

Friday, April 13th 2018, 11:30am

Hi,

Right now I have no idea what causes this behavior.

Attached you will find a sample LCDConf.c we have used for this controller.

In your code you use:

C/C++ Source code

1
2
3
4
5
#if (NUM_BUFFERS > 1)

GUI_MULTIBUF_ConfigEx(0, NUM_BUFFERS);

#endif


Not sure if this has an impact but multibuffering is only available with the GUIDRV_Lin driver.

Did you tried to check the data which are send from emWin to the controller?
Are these data as expected?

Regards
Sven

JimPow

Beginner

Date of registration: Jul 10th 2015

Posts: 4

Location: Manchester

Occupation: Company Director

3

Friday, April 13th 2018, 12:30pm

Hi Sven
Thanks for the prompt reply.
Unless its me, cant see the LCDConf.c attachment you said is there.
Ill certainly try just placing one pixel of a certain colour on the display via emWin and monitor what gets sent to the register access functions.
Regards
James

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 562

4

Friday, April 13th 2018, 12:53pm

Hi,

Of course, forgot it ;)

Regards
Sven
SEGGER - Schoenen has attached the following file:

JimPow

Beginner

Date of registration: Jul 10th 2015

Posts: 4

Location: Manchester

Occupation: Company Director

5

Friday, April 13th 2018, 2:08pm

Fixed !! :) :)

Thanks Sven
Its was the
Config.RegEntryMode = 0x60;

That needed adding to my LCDConfig.c

Even after reading the manual, not quite sure what this line does, but all is good now.

Best regards
James