Jump to content

building error µGFX


fastlink30

Recommended Posts

It looks like you switched to a newer version of ugfx. We changed the board file interface of the GINPUT module a few months ago. You're board file is no longer compatible. However, the changes are minimal and you should be able to update your board file by looking at the new template in the drivers directory and the examples.

Let us now should you hit any problems.

~ Tectu

Link to comment
Share on other sites

Regarding your new GEVENT related problem: The structs werencleaned up and all the field holding widget pointers are named gwin now.

if (((GEventGWinButton*)pe)->button == ghConsole)

becomes

if (((GEventGWinButton*)pe)->gwin == ghConsole)

and so on.

~ Tectu

Thank you... Sloooooowly seems to be ok...

but:

Linking build/ch.elf

build/obj/ginput_mouse.o: In function `_gmouseInit':

/home/makkmarci/workspace/ugfx/src/ginput/ginput_mouse.c:648: undefined reference to `GMOUSEVMT_OnlyOne'

collect2: error: ld returned 1 exit status

make: *** [build/ch.elf] Error 1

BUILD FAILED (exit value 2, total time: 11s)

in the ginput_mouse.c:

void _gmouseInit(void) {
// GINPUT_MOUSE_DRIVER_LIST is defined - create each driver instance
#if defined(GINPUT_MOUSE_DRIVER_LIST)
{
int i;
typedef const GMouseVMT const GMOUSEVMTLIST[1];

extern GMOUSEVMTLIST GINPUT_MOUSE_DRIVER_LIST;
static const GMouseVMT * const dclist[] = {GINPUT_MOUSE_DRIVER_LIST};

for(i = 0; i < sizeof(dclist)/sizeof(dclist[0]); i++) {
if (!(dclist[i]->d.flags & GMOUSE_VFLG_DYNAMICONLY))
gdriverRegister(&dclist[i]->d, GDISP);
}
}

// One and only one mouse
#else
{
extern const GMouseVMT const GMOUSEVMT_OnlyOne[1];

if (!(GMOUSEVMT_OnlyOne->d.flags & GMOUSE_VFLG_DYNAMICONLY))
gdriverRegister(&GMOUSEVMT_OnlyOne->d, GDISP);
}
#endif

}

Since I did not declared GINPUT_MOUSE_DRIVER_LIST I dont understand why the OnlyOne is undefinied :(

Link to comment
Share on other sites

It seems to be ok if I remove the "extern" :(

	#else
{
extern const GMouseVMT const GMOUSEVMT_OnlyOne[1];

if (!(GMOUSEVMT_OnlyOne->d.flags & GMOUSE_VFLG_DYNAMICONLY))
gdriverRegister(&GMOUSEVMT_OnlyOne->d, GDISP);
}
#endif

But I dont know if it is the proper way to do this...

And still makes an error:

/workspace/ugfx/src/ginput/ginput_mouse.c:648:39: warning: 'GMOUSEVMT_OnlyOne[0u].d.flags' is used uninitialized in this function [-Wuninitialized]

if (!(GMOUSEVMT_OnlyOne->d.flags & GMOUSE_VFLG_DYNAMICONLY))

Link to comment
Share on other sites

Usually that error occurs if you have defined ginput_need_mouse (except in uppercase) in your gfxconf.h file but haven't added a mouse driver to your build. That error indicates it can't find the mouse driver to compile in.

Ps. The extern is needed. Without the extern it is an auto variable which makes the unresolved symbol dissappear but the program will crash as the mouse driver it is expecting is not linked in.

Note: if you are using a mouse driver outside the repository (not one of our standard ones) you will need to upgrade the driver to match the new mouse calling interface.

Link to comment
Share on other sites

Usually that error occurs if you have defined ginput_need_mouse (except in uppercase) in your gfxconf.h file but haven't added a mouse driver to your build. That error indicates it can't find the mouse driver to compile in.

Ps. The extern is needed. Without the extern it is an auto variable which makes the unresolved symbol dissappear but the program will crash as the mouse driver it is expecting is not linked in.

Note: if you are using a mouse driver outside the repository (not one of our standard ones) you will need to upgrade the driver to match the new mouse calling interface.

It sounds like Chinese for me :( It was easier in the previous version I have used. :( How can I add a mouse driver?

Link to comment
Share on other sites

It sounds like Chinese for me :( It was easier in the previous version I have used. :( How can I add a mouse driver?

It wasn't easier, it's exactly the same! Nothing changed besides a few variable names and struct values.

What inmarket tells you is that you have enabled the touchscreen in your gfxconf.h by setting GINPUT_NEED_MOUSE to TRUE but without properly linking to a driver. This is most likely due to the same reason as with your display issue: The driver interface changed and you need to update your touchscreen board file to match the new interface.

So the way to your solution is: Do the same as you did for your display driver: Update the board file to match the new interface.

We're sorry for the inconvenience. The old interface which you used was the same since the very first day that code existed and therefore not very optimized to fit the new code structure. We don't intend to change these things often (or ever).

We're happy to help where ever we can.

~ Tectu

Link to comment
Share on other sites

I think I know what you sayn' and I feel that I have to rewrite a lot of things :(

You don't have to rewrite a lot of things. The hard part (talking to your microcontroller peripherals etc.) stays the same. The only thing that changes is the board file. It's just a matter of how your existing data is presented to the rest of the uGFX code.

~ Tectu

Link to comment
Share on other sites

Board: STM32F4Discovery

SSD1289 ADS7843

I guess the drivers are ok now. What I miss now is the touchpad.

As I remember I have used the

ginputGetMouse(9999);

somehow and I had to insert the calibration data manually.

Even if I dont have that, something is not ok now since the calibration routine does not work. I have the calibration screen but it does not see anything.

A wiring and the hardware have been double checked. I guess I miss something on the SPI side... The source is here: https://github.com/dm13dv1b/STM32F4_ChibiOS_uGFX_gwin_2.git

But I dont want anyone to write my code :) Just if you are curious.

Link to comment
Share on other sites

Looks like I still need your help. :(

Before I had this in the mouse.c:


GSourceHandle ginputGetMouse(uint16_t instance) {
#if GINPUT_MOUSE_NEED_CALIBRATION
Calibration *pc;
#endif

// We only support a single mouse instance currently
// Instance 9999 is the same as instance 0 except that it installs
// a special "raw" calibration if there isn't one we can load.
if (instance && instance != 9999)
return 0;

But now it is only:

GSourceHandle ginputGetMouse(unsigned instance) {
if (instance == GMOUSE_ALL_INSTANCES)
return (GSourceHandle)&MouseTimer;
return (GSourceHandle)gdriverGetInstance(GDRIVER_TYPE_MOUSE, instance);
}

So how can I put my calibration data as I did before?

Link to comment
Share on other sites

Please stop worrying about the internal code of uGFX. I assure you that everything is right with it (talking about the overall structure, not bugs). You never ever have to change anything inside of the uGFX sources, that's what the board- and configuration files are there for.

You shouldn't worry about storing and restoring your calibration data before you can successfully use the device. If you can't pass the calibration screen then there's definitely something wrong in either your board file, your general peripheral code or the hardware itself.

The first thing to make sure is that the getpin_pressed() function works correctly. This can easily be verified by either using your debugger or flashing an LED on and off accordingly. Otherwise, if you ruled out all the common errors: Can you please paste both board files so we can compare them? (The one that worked with the previous version of uGFX and the one that you're using now). You can use this site to paste your code: http://paste.ugfx.org

~ Tectu

Link to comment
Share on other sites

I could not even sleep yesterday :( I've found out how to save the calibration data but it is useless since something is wrong. I can't do the calibration, it stops at the first cross.

So I hooked up my Saleae Logic and become sad. Picture here: http://i35.photobucket.com/albums/d183/dm13dv1b/spi_zpskabmhxhq.jpg

I think the touch become defective in the last 6 month...

Link to comment
Share on other sites

Little update. It is not the touch device. I went back to my old laptop and successfully uploaded the source with the old ugfx and chibios and everything worked fine.

I did push the to the repo, cloned to the new laptop, changed what I needed to change, compile, flash, run, stuck at calibration.

It seems my SPI never get initialized. So it is not an uGFX issue. :(

Link to comment
Share on other sites

I did push the to the repo, cloned to the new laptop, changed what I needed to change, compile, flash, run, stuck at calibration.(

Can you list the changes that you applied?

So when I understand you correctly we're 100% certain that the hardware itself works? Can you please hook up your debugger to see whether it get stuck somewhere in the actual touch code? Can it be a stack overflow (GTIMER_THREAD_WORKAREA_SIZE should at least be 2048 for now).

Can you also verify that getpin_pressed() is working by either looking at your debugger or flashing an LED in said code?

We need to figure out whether the system crashes or keeps running and uGFX does just not get proper touch information.

Also, did you change the underlying system that you're using? (Eg. did you update ChibiOS/RT as well?)

I took a look at your code and I couldn't find anything that's obviously wrong.

~ Tectu

Link to comment
Share on other sites

No it does not stuck in the code the system is up and running. I know because it is weird - the touch sometimes senses but not at the position where I touch it. Once again - it is not a hardware issue. I've checked the getpin_pressed() pin with an oscilloscope and Im sure it is ok.

And yes, I have changed ChibiOS_2.6.8 from 2.6.5... I guess this will be the problem.

Link to comment
Share on other sites

I took out a board of my own that uses and SSD1289 and the ADS7843 to make sure that the uGFX drivers and overall code are still working. Result: Everything works fine out of the box (latest master branch).

As we can rule out issues on the uGFX side and hardware issues (you mentioned that your old binary still works) there's definitely something wrong with the board file or the underlying system initialization (eg. peripheral setup).

Now you mentioned that it sometimes senses but not correctly. Does this imply that it sometimes doesn't do anything? Can you please explain exactly and as accurate as possible what you see on the screen, what you're doing, what the reaction is etc. Can you just never pass the calibration screen because it tells you that calibration failed? Does the first cross show up but never vanish when you press the touchscreen?

You said that you checked the getpin_pressed() with an oscilloscope. Important to know is whether the board file function actually properly returns TRUE/FALSE. Please light up some LED when it returns TRUE and turn the LED off when it returns FALSE. Before the getpin_pressed() magic is not working 100% reliably there's no sense to digg any further.

I took a look at your board files again and I still can't find anything wrong. The only thing that's missing is initializing the IRQ pin properly. As you updated your Chibios it can be that the internal chibios board file changed and the default configuration is no longer working for your setup. For example the pin could now be a floating input rather than a pulled up one etc. This is why you should always initialize all of your required peripherals completely manually inside of the board_init()functions.

~ Tectu

Link to comment
Share on other sites

Ok, I think I give it up. I've tried with fresh OS, fresh uGFX and could not make it. Something was always wrong.

Thank you!

And thank you again for this awesome work! :) Maybe in the future I will try it again. If I would be a better programmer... :)

Link to comment
Share on other sites

Can you please post all your board files, your gfxconf.h file and whatever else is needed to build a basic version of your project preferably in a zip file or create a git hub or bitbucket repository.

Please be patient, this is all done in our spare time and I have been very busy with work.

Link to comment
Share on other sites

Yep, sorry for the long response time. Inmarket and I maintain this forum during our spare time and we're currently both very busy (but still happy to help when we can - just give it a bit of time).

There's definitely something very fishy going on. Please do as inmarket told you so we can verify it on our own.

And in general: It's not a very good thing that you post the response to a forum post on your blog as other people who use search engines to find answers to their problems will find this thread and they won't find all the related information in one place. So for the future please keep everything related in here. Long posts are no problem at all. The more details we get the better we can help.

Don't give up! You only get better when things don't work ;-)

~ Tectu

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