• AVR Freaks

Hot!Fail to generate code in HC removing one of two SPI module

Author
thoraz
Junior Member
  • Total Posts : 108
  • Reward points : 0
  • Joined: 2013/06/01 18:37:43
  • Location: 0
  • Status: offline
2020/07/16 06:29:17 (permalink)
0

Fail to generate code in HC removing one of two SPI module

I started my Harmony v3 project using two SPI module (SPI2 and SPI3 in attached file). Now I don't need the SPI2 anymore and I want delete it from the HC. But wehn I do it and generate the code, I get "An exception occured during file preprocessing" (attached file).
If I disconnect the SPI2 module from the SPI Driver Instance 0, then connect the SPI3 to Driver Instance 0 and remove the Driver Instance 1, the Hc generate the code properly unless I delete the SPI2 module.
 
What's the problem here?

Attached Image(s)

#1

8 Replies Related Threads

    vgandhi
    Senior Member
    • Total Posts : 40
    • Reward points : 0
    • Joined: 2016/10/24 21:28:35
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/16 07:10:09 (permalink)
    0
    Please mention the H3 version for CSP and Core and the MCU used to reproduce the issue. Also share the console log in MHC when the error occurs. See the attached screenshot.
     
    post edited by vgandhi - 2020/07/16 07:11:22

    Attached Image(s)

    #2
    thoraz
    Junior Member
    • Total Posts : 108
    • Reward points : 0
    • Joined: 2013/06/01 18:37:43
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/16 07:11:58 (permalink)
    0
    vgandhi
    Please mention the H3 version for CSP and Core and the MCU used to reproduce the issue. Also share the console log in MHC when the error occurs. See the attached screenshot.
     



    I can't see your attachet screenshot sad: sad
    #3
    thoraz
    Junior Member
    • Total Posts : 108
    • Reward points : 0
    • Joined: 2013/06/01 18:37:43
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/16 07:12:23 (permalink)
    0
    No, ok now I can. Sorry
     
    #4
    thoraz
    Junior Member
    • Total Posts : 108
    • Reward points : 0
    • Joined: 2013/06/01 18:37:43
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/16 07:21:25 (permalink)
    0
    vgandhi
    Please mention the H3 version for CSP and Core and the MCU used to reproduce the issue. Also share the console log in MHC when the error occurs. See the attached screenshot.
     




    H3 - version 3.5.0
    MCU - PIC32MZ2048EFG100
     
    Here the logs from console
     
     
    <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: C:\Microchip\Harmony\v3\core\driver\spi\templates\system\system_initialize_data.c.ftl
    <FreeMarker>[Error]: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
    ==> .vars["${DRV_SPI_PLIB?lower_case}"] [in template "system_initialize_data.c.ftl" at line 15, column 36]

    ----
    Tip: It's the final [] step 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["${DRV_SPI_PLIB?lower_case}"]... [in template "system_initialize_data.c.ftl" at line 15, column 34]
    ----
    <FreeMarker>[Error]: - Failed at: ${.vars["${DRV_SPI_PLIB?lower_case}"]... [in template "system_initialize_data.c.ftl" at line 15, column 34]
    <Generate>[Info]: An exception occured during file preprocessing.
    <MHC>[Info]: Stack trace filtered due to currently set log level. See "C:\Users\Andrea\.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.

     
    #5
    thoraz
    Junior Member
    • Total Posts : 108
    • Reward points : 0
    • Joined: 2013/06/01 18:37:43
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/29 03:28:19 (permalink)
    0
    Any suggestions?
    #6
    vgandhi
    Senior Member
    • Total Posts : 40
    • Reward points : 0
    • Joined: 2016/10/24 21:28:35
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/29 03:43:07 (permalink)
    0
    @thoraz, I am unable to recreate the issue with CSP v3.7.x. Can you update your CSP with the latest release and see if the issue still persists?
    #7
    thoraz
    Junior Member
    • Total Posts : 108
    • Reward points : 0
    • Joined: 2013/06/01 18:37:43
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/29 05:28:19 (permalink)
    0
    vgandhi
    @thoraz, I am unable to recreate the issue with CSP v3.7.x. Can you update your CSP with the latest release and see if the issue still persists?


    I've updated the CSP to the 3.7.1 version through the Harmony Content Manager (v1.4.0) and I took the opportunity to update all the packages, but...now I can't start the Harmony Configurator since I get the error

     
    The dettails are
     
    java.lang.ClassNotFoundException: freemarker.cache.TemplateLoader
     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    Caused: java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Class.java:348)
     at com.microchip.mplab.modules.mh3.MHCLauncher.loadLauncherJar(MHCLauncher.java:389)
     at com.microchip.mplab.modules.mh3.MHCLauncher.Launch(MHCLauncher.java:154)
     at com.microchip.mplab.modules.mh3.MHCLauncher.PreLaunch(MHCLauncher.java:128)
     at com.microchip.mplab.modules.mh3.MH3OpenActionPerformed.actionPerformed(MH3OpenActionPerformed.java:23)
     at org.openide.awt.AlwaysEnabledAction$1.run(AlwaysEnabledAction.java:199)
     at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:95)
     at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
     at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
     at org.openide.awt.AlwaysEnabledAction.actionPerformed(AlwaysEnabledAction.java:202)
     at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
     at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
     at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
     at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
     at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
     at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
     at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
     at java.awt.Component.processMouseEvent(Component.java:6539)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
     at java.awt.Component.processEvent(Component.java:6304)
     at java.awt.Container.processEvent(Container.java:2239)
     at java.awt.Component.dispatchEventImpl(Component.java:4889)
     at java.awt.Container.dispatchEventImpl(Container.java:2297)
     at java.awt.Component.dispatchEvent(Component.java:4711)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
     at java.awt.Container.dispatchEventImpl(Container.java:2283)
     at java.awt.Window.dispatchEventImpl(Window.java:2746)
     at java.awt.Component.dispatchEvent(Component.java:4711)
     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
     at java.awt.EventQueue.access$500(EventQueue.java:97)
     at java.awt.EventQueue$3.run(EventQueue.java:709)
     at java.awt.EventQueue$3.run(EventQueue.java:703)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
     at java.awt.EventQueue$4.run(EventQueue.java:733)
     at java.awt.EventQueue$4.run(EventQueue.java:731)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
     at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
    [catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

     
     

    Attached Image(s)

    #8
    thoraz
    Junior Member
    • Total Posts : 108
    • Reward points : 0
    • Joined: 2013/06/01 18:37:43
    • Location: 0
    • Status: offline
    Re: Fail to generate code in HC removing one of two SPI module 2020/07/29 06:37:39 (permalink)
    0
    I found a solution for both the problems:
     
    1) The error at launch of the Harmony Configurator was due to the missing .jar file freemarker in the <harmony folder>/mhc (as read in the log file: Caused: java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader). I had to delete the mhc packet through the Harmony Content Manager and then reinstall it. Now I can launch the HC! Good!
     
    2) About the main problem, the SPI2 module that I couldn't remove from the HC, was due to the SPI Driver: when I remove the connection to the driver's instances, they keep the reference of "PLIB Used". In my case I was trying to connect the SPI3 module to the instance_0 (previously connected to the SPI2 module), but the instance was again linked to the PLIB of SPI2. This is why I had to keep the SPI2 module in the project to allow HC to generate the code. The solution was to delete also the SPI Driver, add it to the project again, connect the SPI3 to instance 0 and delete the SPI2 module.
     
    Now all works!
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5