cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMx freeze if DMA Event for SPI4 is activated

CKage.1
Associate

Hello,

if I generate with CubeMX 6.2.1 (Windows 10 or Ubuntu 20.04) the attached project, it freezes with the following screen:

0693W00000BdVm8QAF.pngMCU: STM32H7A3V(G-I)Tx

2021-07-13 09:20:39,936 [ERROR] runtime:60 - Error executing FreeMarker template
FreeMarker template error:
The following has evaluated to null or missing:
==> varName  [in template "ip_c.ftl" at line 420, column 82]
 
----
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: #assign indicatorName = varName + "."...  [in template "ip_c.ftl" in macro "generateConfigModelCode" at line 420, column 57]
	- Reached through: @generateConfigModelCode configModel=...  [in template "ip_c.ftl" in macro "generateConfigCode" at line 654, column 6]
	- Reached through: @generateConfigCode ipName=ipName typ...  [in template "ip_c.ftl" in macro "generateServiceCode" at line 859, column 3]
	- Reached through: @generateServiceCode ipName=words[i] ...  [in template "ip_c.ftl" at line 1399, column 9]
----
 
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.coerceModelToTextualCommon(EvalUtil.java:481)
	at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:401)
	at freemarker.core.AddConcatExpression._eval(AddConcatExpression.java:84)
	at freemarker.core.AddConcatExpression._eval(AddConcatExpression.java:57)
	at freemarker.core.Expression.eval(Expression.java:101)
	at freemarker.core.AddConcatExpression._eval(AddConcatExpression.java:57)
	at freemarker.core.Expression.eval(Expression.java:101)
	at freemarker.core.Assignment.accept(Assignment.java:134)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:376)
	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.visit(Environment.java:376)
	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.visit(Environment.java:376)
	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:370)
	at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
	at freemarker.core.Environment.invokeMacro(Environment.java:812)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
	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:376)
	at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
	at freemarker.core.Environment.invokeMacro(Environment.java:812)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:376)
	at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876)
	at freemarker.core.Environment.invokeMacro(Environment.java:812)
	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:376)
	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.visit(Environment.java:376)
	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:370)
	at freemarker.core.Environment.visitAndTransform(Environment.java:501)
	at freemarker.core.CompressedBlock.accept(CompressedBlock.java:42)
	at freemarker.core.Environment.visit(Environment.java:334)
	at freemarker.core.Environment.visit(Environment.java:340)
	at freemarker.core.Environment.visit(Environment.java:376)
	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:313)
	at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:235)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:4531)
	at com.st.microxplorer.codegenerator.CodeGenerator.generatePeriphConfigCode(CodeGenerator.java:2373)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:1609)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:8151)
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1197)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:2229)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:1900)
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:594)
	at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:44)
2021-07-13 09:20:39,942 [INFO] CodeEngine:323 - [Ljava.lang.StackTraceElement;@4b886fc9

Does anyone have an idea how I can get around this?

Best regards,

Christian

1 ACCEPTED SOLUTION

Accepted Solutions

Hello  @CKage.1​,

Let me first thank you for your feedback and welcome you to the STM32 Community 😊

Backing to your project, you're using "Enable event" for the "SPI4_TX" and "SPI4_RX" DMA request as well as the "Generate peripheral initialization as a pair of .c/.h files per peripheral" option:

0693W00000BdXC2QAN.pngWhen using "Enable event" for the DMA Requests when "Generate peripheral initialization as a pair of .c/.h files per peripheral" option is enabled, STM32CubeMX will generate code with this exception.

This misbehavior was reported internally to be fixed. The fix will be available as soon as possible, I'll surely keep you posted with the updates.

Thus, what I can propose in this case is whether to not to use the "Enable event" or uncheck "Generate peripheral initialization as a pair of .c/.h files per peripheral" option, normally your project will be correctly generated.

Sorry for any inconvenience that this may cause.

Khouloud.

View solution in original post

3 REPLIES 3

Hello  @CKage.1​,

Let me first thank you for your feedback and welcome you to the STM32 Community 😊

Backing to your project, you're using "Enable event" for the "SPI4_TX" and "SPI4_RX" DMA request as well as the "Generate peripheral initialization as a pair of .c/.h files per peripheral" option:

0693W00000BdXC2QAN.pngWhen using "Enable event" for the DMA Requests when "Generate peripheral initialization as a pair of .c/.h files per peripheral" option is enabled, STM32CubeMX will generate code with this exception.

This misbehavior was reported internally to be fixed. The fix will be available as soon as possible, I'll surely keep you posted with the updates.

Thus, what I can propose in this case is whether to not to use the "Enable event" or uncheck "Generate peripheral initialization as a pair of .c/.h files per peripheral" option, normally your project will be correctly generated.

Sorry for any inconvenience that this may cause.

Khouloud.

Hello Khouloud,

Thank you very much for the quick feedback.

I can confirm that the problem can be worked around by decativating "Generate peripheral initialization as a pair of .c/.h files per peripheral" or not using the events.

With this I can continue working for now and hope for a new version soon 🙂

Best regards,

Christian

Hi  @CKage.1​ 

Glad to know that this temporary solution have worked for you.

Please close this post by clicking the Select as Best button on my reply . This will help other members of the community find this response more quickly.

A new STM32CubeMX version will be available soon. Stay Tuned 😊

Khouloud.