This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HalCodeGen: Undefined in saving

Other Parts Discussed in Thread: HALCOGEN

I have noticed that whenever I go to save a project, I get an undefined, but "Save complete" as well.

Is there a way to get verbose information or find out what is "undefined" and how to fix the problem?

  • I will need to pass your finding to HalCoGen team. Normally I just generate code as it will both generate and save project.
  • I await hearing back from you.

    I should add that HalCoGen DID generate code, but throws the undefined. I just do not like leaving errors as doing so has a way to come back and bite me. I also like a zero error/warning build environment.

    As an added comment for HalCoGen, there is no way to select and copy the output text. I tried. That is why I took a screenshot. HalCoGen should allow for copying and pasting.
  • Hi Charles,

    I just noticed (yeah, I am slow on the uptake), the two (one really) error messages at the top, when you load a project (at least mine).

    I did a search across files and came up with only the one hit, in the DLL. I am not sure if the undefined error and this new error are related, but they are HalCoGen errors, nonetheless.

    Searching for: PMM_LOGIC_PD2_STATEVALUE
    C:\SoftDev\TiWorkspaces\CCMv3\Versions\Current\CCMv3\CCMv3.dil(106): DRIVER.SYSTEM.VAR.PMM_LOGIC_PD2_STATEVALUE.VALUE=10
    Found 1 occurrence(s) in 1 file(s), 5139 ms

    What do you make of this new error (see above)?
  • Hi Sarah,
    Can you attached the HalCoGen .hcg and .dil file so our HalCoGen team can try to reproduce?
  • HI Charles, how do I upload a file? If I select "Insert File" from the toolbar, the GUI thinks that the file is an image, no different than if I click on the insert media link to the left of the insert file. That is not a problem, but clicking on POST yields a red box and then nothingness.

    Do you have an email address that I can send the files to or explain how to upload the 2 files.

  • Okay, I saw the error message, so here is the file 7-zipped.

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/312/3108.CCMv3.7zSarah

  • Sarah,
    I have forwarded your HalcoGen project file to the HalCoGen team.
  • Hi,

    That was a print statement we added to get some debug information regarding the USB module during the development time. It shows undefined since the entries in the USB tab are empty.

    But it should not affect your dil file or the generated code in any manner. It was added just for debugging which we missed to remove. I will make sure it is removed in the next HALCoGen release.

    Thanks and Regards,

    Veena

  • And the 2 errors at the top?
  • Hi,

    This error also will not affect your dil file or the generated code. I will definitely raise a ticket to fix this issue.

    I can explain you the reason why it is occurring.

    The variable PMM_LOGIC_PD2_STATEVALUE can take in 2 possible values - 0x5 and 0xA (default is 0x5). Since you disabled that power domain the value must change to 0xA. But for some reason, the scripts which are running in the back end saved the variable with value 10 (instead of "0xA"). But in the generated code, it doesn't matter whether the value written is 0xA or 10 since both are equal.

    I will make sure this issue is fixed on the next HALCoGen release. Still, you can go with this version of HALCoGen as it will not affect the generated code.

    Thanks and Regards,

    Veena

  • I found the Power Domain Management settings, and yes I do have to disable Power Domain 2 and 4.

    1.1 Initialize the Power Management Module to enable Core Block #3 and #5, and disable Core Blocks #2, and #4. Write 0x0A050A05 to the LOGICPDPWRCTRL0 register at 0xFFFF0000. Initialize the Power Management Module to enable RAM Memory Blocks #1, #2, and #3. Write 0x09090900 to the MEMPDPWRCTRL0 register at 0xFFFF0010.

    Where in the generated code would I find these settings?

    I see the description of the Power Management module is:

    The PMM provides memory-mapped registers that control the states of the supported power domains. The PMM includes interfaces to the Power Mode Controller (PMC) and the Power State Controller (PSCON). The PMC and PSCON control the power up/down sequence of each power domain.

    That does not help me very much. What would be a layman's definition of what that does?

  • I enabled PD1 and then saw the error with 5 rather than 10. I then disabled PD1 again and back to the original error. The bug is with HalCoGen writing decimal and not hexadecimal, as I can reproduce the problem at will.
  • Also, you forgot to address the VCKL3 error, see copy here:

    As you can see from the modification and the screenshot, I do have VCLK3 enabled, not disabled. What is the problem with the ARCH/DRIVER expectation?

    /* USER CODE BEGIN (12) */
    systemREG1->CDDISSET = 0x00000C18U; /* Disable VCLK2, VCLKA1, VCLKA3, and VCLKA4 domains */
    /* USER CODE END */

    Summary:

    This particular error has two (2) problems:

    1. I have VCLK3 enabled, not disabled. I do have VCLKA3 disabled, but that was not the stated comment in the error.

    2. The loader expected ARCH or DRIVER, neither of which I specify.

    Do not forget to address the last two (2) posts in this thread.

  • Hi,

    Yes, the issue is with the HALCoGen back end scripts which saves the variable in decimal instead of hexadecimal value.

    The macro PMM_LOGICPDPWRCTRL0_CONFIGVALUE in the genertaed sys_pmm.h file changes based on the power domain enable/disable. As you can see it  will not affect the generated code.

    I understand the error shown in HALCoGen is not a good sign. We have already done the fix and it will be rolled out in the next HALCoGen release.

    The error in the next line is not really an error associated with VCLK3 domain. It is a consequence of the previous error itself. If you examine the dil file generated, you can see that the variable CLKT_VCLK3_DOMAIN_DISABLE is next to the variable PMM_LOGIC_PD2_STATEVALUE. Since HALCoGen could not read a proper hexadecimal value for PD2_STATEVALUE, it led to printing an error on the next variable as well.

    The variable CLKT_VCLK3_DOMAIN_DISABLE is used in mapClocks function in system.c file. It is being used to write to the register CDDIS (Clock domain disable register). The variable holds a value 0 if the domain is enabled (since we need to write 0 in the disable register) and hence the variable value is correct.

    Regarding the PMM functionality, it provides you option to disable power given to few peripherals. The peripherals in the microcontroller are divided as power domains (Refer device TRM to find the which all peripherals falls under each power domain). If you are not planning to use the peripherals falling under a specific power domain, you can disable power to the domain using the PMM module so as to save power.

    Hope this helps!


    Thanks and Regards,

    Veena