cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx v4.18.0 with SPI screen bug at software generation

ABricout
Associate III

Hello,

I am trying to use touchgfx with a SPI screen.

The screen is black and white so i use a single buffer by allocation (it fits in y RAM). The interface is custom because of the spi bus.

I am configuring the project with the liked project.ioc file and the software generation of touchgfx is incomplete for a reason that I cannot understand:

/**
  ******************************************************************************
  * File Name          : TouchGFXGeneratedHAL.cpp
  ******************************************************************************
  * This file is generated by TouchGFX Generator 4.18.0. Please, do not edit!
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  * All rights reserved.</center></h2>
  *
  * This software component is licensed by ST under Ultimate Liberty license
  * SLA0044, the "License"; You may not use this file except in compliance with
  * the License. You may obtain a copy of the License at:
  *                             www.st.com/SLA0044
  *
  ******************************************************************************
  */
 
 
 
 
#include <TouchGFXGeneratedHAL.hpp>
#include <touchgfx/hal/OSWrappers.hpp>
#include <gui/common/FrontendHeap.hpp>
 
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.generateDefaultConfig(CodeGenerator.java:8557)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1221)
	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.ProjectBuilder.createProject(ProjectBuilder.java:434)
	at com.st.microxplorer.plugins.projectmanager.engine.MainProjectManager.startGenerateCode(MainProjectManager.java:1508)
	at com.st.microxplorer.plugins.projectmanager.engine.MainProjectManager$3.onCommandEntered(MainProjectManager.java:235)
	at com.st.components.util.CommandLineManager$3.run(CommandLineManager.java:168)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

I am using a timer for the Vsync signal (10Hz working). And my SPI screen driver is working just fine if I use it manually, it should be really easy to set it up together.

Do you have an idea of why is it not working?

Also my screen can work on FMC 8 bits which is not supported by touchgfx. If my problem does not meet a solution could you tell me if the FMC 8bit is going to be supported or can be added manually?

I thank you by advance,

Augustin

1 ACCEPTED SOLUTION

Accepted Solutions
Clancy Duncan
Associate

Hi, I had the same issue.

I just downgraded to TouchGFX Generator v4.17.0 and reloaded the project in TouchGFX Designer and it worked fine.

You can still use TGFX Designer v4.18.0 even if you are using v4.18.0 Generator code.

Looks like something that will be fixed in the next update.

View solution in original post

4 REPLIES 4
ABricout
Associate III

Hello,

I have news on my issue, it seems that the software if generated well when I choose the RGB565 piwel format but not with BW grey2 or grey4 format.

Do you know if they have been tested?

Also I used the software that is generated by the RGB565 format to patch the missing parts but it looks like touchgfx never sets up data in the framebuffer and the void TouchGFXHAL::flushFrameBuffer(const touchgfx::Rect& rect) is never called even though I go in the hal.backPorchExited(); which should trigger the next frame.

I am waiting for your answer

Regards

Augustin

Clancy Duncan
Associate

Hi, I had the same issue.

I just downgraded to TouchGFX Generator v4.17.0 and reloaded the project in TouchGFX Designer and it worked fine.

You can still use TGFX Designer v4.18.0 even if you are using v4.18.0 Generator code.

Looks like something that will be fixed in the next update.

ABricout
Associate III

Hello,

Thank you very much, it worked to generate the software!

And I had to have the framebuffer work by address instead of allocation. Then you have to manually create an array for the framebuffer and modify the TouchGFXGeneratedHAL.cpp file to delace the corresponding address of the framebuffer.

I hope it'll be fixed in the next version

Thanks again

Hi,

No problem, glad it helped you out.

I'm a bit new to this stuff, and I am also trying to use a BW SPI screen with touchGFX. If at all possible, could I see what you have done thus far to get the screen working with tgfx? The ST documentation gives plenty of scenario example but I am still having trouble.