• AVR Freaks

Hot!Code generation failure: "An exception occured during file preprocessing"

Author
rdpoor
Junior Member
  • Total Posts : 25
  • Reward points : 0
  • Joined: 2019/06/08 02:17:19
  • Location: 0
  • Status: offline
2020/08/21 09:12:38 (permalink)
5 (1)

Code generation failure: "An exception occured during file preprocessing"

(Note: since I'm getting bitten by "unauthorized" messages from the forum server, I'm posting this in several segments...)

Summary:

Attempting one of my first complex projects under MPLAB / Harmony.  When I click "generate", I get the following on the console:
 

<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:\Users\r\Projects\Harmony3\core\system\time\templates\system\system_config.h.ftl
<FreeMarker>[Error]: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> .vars["${SYS_TIME_PLIB?lower_case}"] [in template "system_config.h.ftl" at line 4, column 48]

----
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["${SYS_TIME_PLIB?lower_case}"... [in template "system_config.h.ftl" at line 4, column 46]
----
<FreeMarker>[Error]: - Failed at: ${.vars["${SYS_TIME_PLIB?lower_case}"... [in template "system_config.h.ftl" at line 4, column 46]
<Generate>[Info]: An exception occured during file preprocessing.
<MHC>[Info]: Stack trace filtered due to currently set log level. See "C:\Users\r\.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.
<Manifest>[Info]: Manifest info has been written in file : C:\Users\r\Projects\Clients\github\Rev_B_Bringup\firmware\src\config\default\harmony-manifest-failure.yml

 
 
#1

7 Replies Related Threads

    rdpoor
    Junior Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2019/06/08 02:17:19
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 09:19:10 (permalink)
    0

    Some Details:


    Rev_B_Bringup
    Project Type: Application - Configuration: default
    Device
    ATSAME54P20A
     Checksum: Debug Image
     CRC32: Hex file unavailable
    Packs
    CMSIS (5.4.0)
    SAME54_DFP (3.3.64)
    Compiler Toolchain
    XC32 (v2.40) [C:\Program Files\Microchip\xc32\v2.40\bin]
    Debug Image: ELF: Optimization: gcc O1 g++ O1
    Linker Reserved Heap: 512 (0x200) bytes
    Memory
    Data 270,336 (0x42000) bytes
    Data Used: 0.0%
    Data Used: 40 (0x28) Free: 270,296 (0x41FD8)
    Program 1,048,576 (0x100000) bytes
    Program Used: 0.2%
    Program Used: 1,582 (0x62E) Free: 1,046,994 (0xFF9D2)
    Debug Tool
     Simulator
    Click for Simulated Peripherals
    Debug Resources
    Program BP Used: 0 Free: 1000
    Data BP Used: 0 Free: 1000
    Data Capture BP: No Support
    Unlimited BP (S/W): Simulator

    Other Project Info
    Data Reserved Memory

    Program Reserved Memory


    Control Points.

    Java NetBeans Properties
    MPLAB X IDE v5.35 - Rev_B_Bringup : default
                       os.name : Windows 10
                       os.arch : amd64
                    os.version : 10.0
           sun.arch.data.model : 64
              sun.java.command : null
                  java.version : 1.8.0_181
               java.vm.version : 25.181-b13
          java.runtime.version : 1.8.0_181-b13
    java.specification.version : 1.8
                 netbeans.user : C:\Users\r\AppData\Roaming\mplab_ide\dev\v5.35
                 netbeans.home : C:\Program Files (x86)\Microchip\MPLABX\v5.35\mplab_platform\platform
         netbeans.projects.dir : C:\Users\r\MPLABXProjects
                java.io.tmpdir : C:\Users\r\AppData\Local\Temp\mplab_ide
                     user.home : C:\Users\r
                  user.country : US
                 user.language : en
                 user.timezone : America/Los_Angeles
              sun.jnu.encoding : Cp1252
                 file.encoding : Cp1252
                file.separator : \

    Java & System Memory
             Java Total Memory = 1865 Mb
             Java Used Memory = 1250 Mb
             Java Free Memory = 615 Mb
    CommittedVirtualMemorySize = 2888 Mb
        FreePhysicalMemorySize = 19817 Mb
                 SystemCpuLoad = 0 Mb
                ProcessCpuLoad = 0 Mb
       TotalPhysicalMemorySize = 32636 Mb

    #2
    rdpoor
    Junior Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2019/06/08 02:17:19
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 09:25:05 (permalink)
    0

    More Details:

    I am getting an error in my Harmony configuration, which may or may not be related to this error.  Specifically, on an SDHC1 module, I am getting the warning:
    !!!Configure SDHC Slow Clock in Clock Configuration!!!
    ... however, I believe I HAVE configured the slow clock:

     
    So I'm stumped.  If the failure to compile is due to this problem, then I'll file a separate issue and ask how to configure the SDHC1 slow clock.
     

    Attached Image(s)

    #3
    vgandhi
    Senior Member
    • Total Posts : 52
    • Reward points : 0
    • Joined: 2016/10/24 21:28:35
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 09:50:09 (permalink)
    0
    Can you post a screenshot of the project graph?
    #4
    rdpoor
    Junior Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2019/06/08 02:17:19
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 10:27:51 (permalink)
    0

    Attached Image(s)

    #5
    rdpoor
    Junior Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2019/06/08 02:17:19
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 10:31:14 (permalink)
    0
    ... and while I'm at it, the clocks may be useful as well:
     
     

    Attached Image(s)

    #6
    vgandhi
    Senior Member
    • Total Posts : 52
    • Reward points : 0
    • Joined: 2016/10/24 21:28:35
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 11:31:21 (permalink)
    5 (1)
    The error is related to SYS Time. The SDHC clock configurations look fine. The message is to indicate to the user that the slow clock needs to be configured, which you already have.
    I tried connecting RTC PLI to SYS Time component and did not see any error. 
    Can you try out the example application available here that uses SDHC driver, File System and Sys Time components - https://github.com/Microchip-MPLAB-Harmony/core/tree/master/apps/fs/sdmmc_fat/firmware and see if you run into similar issue with this as well?
     
    Also, what is the version of CSP and Core repositories/modules being used?
    (The version information is available in the <harmony-install-path>/csp/release_notes.md and <harmony-install-path>/core/release_notes.md file)
    #7
    rdpoor
    Junior Member
    • Total Posts : 25
    • Reward points : 0
    • Joined: 2019/06/08 02:17:19
    • Location: 0
    • Status: offline
    Re: Code generation failure: "An exception occured during file preprocessing" 2020/08/21 11:57:55 (permalink)
    5 (1)
    ## CSP Release v3.7.1
    ## Core Release v3.7.2
     
    (FWIW, I recently upgraded to MPLAB X 5.40, but quickly rolled back to 5.35 since too much wasn't working.  See https://www.microchip.com/forums/m1149957.aspx for why I rolled back...)
     
    I'll try out the FAT FS example as soon as I grind through a few ToDo items on my client list.  Thank you in advance.
    #8
    Jump to:
    © 2020 APG vNext Commercial Version 4.5