Jump to content
kpapr1

Compilation error

Recommended Posts

Hi, I have a custom board with an SSD1322 OLED display and an STM32F103 MCU. I'm using Keil and have setup the ugfx. Everything is fine and I get a successful compilation when I include the gfxInit() command. But all other commands, like gdispDrawPixel or gdispFillCircle give a "warning:  #223-D: function "gdispDrawPixel" declared implicitly" and "L6218E: Undefined symbol gdispDrawPixel (referred from main.o).", which means that these functions are not referenced. But I don't understand why. I have included in my project "gfxconfig.h", "gfx_mk.c", "SSD1322.h", and "gdisk_IId_SSD1322.c". I have also included the paths "..\ugfx" and "..\ugfx\drivers\gdisp\SSD1322". What am I missing?

 

Share this post


Link to post
Share on other sites

Hello & welcome to the µGFX community!

Did you include the "gfx.h" header in the files where you call the high-level API functions such as gdispDrawPixel() ?

Share this post


Link to post
Share on other sites
16 minutes ago, inmarket said:

Have you edited gfxconf.h to enable GFX_NEED_GDISP (set it to GFX_ON)?

I don't see "GFX_NEED_GDISP" anywhere in my gfxconfig.h, but I have enabled this option -->    "#define GFX_USE_GDISP                                TRUE".

 

 

Share this post


Link to post
Share on other sites

OK, what I found out is that I copied the gfxconfig.h file to my project's SRC dir (as the installation guide for Keil said), but the compiler still reads this header file from its original location (where all header definitions are commented out). Now I got a bunch of different errors that I'll try to sort out. I have followed the instructions for installing ugfx in Keil, but it seems it's not working out for me or I have done some things wrong. I'll check it out and come back. Thanks everyone for trying to help me! 

 

🙂

Share this post


Link to post
Share on other sites

 So, compilation errors are all sorted out. Now I need to understand how to make ugfx know where my SPI interface is, as well as the reset and /CS signals. Also, I have a 3-wire SPI interface, which means I need to send a 9-bit word. Any help on this would be greatly appreciated! 🙂

 

Share this post


Link to post
Share on other sites
15 hours ago, kpapr1 said:

I don't see "GFX_NEED_GDISP" anywhere in my gfxconfig.h, but I have enabled this option -->    "#define GFX_USE_GDISP                                TRUE".

You're using an older version of the library. We'd recommend using the latest master branch of the official repository or getting the latest stable v2.9 release from the downloads section.

Share this post


Link to post
Share on other sites

Hello again! So, I upgraded to version 2.9 but I still didn't find the "GFX_NEED_GDISP" definition anywhere, so I set the "GFX_USE_GDISP" to "GFXON". Anyway, the problem now is that any draw command causes a hard fault. The function call that generates the hard fault is in "gdisp.c" and it's "drawpixel_clip(g);". I don't know why this happens or how to fix it, so any help would be greatly appreciated!

 

 

Share this post


Link to post
Share on other sites

When you first power on do you see the logo?

I would suggest that you start your debugger and follow the chain of execution. It is not expeced or common to see the problem you describe.

Share this post


Link to post
Share on other sites

No logo at power on... I start the debugger and take it step by step, the program goes through the "gfxInit();" command and then goes to the "gdispDrawPixel(10, 10, White);" command. I step into this command which finally leads me to the "drawpixel_clip(g);" command and then I get the hard fault error. I'll have a look again tomorrow. Thanks.

Share this post


Link to post
Share on other sites

That sounds an awful lot like an issue in / related to the GDISP driver that you're using.

You can use the GDISP TestStub driver to compile & run with that. It's an empty driver that doesn't do anything but allows to pass compilation of the GDISP module. This way you can ensure that the rest of the system is running properly.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...