cancel
Showing results for 
Search instead for 
Did you mean: 

Error in code generation for TouchGFX

aroni525
Associate II

Hi,

When I generate the code with STM32CubeMX version 6.3 for STM32H747XIHx something like this happens:

0693W00000GWFLvQAP.png 

I have also noticed that when I chose TouchGFX component I am able to use it only with M4 core (this configuration was forced by CubeMX) what is also weird. This shouldn't matter which core uses LTDC/DSI and GFX library...

This is full "log"

FreeMarker template error (DEBUG mode; use RETHROW in production!):
The following has evaluated to null or missing:
==> data.parameters.tgfx_video  [in template "TouchGFXGeneratedHAL_cpp.ftl" at line 81, column 6]
 
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use [#if myOptionalVar??]when-present[#else]when-missing[/#if]. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
 
----
FTL stack trace ("~" means nesting-related):
	- Failed at: #if data.parameters.tgfx_video == "So...  [in template "TouchGFXGeneratedHAL_cpp.ftl" at line 81, column 1]
----
 
Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
	at freemarker.core.EvalUtil.compare(EvalUtil.java:198)
	at freemarker.core.EvalUtil.compare(EvalUtil.java:115)
	at freemarker.core.ComparisonExpression.evalToBoolean(ComparisonExpression.java:78)
	at freemarker.core.OrExpression.evalToBoolean(OrExpression.java:36)
	at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:48)
	at freemarker.core.Environment.visit(Environment.java:370)
	at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:291)
	at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271)
	at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244)
	at freemarker.core.Environment.visitIteratorBlock(Environment.java:644)
	at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108)
	at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.process(Environment.java:313)
	at freemarker.template.Template.process(Template.java:383)
	at com.st.microxplorer.codegenerator.CodeEngine.freemarkerDo(CodeEngine.java:324)
	at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:245)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:4774)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCode(CodeGenerator.java:4133)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCodeFile(CodeGenerator.java:1435)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:1666)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1285)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:2347)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:1939)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:618)
	at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:54)

Arek

14 REPLIES 14
MM..1
Chief II

Seems as your JAVA is corrupted, try update or reinstall.

Sara BEN HADJ YAHYA
ST Employee

Hi @aroni525​ ,

Could you please share your .ioc file?

Thanks,

Sara.

aroni525
Associate II

Hi!

I don't think my Java is corrupted, it would probably crash more often. The problem is only with one file - TouchGFXGeneratedHAL.cpp and with one processor - STM32H747XI. I have tried to do the same on a few different uC and it worked.

I generated minimal project for this purpose and the generated file is still corrupted. I attached the .ioc file

Sara BEN HADJ YAHYA
ST Employee

Hi @aroni525​ ,

Did you generate the code without verifying the dependencies in TouchGFX configuration ?

I checked your .ioc file and I found that the TouchGFX generator and the clock are not configured.

Regards,

Sara.

0693W00000GWUhIQAX.png

Ahhh, ok. I though you just want to look at the file if it is corrupted or something.

You can try this one - it has all parameters set properly.

Nevertheless, code should be generated even when some parameters are not correct - this happens for other MCUs.

Sara BEN HADJ YAHYA
ST Employee

Hi @aroni525​ ,

In the LTDC configuration you forgot to change the layer 0 pixel Format, if you set it to RGB888, the TouchGFXGeneratedHAL.cpp file will no longer have errors.

And if you want to use M7 core for TouchGFX component you just need to select Cortex-M7 in Show components for context in the Software Packs Component Selector ( Please refer to the figure below ).

Regards,

Sara.

0693W00000GWYOZQA5.png0693W00000GWYPIQA5.png

aroni525
Associate II

Thank you very much, it works indeed.

I didn't expect I have a wrong setting for Pixel Format, because everything was working fine (except code generation). But good that you have noticed this mistake.

Thanks,

Arek

RLarr.1
Associate II

I have the same issue too. However I need the ARGB8888 format. I am using the STM32F429IIT6. I have tried several combinations and nothing seems to work when ARGB8888 is selected in the TouchGFX Framebuffer Pixel Format. Selecting RGB888 generates code that compiles and will fill the framebuffer with RGB data so it appears everything is working.

I did notice the "Video Decoding" option goes away when Framebuffer Pixel Format ARGB8888 is selected. The variable this would generate appears to be related to the first error: (full details of the error are already listed above in an earlier post)

"The following has evaluated to null or missing:

==> data.parameters.tgfx_video [in template "TouchGFXGeneratedHAL_cpp.ftl" at line 81, column 6]"

Line 82 in the template file above is:

"

[#if data.parameters.tgfx_video == "Software" || data.parameters.tgfx_video == "Hardware"]"

Thanks,

Raymond

For what you need ARGB8888? In real one layer usage is background one color and alpha set transparency to this background color.

TouchGFX dont need alpha here.