Jump to content

Help ST7735+chibiOS


doc_rob

Recommended Posts

Hello everyone, this is my first attempt with ugfx library and I need some help starting with my 1.8 inch display. I found the driver in gdisp and modified a board file from a different example but now it won't compile. Does anyone have a working example preferably for a stm32f4 and Chibios. 

That would be a great help. 

Thank you. 

Link to comment
Share on other sites

Hello @doc_rob and welcome to the µGFX community!

There are plenty of example board files that you can find in the /boards directory of the µGFX library.
However, it would be a lot more efficient if you could simply attach a plain text file of the compiler output (make sure that you make a clean build). This way we can see what's going on and help you resolving your problems.

Link to comment
Share on other sites

Unfortunately i couldn't get a working configuration.

Here are some of my errors. I am pretty sure there is an error in gdisp_lld_ST7735.c in the function execute_cmds:

static void execute_cmds (const uint8_t *addr) {

    unsigned int cmds = *addr++;
    while (cmds--) {
        write_cmd (g, *addr++);

...

it doesn't get g.

Some more errors:

../../ugfx_2.7/drivers/gdisp/ST7735/gdisp_lld_ST7735.c:90:18: error: #if with no expression
 #if ST7735_TYPE_B

../../ugfx_2.7/drivers/gdisp/ST7735/gdisp_lld_ST7735.c:204:14: error: 'g' undeclared (first use in this function)
   write_cmd (g, *addr++);

../../ugfx_2.7/drivers/gdisp/ST7735/gdisp_lld_ST7735.c:84:101: error: expected ';' before '}' token
 #define write_data_repeat(g, data, count) { int i; for (i = 0; i < count; ++i) write_data (g, data) }

It would be very helpful if somebody could supply a working example.

Thank you.

 

Link to comment
Share on other sites

It looks like you did make exactly the same two changes as i. It does compile but sadly the display isn't too impressed, meaning it still doesn't work.

Maybe there is some initialisation missing, i did compare the init with the adafruit source and it is somewhat shorter. I assume the creator had just one type of display and didn't need the other code. I have to check with my logic analyzer. But for now it is still non functional.

Link to comment
Share on other sites

That driver actually shouldn't be part of the library anymore, we wanted to throw it out a couple of months ago but seems that we never actually did it. The reason for that is because it appears that the author of the driver (a member of the community) just simply copy-pasted the Adafruit driver and when I remember correctly the Adafruit license doesn't allow for that.

We'd appreciate it if you guys could develop a proper µGFX driver from ground up.

Link to comment
Share on other sites

I've been playing with this driver for a while now and i've got it working (more or less). But one problem i can't solve. After the initialization the screen gets cleared but only half way (actually from the 120Lines about 50). I tried delays after one command byte, after one data byte, slower SPI clock, i changed GDISP_LINEBUF_SIZE but nothing changed.

GDISP_SCREEN_HEIGHT is 120 and

GDISP_SCREEN_WIDTH is 128.

Is there somewhere a configuration in uGFX i missed?

I am using uGFX 2.4 now.

Thanks.

 

Link to comment
Share on other sites

GDISP_PIXELFORMAT does slightly change the wrong colors to a different wrong. For example: with RGB565 it is as follows:

Red = Black, Green = Black, Blue = Yellow, Yellow = Blue, Magenta = Yellow

with BGR565: Red = Yellow, Green = Black, Blue = Black, Yellow = White, Magenta = Yellow

Also there are some warnings during compile:

WGDISP_PIXELFORMAT_CUSTOM" is not defined

"GOS_NEED_X_THREADS" is not defined

"GOS_NEED_X_HEAP" is not defined

"GFX_USE_GAUDIN" is not defined

Are they in any way related to my problem?

Thank you.

Link to comment
Share on other sites

Ok, i did it. I've spend a lot of time checking other code and looking at the datasheet of the controller. The Problem was simple, GDISP_HARDWARE_FILLS was TRUE and that caused the Problem.

I just need some Help with the colors. It seems GREEN is not been transfered. I tried RGB, BGR. The config is right for sure but somewhere the calculation from Yellow for example which is defined as HTML2COLOR(0xFFFF00) is wrong and i end up with Blue or Black.

I've come that far i really don't want to trash everything now.

So, to be clear, could anyone please help me with figuring out the color problems.

Thank you.

Link to comment
Share on other sites

I found the problem and a solution. The driver works now corectly (at least for my GREENTAB display).

What's odd is the display has printed on 128*120 but Resolution is 128*160. I used uGFX 2.7 and ChibiOS 16.1

Can i upload my project somewhere?

Link to comment
Share on other sites

Glad to hear that you managed to get it up and running. You can post your project in the user projects section: https://community.ugfx.io/forum/6-user-projects/

 

2 hours ago, doc_rob said:

What's odd is the display has printed on 128*120 but Resolution is 128*160. I used uGFX 2.7 and ChibiOS 16.1

What do you mean by "printed on"? On the PCB?

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...