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.

TMS570LS3137: About generated code from HAL_CoGen

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

*Safety feature "EMF3".
I using TMS570LS3137, and reading Safety Manual(SPNU511D).
I using HAL_CoGen (ver.04.05.01).

I have doubts about the source code generated from HAL_CoGen.
I will talk about the emif module as an example.

In the generated code, there is emifGetConfigValue ().
Here, I am aware that we are comparing the initial value and the current value.
* Initial value setting to the register is implemented by emif_ASYNC1Init () etc.

It seems that the value set as the initial value and the define value treated as the initial value by emifGetConfigValue () are different.

Does it always make a failure judgment with the safety feature "EMF 3"?

Is there a problem with the HAL_CoGen tool?
Or is there a mistake in my perception?

  • Hello Falcon,

    The initial value that is specified by the defines, I believe, is the default value out of reset not the initial value setup by your application. i.e., the values set by emif_ASYN1Init() function call will be different than the values returned by emifGetConfigValue() if Initial value type is used. The intention should be to use current value as the type and compare to a stored/validated configuration value to identify if anything changed.

    My suggestion would be to add user code to the emifASYBC1Init() function to do an immediate read back of the registers and compare to the intended write values. This "golden" configuration is then to be used to compare the results of the emifGetConfigValue() function called with the current value type selected as a parameter.

    The Halcogen Code is really just implementing some basic constructs and, for the most part, is not intended to do the full safety mechanisms without some integrator development to add them or to use the constructs to carry them out. This is more the intention of the SafeTI Diagnostic Library which is a separate product that can be used with Halcogen.