BrewBot
Junior Member
busy
Posts: 21
|
Post by BrewBot on May 20, 2015 8:59:55 GMT -8
I am designing a simple menu system consisting of buttons (cmd_button) and some text.
Occasionally I get an error code r=4095 printed out via serial and the program freezes.
What is this error code (I read something about buffer overflow but Im not sure what that is) and how do we go about avoiding this?
|
|
|
Post by jamesbowman on May 22, 2015 6:56:13 GMT -8
This error really means "coprocessor exception" - the GPU's coprocessor has hit a fault.
One common cause is overflowing the display list RAM of the GPU. Each drawing command or widget goes into a display list, which is 8K long. You can find out how much of the display list is used at any point in frame drawing by doing:
GD.finish(); Serial.println(GD.rd16(REG_CMD_DL)); By putting this at various points in your drawing loop you can see if it it getting close to the 8K limit.
|
|
BrewBot
Junior Member
busy
Posts: 21
|
Post by BrewBot on Jul 30, 2015 11:32:24 GMT -8
Quick update:
Using the code as James mentioned above is exactly what I need.
I can now see how full the buffer is at any point in the program. And also see what graphical commands are using up a lot of space.
|
|
|
Post by jamesbowman on Jul 30, 2015 15:53:07 GMT -8
Cool. One easy fix for complex screens is to use OPT_FLAT for the 'options' argument to cmd_button. Switching off the 3D decoration for buttons saves a bunch of space.
|
|