Black screen on embedded board

Hi All

We start from an example of Qt (hellogl_es2) and we added texture to the ground, some billboard icons that rotate and updated the app to Qt5.7. While I only use gles2 functions in a qDebug I see that Qt5.7 is compiling for gles3.

std::string glVersion = reinterpret_cast<const char*>(glGetString(GL_VERSION));
std::string glslVer = reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION));
qDebug(“glVer: %s
glslVer: %s”, glVersion.c_str(), glslVer.c_str());

glVer: OpenGL ES 3.0 Mesa 12.0.6
glslVer: OpenGL ES GLSL ES 3.00

hellogl_es2 qt example works fine on both but in my app only black box is seen with nothing.}

GPU supports Open GL ES 3.1
Yocto distribution has partial support for GL ES 3.0
but Qt toolchain for crosscopile supports only GL ES 2.0

How do I force Qt to compile on gles2?

I’ve tried code like the following and it returns “2.0” but compiles to gles3.

QSurfaceFormat format;
format.setVersion(2,0);

int majorVersion = format.majorVersion();
int minorVersion = format.minorVersion();
qDebug(“Major Version %d”, majorVersion);
qDebug(“Minor Version %d”, minorVersion);

I appreciate who can help me.

Greetings.

Gustavo.