2026-06-05 3:03 AM
I am using online STMC board-designer tool to design my custom motor board. All great and fun, but when I click save, the only option I have is to share the board which is a json file. And that is not importable into STM32CubeMX for further file generation. So how do I do this?
I think I am missing a step. I am on Linux, so I use STM32CubeMX from Visual Studio Code, and I have also opened CubeIDE without any hint how to do this. I searched the Motor Control Workbench and while in Create Project there is boards section with my custom board in there, but then I need to select a motor - which is another step I am missing. I assume for starter I would just add the specification details of the motor, so that I could run it, and then connect the MotorPilot software to it, but I need some initial software running to even connect MotorPilot.
Thanks for the reply in advance.
2026-06-05 4:09 AM
OK, I found out I can clone existing motor and then change the parameters. However now I am stuck on below screen for PWM generation where it does not allow me to add any value, but also the error message is not really helpful. I must admit that dead time is just my estimate - I wanted bigger dead time to start with, as it might be better for the first runs.
Anyone has any ideas?
2026-06-05 2:55 PM - edited 2026-06-05 3:07 PM
OK, the deadTime was the issue (and minimum dead time on board), as they were mismatched. Now I am stuck with Project Generator after clicking Generate button is not working on wine - not rendering the dropdowns. Is it possible to execute Project Generator using existing .stwb6 file to generate code and .ioc file?
2026-06-05 3:54 PM
Dropdowns get rendered once you install STM32CubeMX into the wine directly. Now I need to verify or instantiate the MotorControl pack.
2026-06-06 2:38 PM
OK, now I managed to get CubeMX to generate the files, but there are many of them with the below error (for this example `Inc/mc_api.h`:
FreeMarker template error (DEBUG mode; use RETHROW in production!):^M
+Template inclusion failed (for parameter value "*/ftl/header.ftl"):^M
+Template not found for name "*/ftl/header.ftl".^M
+The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = FileTemplateLoader(baseDir="/home/bla", canonicalBasePath="/home/bla/"), loader2 = FileTemplateLoader(baseDir="/home/bla", canonicalBasePath="/home/bla"), loader3 = FileTemplateLoader(baseDir="/home/bla/STM32CubeMX/db/templates", canonicalBasePath="/home/bla/STM32CubeMX/db/templates/")).^M
+^M
+----^M
+FTL stack trace ("~" means nesting-related):^M
+ - Failed at: #include "*/ftl/header.ftl" [in template "mc_api.h.ftl" at line 2, column 1]^M
+----^M
+^M
+Java stack trace (for programmers):^M
+----^M
+freemarker.core._MiscTemplateException: [... Exception message was already printed; see it above ...]^M
+ at freemarker.core.Include.accept(Include.java:164)^M
+ at freemarker.core.Environment.visit(Environment.java:334)^M
+ at freemarker.core.Environment.visit(Environment.java:340)^M
+ at freemarker.core.Environment.process(Environment.java:313)^M
+ at freemarker.template.Template.process(Template.java:383)^M
+ at com.st.microxplorer.codegenerator.CodeEngine.freemarkerDo(CodeEngine.java:454)^M
+ at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:303)^M
+ at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:6687)^M
+ at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCode(CodeGenerator.java:5473)^M
+ at com.st.microxplorer.codegenerator.CodeGenerator.generateSpecificCodeFile(CodeGenerator.java:1905)^M
+ at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:2285)^M
+ at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:11373)^M
+ at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1611)^M
+ at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:3468)^M
+ at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:2271)^M
+ at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:821)^M
+ at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:61)^M
+Caused by: freemarker.template.TemplateNotFoundException: Template not found for name "*/ftl/header.ftl".^M
+The name was interpreted by this TemplateLoader: MultiTemplateLoader(loader1 = FileTemplateLoader(baseDir="/home/bla", canonicalBasePath="/home/bla/"), loader2 = FileTemplateLoader(baseDir="/home/bla", canonicalBasePath="/home/bla/"), loader3 = FileTemplateLoader(baseDir="/home/bla/STM32CubeMX/db/templates", canonicalBasePath="/home/bla/STM32CubeMX/db/templates/")).^M
+ at freemarker.template.Configuration.getTemplate(Configuration.java:2869)^M
+ at freemarker.core.Environment.getTemplateForInclusion(Environment.java:2883)^M
+ at freemarker.core.Include.accept(Include.java:162)^M
+ ... 16 more^M
2026-06-08 8:40 AM
Hello @Letme,
Use the MCSDK Tool to generate a new project.
In the generated project, a "ftl" is created. Copy the ftl directory in your project.
2026-06-08 12:02 PM
Hi @GMA
What is MCSDK Tool? I generated the ioc file with STMCWB (Motor Workbench), but then I assume IOC file goes into CubeMX. In the folder where ioc was generated there is no ftl file or ftl directory. But I found those missing files in the MotorControl.zip in MCSDK, then I unzipped them and copied templates from template folder into the STM32CubeMX/db/templates as well as created ftl folder there and copied ftl folder from the unzipped package as well. And it worked. The files are now generated as they should (hopefully). This was a lot of manual work, so can you check if I didn't miss something?
Thanks for the hint - it helped.
2026-06-08 11:01 PM
Hello @Letme,
MCSDK Workbench tool, sorry. Use GENERATE button, and OPEN FOLDER once generated.
2026-06-08 11:49 PM
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.