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.

HALCOGEN: HALCoGen creates invalid headers and F021 Flash API ships invalid headers

Part Number: HALCOGEN

Tool/software:

- HALCoGen creates the header file `HL_errata_SSWF021_45.h` which makes use of `uint32` that is defined in `HL_hal_stdtypes.h`, but does not include  this header.

- F021 Flash API ships the header file `FapiFunctions.h` which makes use of `Fapi_StatusType` but does not include  `Types.h` and makes use of stdint-types but does not include `stdint.h`.

There might be more invalid headers, but these two were issues to us.

- Is it possible to release a fixed version of HALCoGen (especially as there is already a really long list of HALCoGen issues)?

- Is it possible to release a fixed version of the F021 Flash API?

  • Please expect a delayed response due to the Diwali holiday in India.

    Regards,

    Brennan

  • Hi,

    HALCoGen creating "HL_errata_SSWF021_45_defs.h" file along with "HL_errata_SSWF021_45.h"

    And if you verify the file "HL_errata_SSWF021_45_defs.h", there they typedef uint32_t as uint32.

    So, if you include the "HL_errata_SSWF021_45_defs.h" right before including "HL_errata_SSWF021_45.h", then there won't be any issues. I mean something as below:

    --
    Thanks & regards,
    Jagadish.

  • Hi Jagadish,

    thanks for your fast response.

    Sure I can just add the header, but we are runinng HALCoGen as code generator (option -i) as a pre-build step, therefore we depend on correct created source files.

    Best regards

  • Hi,

    Sorry i don't get this pre-build step,

    Can you please provide some screenshots for better understanding?

    --
    Thanks & regards,
    Jagadish.

  • I think text is better to describe this.

    When we build our software (i.e., run a makefile) this looks like this:

    1. We run the coge generation:
      halcogen.exe -i project.hcg
       (this creates HALCoGen sources and headers (*.c and *.h files)
    2. The compiler is called on the HALCoGen created sources (which of course include also HALCoGen created headers) and our application sources (I ommit the compiler options for brevity):
      1. compiler.exe HL_adc.c
      2. (all other HALCoGen created sources)
      3. compiler.exe foo.c

    Now the problem is that in first step HALCoGen creates invalid, not standard conforming headers, which of course the compiler complains about.

    For the F021 Flash API it's even more simpler than for HALCoGen: The installer installs header files, that contain just invalid, not standard conforming C code.

    I think

    • tools like HALCoGen shall deliver standard conforming, correct C code, let it be source or header files
    • APIs like F021 Flash API shall ship standard conforming, correct C header files.

    I think, the HALCoGen tool and the F021 Flash API should both be fixed.

  • Hi,

    So, you are building individual .c file generated by HALCoGen right? And this is creating issue for headers?

    Am i correct?

    If this is the case, then i never saw requirement like this before? I am supporting these devices since last 2 years. I will check old threads if there is any requirement like this.

    And also, usually while building HALCoGen generated code is meant either CCS IDE or IAR IDE. 

    And their customers can include entire include folder:

    This is required because to build one .c file example adc.c along with adc.h we also need some common .h files which will also present in include folder example sys_common.h etc

    without these files we will definitely end up with errors.

    --
    Thanks & regards,
    Jagadish.

  • Sorry, I really don't know how else I could describe this, this is the most basic as it gets. It's just about standard conforming C code.

    The first problem is, that HALCoGen creates invalid header files.

    If you are using a type in a file (let it be a header or a source file) you MUST include the required headers, where type is specified. Otherwise it is just not  valid C.

    And the second problem is basically the same, but for the Flash API (except that FLASH API files are not created, but shipped by the installer): Flash API ships headers, that require types, without including the required headers.

    It is important to understand: The problem is not related to CCS IDE or IAR IDE, its about the compiler(!) and about every compiler as - again - HALCoGen creates invalid C code and FLASH API ships invalid C code.

  • Hi,

    My sincere apologies for the delay in the late response.

    If you are using a type in a file (let it be a header or a source file) you MUST include the required headers, where type is specified. Otherwise it is just not  valid C.

    I understood the issue but currently there is not plan for HALCoGen modifications because as these devices are functional safety components a small change should also need to go through entire certificate process.

    I will note this issue you are facing and if we planned any HALCoGen upgradation in future then we will consider this.

    --
    Thanks & regards,
    Jagadish.

  • Ok, thanks for looking into this.

    Best regards

  • Once again thanks for bring up this issue to us and we will log this error for future HALCoGen releases.