AnsweredAssumed Answered

CubeMX bug report: error in generating stm32f4xx_it.c

Question asked by Liviu Ionescu on Aug 2, 2016
Latest reply on Jan 6, 2017 by Sirma Siang
Hi,

If in NVIC Configuration -> Code Generation, none of the IRQ handlers are selected, the generated stm32f4xx_it.c file is not generated, but reads a java backtrace:


/* Includes ------------------------------------------------------------------*/

#include "stm32f4xx_hal.h"

#include "stm32f4xx.h"

#include "stm32f4xx_it.h"

Expression requireSystemClockConfig is undefined on line 51, column 8 in stm32xx_it_c.ftl.

The problematic instruction:

----------

==> if requireSystemClockConfig [on line 51, column 3 in stm32xx_it_c.ftl]

----------

Java backtrace for programmers:

----------

freemarker.core.InvalidReferenceException: Expression requireSystemClockConfig is undefined on line 51, column 8 in stm32xx_it_c.ftl.

at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)

at freemarker.core.Expression.isTrue(Expression.java:145)

at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)

at freemarker.core.Environment.visit(Environment.java:196)

at freemarker.core.MixedContent.accept(MixedContent.java:92)

at freemarker.core.Environment.visit(Environment.java:196)

at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:79)

at freemarker.core.Environment.visit(Environment.java:196)

at freemarker.core.MixedContent.accept(MixedContent.java:92)

at freemarker.core.Environment.visit(Environment.java:196)

at freemarker.core.Environment.visit(Environment.java:233)

at freemarker.core.CompressedBlock.accept(CompressedBlock.java:73)

at freemarker.core.Environment.visit(Environment.java:196)

at freemarker.core.MixedContent.accept(MixedContent.java:92)

at freemarker.core.Environment.visit(Environment.java:196)

at freemarker.core.Environment.process(Environment.java:176)

at freemarker.template.Template.process(Template.java:232)

at com.st.microxplorer.codegenerator.CodeEngine.freemarkerDo(CodeEngine.java:225)

at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:164)

at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:1707)

at com.st.microxplorer.codegenerator.CodeGenerator.generatePeriphConfigCode(CodeGenerator.java:1026)

at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:816)

at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:555)

at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:781)

at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:688)

at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:393)

at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:37)


---

The reason for this configuration is a custom SysTick_Handler, that needs to call C++ code, so it cannot be located in a .c file.


I'm using 4.16, on macOS.

Regards,

Liviu


Outcomes