• AVR Freaks

Helpful ReplyHot!BUG: Harmony3 and Timer system service.

Author
Bodo2407
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/09/26 07:06:53
  • Location: 0
  • Status: offline
2019/11/27 00:03:10 (permalink)
0

BUG: Harmony3 and Timer system service.

Steps to reproduce:
Create a new project, using PIC32MX795F512L.
Start Harmony Configurator.
Add Time System Service to your project.
No RTOS.
Set TMR1 as satisfier for the time system service (or any other peripheral timer).
Press generate code.
An exception will be raised at code generation.
Harmony configurator v.3.4.0.
XC32 v.2.30.
 
Here is the content of the exception:
[Info]:
[Info]: *** Generating Configuration ***
[Info]:
[Info]: Validating file list.
[Info]: Processing file list.
[Error]: An exception was thrown while attempting to markup a template file: C:\Users\Forg.HS\HarmonyFramework\core\system\time\templates\system\system_initialize_data.c.ftl
[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. (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]
----
[Error]: - Failed at: ${.vars["${SYS_TIME_PLIB?lower_case}"... [in template "system_initialize_data.c.ftl" at line 10, column 51]
[Info]: An exception occured during file preprocessing.
[Error]: Exception cause: java.lang.Exception: Error during file preprocessing.
[Error]: Stack trace:
[Error]: com.microchip.mh3.generate.GenerateCommon.preprocessFileToString(GenerateCommon.java:93)
[Error]: com.microchip.mh3.generate.engine.mplabx.GenerateEngineMPLABX.generate(GenerateEngineMPLABX.java:114)
[Error]: com.microchip.mh3.generate.Generate$2.run(Generate.java:335)
[Error]: java.lang.Thread.run(Thread.java:748)
[Error]: Aborting project generation. Your project has not been modified.

#1
LostInSpace
Super Member
  • Total Posts : 286
  • Reward points : 0
  • Joined: 2016/03/11 22:47:59
  • Location: 0
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/11/29 11:19:10 (permalink) ☄ Helpfulby Bodo2407 2019/12/02 00:13:26
0
My opinion is to raise a support ticket on this issue,
https://microchipsupport.force.com/s/
They have been quite good at replying to issues I have raised in the past.
 
Hope this helps.
#2
Bodo2407
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/09/26 07:06:53
  • Location: 0
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/12/02 00:13:22 (permalink)
0
Thanks, I stopped searching where to raise a ticket after 10 minutes without any success to find an approbriate link.
#3
ric
Super Member
  • Total Posts : 25214
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: BUG: Harmony3 and Timer system service. 2019/12/02 00:26:43 (permalink)
5 (1)
http://support.microchip.com  or http://microchip.com/support would both have got you to the same place.
or just clicking the "Technical Support" icon on the home page at http://microchip.com
 
 

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
Jim Nickerson
User 452
  • Total Posts : 6427
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/12/02 08:37:07 (permalink)
0
I note on the pages linked there is a link on how to submit...

 

Attached Image(s)

#5
Jetoleg
Starting Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/08/19 06:43:41
  • Location: 0
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/12/02 10:30:04 (permalink) ☄ Helpfulby Bodo2407 2019/12/09 03:09:00
0
I had similar issue with PIC32MZ. Solution for me was to use Core Timer instead of Timer1/9 as a source for Time System Service. Service team told me that is a known issue. Hope this workaround works for MX as well as on MZ.
 
Update: Just confirmed, solution works for your target, no exception errors on Harmony code generation.
post edited by Jetoleg - 2019/12/02 10:40:41
#6
Bodo2407
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/09/26 07:06:53
  • Location: 0
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/12/09 03:08:16 (permalink)
0
Hi,
 
a ticket has been raised, the issue was replicated by the support and it was forwarded to the development team. Let's hope it gets fixed in the next release.
@Jetoleg: Thanks, I realized also that the core timer works, although it is not very precise. In example if I generate a delay by using the core timer, the failure of the timing is around 10%. Is that normal? This is even true for long delays like i.e. 300ms, so it cannot be an issue generated by function calls, etc.
 
void DelayMs(unsigned int ms){ 

SYS_TIME_HANDLE timer = SYS_TIME_HANDLE_INVALID;

    if (SYS_TIME_DelayMS(ms, &timer) != SYS_TIME_SUCCESS)
    {
        // Handle error
    }
    else if(SYS_TIME_DelayIsComplete(timer) != true)
    {
        // Wait till the delay has not expired
        while (SYS_TIME_DelayIsComplete(timer) == false);
    }
}
 
#7
Bodo2407
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/09/26 07:06:53
  • Location: 0
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/12/09 07:56:35 (permalink)
0
OK, the issue of the unprecise core timer has been solved. Out of any reason harmony persist to calculate FCY as 72MHz, which is in reality 80MHz. Whatever I do, I cannot bring it up to 80MHz. If I start a new project with the same settings, it works fine...
#8
vgandhi
Starting Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2016/10/24 21:28:35
  • Location: 0
  • Status: offline
Re: BUG: Harmony3 and Timer system service. 2019/12/17 23:53:07 (permalink)
0
For PIC32 MCUs, the H3 Timer System Service currently supports only the Core Timer. Other timer peripherals (TMR1 and so on) are currently not supported. This limitation stems from the fact that the Timer System Service currently only supports tickless mode which requires the underlying PLIB to have compare mode support available. The Core timer supports compare mode while other timer peripherals does not.
Support for other timer peripherals with Timer System Service will be available in the next release, where the Timer System Service will also support tick-based mode in addition to the existing tick-less mode; thereby allowing it to work with both the sets of timers (core timer and peripheral timers).
#9
Jump to:
© 2020 APG vNext Commercial Version 4.5