• AVR Freaks

Helpful ReplyHot!MH3 fails to generate code

Author
M. G. Christensen
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2011/10/19 00:29:00
  • Location: 0
  • Status: offline
2019/06/23 16:19:37 (permalink)
5 (1)

MH3 fails to generate code

PIC32MX270F256B, MPLABX v5.20, Harmony v3.3.0, Fedora Linux.  Using MPLABX I generate a new Harmony 3 project.  Using the MHC, I add FreeRTOS, Core, TIME, TMR2.  DFP and SYSTEM are already present.  I connect TMR2 TMR to TIME TMR.  This gives a "Satisfied Direct Capability" for TMR2, and a "Satisfied Direct Dependancy" for TIME TMR. There is no consumer defined for TIME SYS_TIME.  When I generate code, I get this error:
 
<Generate>[Info]: 
<Generate>[Info]: *** Generating Configuration ***
<Generate>[Info]:
<Generate>[Info]: Validating file list.
<Generate>[Info]: Processing file list.
<FreeMarker>[Error]: An exception was thrown while attempting to markup a template file: /home/m/Microchip-MPLAB-Harmony.github.io/core/system/time/templates/system/system_initialize_data.c.ftl
<FreeMarker>[Error]: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> .vars["${SYS_TIME_PLIB?lower_case}"].COMPARE_SET_API_NAME [in template "system_initialize_data.c.ftl" at line 10, column 53]

----
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 be 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)??
----
Tip: It has been noticed that you are using ${...} as the sole content of a quoted string. That does nothing but forcably converts the value inside ${...} to string (as it inserts it into the enclosing string). If that's not what you meant, just remove the quotation marks, ${ and }; you don't need them. If you indeed wanted to convert to string, use myExpression?string instead.
----

----
FTL stack trace ("~" means nesting-related):
 - Failed at: ${.vars["${SYS_TIME_PLIB?lower_case}"... [in template "system_initialize_data.c.ftl" at line 10, column 51]
----
<FreeMarker>[Error]: - Failed at: ${.vars["${SYS_TIME_PLIB?lower_case}"... [in template "system_initialize_data.c.ftl" at line 10, column 51]
<Generate>[Info]: An exception occured during file preprocessing.
<MHC>[Info]: Stack trace filtered due to currently set log level. See "/home/m/.mh3/mhc.log" for full details.
<MHC>[Info]: To change log level filter see Tools->Options->Harmony in MPLABX
<Generate>[Error]: Aborting project generation. Your project has not been modified.

 
The log file included a java stack trace:
 
FTL stack trace ("~" means nesting-related):
 - Failed at: ${.vars["${SYS_TIME_PLIB?lower_case}"... [in template "system_initialize_data.c.ftl" at line 10, column 51]
----

Java stack trace (for programmers):
----
freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
 at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
 at freemarker.core.EvalUtil.coerceModelToString(EvalUtil.java:355)
 at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
 at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
 at freemarker.core.Environment.visit(Environment.java:324)
 at freemarker.core.MixedContent.accept(MixedContent.java:54)
 at freemarker.core.Environment.visit(Environment.java:324)
 at freemarker.core.Environment.process(Environment.java:302)
 at freemarker.template.Template.process(Template.java:325)
 at com.microchip.mh3.markup.Freemarker.markupFile(Freemarker.java:68)
 at com.microchip.mh3.generate.GenerateCommon.preprocessFileToString(GenerateCommon.java:90)
 at com.microchip.mh3.generate.engine.mplabx.GenerateEngineMPLABX.generate(GenerateEngineMPLABX.java:114)
 at com.microchip.mh3.generate.Generate$2.run(Generate.java:335)
 at java.lang.Thread.run(Thread.java:748)
INFO [org.netbeans.ui.indexing]: Indexing finished, indexing took 26 ms.

 
Something is missing, Iam not sure what it is.
 
Anyone else encounter this?
 
 
#1
M. G. Christensen
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2011/10/19 00:29:00
  • Location: 0
  • Status: offline
Re: MH3 fails to generate code 2019/06/24 20:50:15 (permalink) ☄ Helpfulby jstanle1_home 2019/11/18 15:14:24
0
Additional data:  I note that if I remove TMR2 from the project graph and insert the peripheral Core Timer, MH3 accepts that and generates code.'
 
Isn't the core timer part of the MIPS CPUand not a peripheral?
 
So, immediate problem solved but I have no idea why.
#2
boatbodger
Junior Member
  • Total Posts : 108
  • Reward points : 0
  • Joined: 2011/03/27 15:39:07
  • Location: 0
  • Status: offline
Re: MH3 fails to generate code 2020/02/04 03:11:39 (permalink)
0
I know this is an old post, but I had a similar problem, and may have inched closer to the triggering event.
I believe it was triggered by the following sequence:
- Starting a new (intentionally minimal) Harmony project, I inadvertently coupled the "TIME" system service to "TMR1", and not to "CORE TIMER". 
- I removed TMR1 from my graph, and replaced it with CORE TIMER, after which an attempt to ->CODE produced an error almost identical to the above.
Inspecting my config I found the following clause in the XML:
 
<UniqueComponent dnOrder="4" id="sys_time">
<Symbols dnOrder="0">
<String dnOrder="0" id="SYS_TIME_PLIB">
<Values dnOrder="0">
<Dynamic dnOrder="0" id="sys_time" value="CORE_TIMER"/>
<User dnOrder="1" value="TMR1"/>
</Values>
</String>
</Symbols>
 
By deleting the line starting <User dnOrder> it all generated properly.
 
My conclusion is that the act of deleting a unit from the graph did not fully remove it.
With hindsight, I think this may be something which happens easily if you try and change a project - other projects on which I have done this seem to produces code files far bigger than I would expect, and I have a hunch unwanted stuff is still being complied in.
I have to say that whilst the MHC code generator is a very clever piece of software, problems like this seriously undermine my confidence in what it is doing...
#3
ric
Super Member
  • Total Posts : 26972
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: MH3 fails to generate code 2020/02/04 05:27:29 (permalink)
5 (1)
Yes, there have been numerous reports that MHC works best when you start clean and only ever add things. It gets messy if you start turning things off again.

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#4
Jump to:
© 2020 APG vNext Commercial Version 4.5