2021-11-26 04:20 AM
How to migrate existing project made with CubeMX and Designer 4.17 to version 4.18?
Tried it with selecting 4.18 in CubeMX->Software Packs and got this:
#include <TouchGFXGeneratedHAL.hpp>
#include <touchgfx/hal/OSWrappers.hpp>
#include <gui/common/FrontendHeap.hpp>
#include <touchgfx/hal/GPIO.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)
Solved! Go to Solution.
2021-12-16 11:30 PM
Hey!
No, I made a new project. Then copied old .ioc file and my source files to the new project, then in Designer imported old .touchgfx project. That worked.
2021-12-16 10:50 PM
Hello VLau,
The migration is supposed to be very straightforward.
Do you still struggle or you have found a solution ?
/Alexandre
2021-12-16 11:30 PM
Hey!
No, I made a new project. Then copied old .ioc file and my source files to the new project, then in Designer imported old .touchgfx project. That worked.
2021-12-16 11:50 PM
Hello VLau,
I performed countless migrations and I never had any issue like the one you showed so I'm a bit surprised.
Anyway glad you found a solution :)
/Alexandre
2021-12-17 01:01 AM
Forgot to add, I had to exclude "Videos" folder from CubeIDE project otherwise it wouldn't compile
2021-12-30 03:16 AM
Ok, after update Cube firmware on my H7 MCU, I get that message in TouchGFXGeneratedHAL.cpp again. Now I tried everything, including starting my project from zero. Any code regeneration from CubeMX leads to that. No idea what to do now :(
2022-01-02 05:19 PM
Hello VLau,
If you can, please share a simple project where you get the issue.
Maybe just providing the ioc file could be enough.
Also when you say, you started your project from zero again, did you do that with 4.18 or 4.17 ? If I decided to start from zero again I would definitely take the latest version from the beginning and avoid the migration process.
Anyway, hope we can find what is the issue in your setup or if there's really a bug that we haven't reproduced yet on our side.
/Alexandre
2022-01-09 11:04 PM
I started project with latest CubeMX and TGFX version 4.18.1. Now it's fine.