Jump to content

graph doesn't render in some cases


riktw

Recommended Posts

Hello

I got uGFX working after a while with a 32F429IDISCOVERY. I can draw 2 buttons and each button controls an LED.

I wanted to add a graph and there is why it went wrong. I eventually managed to draw a graph underneath the buttons and I can add datapoints. But if I add a variable in my main, so just "int test;" and assign it a value "test = 42;" then my graph isn't rendered anymore.

This code works: http://pastebin.com/057a2aZX and this code does not: http://pastebin.com/G0kDwLfR

The only difference is that on line 118/119 I declare a variable and assign it a value. The buttons do still work however. If I debug the code it seems that "gh = gwinGraphCreate(&g, &wii);" goes wrong and returns NULL for gh. But why a variable somewhere else causes that, no clue.

I don't use an OS and it's a st32coremx based project. So it uses the stm32f4 hal drivers and GCC as the compiler. I hope someone knows what is going on here :)

Best regards,

Rik

Link to comment
Share on other sites

Hello and welcome to the community!

I used a diff tool to ensure that the only difference really is declaring that variable, and indeed it is.
Getting a nullpointer back from gwinXxxCreate() usually indicates insufficient heap space. However, you are using a static GGraphObject so this can't be the issue. Adding that variable doesn't do anything but increasing the stack size of the main() function. Therefore, I suspect this to be an issue with hitting the max. stack size. However, that would be a very rare case.
I assume that you did the standard debugging steps already (like doing a clean build, trying adding other variables of different sizes and so on...)?

I'd strongly recommend you to try running your uGFX application on a desktop such as Windows, Linux or Mac OS X which are all support out of the box.
If you can provide us with a full, yet minimal test case that allows us to reproduce the problem we can further investigate.

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