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.

Getting started with SafeTi Library.

Other Parts Discussed in Thread: HALCOGEN, TMS570LC4357, RM46L852

Hello,

  I am using RM64x mcu and i need to do some safety checks.I have no idea about how to use the SafeTi Library.

  I already have a working code of i2c communication between rm46 and an IMU. Now i am a bit confuse about SafeTI lib.

  How can i do the safety check in between the code?

  Actually i have no idea about how the SafeTi Library works? What will be the good start to have a good understanding of using the SafeTI library?

Thankyou.

  • If youi are trying to get started, please look at the doc and demo app folders:

  • Thank you Sir. And also can you please tell me
    What is the difference in "Safety Init" in the Halcogen and SafeTi library?
    Does Halcogen generated Safety Init meets the Safety Requirement?
    Do we need to call the Safety Init functions or something in our main code to run these self test?
  • They are different.

    The Safety Init were example functions that predate the release of the SafeTI Diagnostic Library.

    The SafeTI Diagnostic Library is written and traceable back to the device safety requirements doc.
    You probably want to actually use the SafeTI Diagnostic Library in your end application.

    There is actually a HalCoGen example that shows you how to build a HalCoGen project that includes the SafeTI Diagnostic Library.

    Look for 'example_SafetyLib.c' in the TMS570LC4357 folder or the TMS570LS04x_03x_02x folder ... it's in a lot of the device example folders but not every one of them so you may need to pick the closest example and use that.

    Also make sure to read the compiled HTML file in the diagnostic lib 'docs' directory as it has instructions for building and using the library.
  • I tried the example_SafetyLib.c for Rm46x.
    I followed all the steps as mentioned in Halcogen.
    But there are errors of Undefined symbols and Illegal mnemonic specified in
    sl_pmu_IAR.asm
    sl_asm_KEIL.inc
    sl_asm_api_KEIL.asm
    sl_asm_api_IAR.asm
  • Hassan Haroon said:
    But there are errors of Undefined symbols and Illegal mnemonic specified in
    sl_pmu_IAR.asm
    sl_asm_KEIL.inc
    sl_asm_api_KEIL.asm
    sl_asm_api_IAR.asm

    Which IDE and compiler are you using?

    It is suspicious that the project is attempting to compile assembler source files for both the IAR and KEIL compilers. 

  • I am using Code Composer Studio

  • I am using Code Composer Studio

    Can you clarify which example project you imported?

    Using CCS 6.2 I imported the SL_RM46L852_NoOS example from SafeTI Diagnostic Library v2.2.0, and after importing the project the sl_asm_api_IAR.arm, sl_asm_api_KEIL.asm and sl_pmu_IAR.asm source files were excluded from the build, as shown in the CCS Project Explorer by the filenames being grayed out and a strike-through symbol on the filenames. Also, by right-clicking on the sl_arm_api_IAR.asm source file the properties show the file is excluded from the build:

    As a result of the sl_asm_api_IAR.arm, sl_asm_api_KEIL.asm and sl_pmu_IAR.asm being excluded from the build, CCS was able to build the example project without error using the TI ARM v5.0.4 compiler.

    If you exclude the sl_asm_api_IAR.arm, sl_asm_api_KEIL.asm and sl_pmu_IAR.asm source files from the build, that should remove the errors caused by the TI ARM compiler being used on the source files intended for the IAR and KEIL compilers. 

  • Thankyou Chester Gillon.
    Actually i am making my own project through Halcogen.
    And i am following the SafetyLib.c example given in the Halcogen Help topics.
    According to your instruction i excluded that asm files by going into the properties and the errors are now gone.
    Can you please guide me more about the SafeTi library as i am totally new to this.
    I am doing i2c communication between Rm46x and IMUs.The values that i am getting from the IMUs will further go into the PLC system.Now i want to add some safety featurs that the values i am getting are Correct/Safe or not?Which tests would be helpful from the Safeti Library and how to call these safety functions in my main program?
    Thank you
  • So Hassan,

    The SafeTI diagnostic library is intended to provide APIs for the diagnostic hardware on the device,  not for your own application.

    In other words - the library gives you function calls to make the hardware BIST and fault injection logic and other hardware logic work,  so you can call the APIs to make the hardware do it's thing without having to be an expert in the hardware.   Think about it like a device driver but for diagnostic hardware.

    Now just like an I2C device driver wouldn't necessarily be expected to talk to your IMU,  (it may just expose basic APIs to send and receive messages and then on top you write the functions to talk to the IMU) ..

    Same thing goes with SafeTI Diagnostic library .. except in this case the Diagnostic library really has nothing to do with your IMU communication.  

    The checks on whether the IMU values are plausible is something you need to work on.   We do provide you though with a CPU and memory that you can know is functioning so it's giving you a good base to start from.   But IMU communication is well outside the scope of the silicon and the Diagnostic Lib.

    Chester thanks for answering on the .asm files. 


    Hassan each toolchain does have its own syntax for assembly and that is why the duplications are there for the assembly file.  Chester is correct you should only use the .asm file for the toolchain that you are building with and exclude or even delete from your source tree the other assembly files.

  • Hello,

    What if i use some test SL_API's in my main program e.g

    If(SL_Init_ECCFlash(10, FLASHECC_DEFAULT)==TRUE  && SL_Init_Memory(RAMTYPE_RAM) ==TRUE ){

    //system(MCU) is safe.

    }

    else{

    //system(MCU) is not safe.

    }

    Is it a right approach that if all the desired test are true then i can say that the system(MCU) is safe??

  • do i need to make a new thread? at it is already answered?
  • Hassan,

    You should read the device safety manual, and implement the measures that it suggests based on your application requirements.
    The safety library is there to assist you implement the measures described; so that you don't need to understand the hardware.