Could anyone explain how to integrate SafeTlib into TC237 project?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello everybody

I'd like to ask if anyone of you know how to integrate the SafeTlib into a project. I've read the documentation but is not clear about this. I just want an example for any aurix mcu that shows how to integrate the code generated in tresos studio into my project.

If anyone has successfully achieved this could you share with me how to do it?

Regards.
0 Likes
1 Solution
Not applicable
Hello Malagon,

TASKING provides it's own .sfr file however there's also a register definition file by Infineon.
You can disable automatic include of the TASKING .sfr in project properties / Settings / C/C++ compiler / Preprocessing by unchecking the checkbox "Automatic inclusion of .sfr file".
This should solve the issue.

Feel free to open a Altium Live support case if you have problems related to our toolset.

Best regards,
Jan Schlemminger

View solution in original post

0 Likes
7 Replies
µC_Wrangler
Employee
Employee
50 solutions authored 100 sign-ins 25 likes received
Have you looked at the SafeTlib demo application? See 01_SafeTlib/application/src/RefApp.c, and the TresOs configuration (e.g., 01_SafeTlib/Application/cfg/RefApp_Cfg_234.zip).

Regards,
Neal
0 Likes
Not applicable
Neal Manson wrote:
Have you looked at the SafeTlib demo application? See 01_SafeTlib/application/src/RefApp.c, and the TresOs configuration (e.g., 01_SafeTlib/Application/cfg/RefApp_Cfg_234.zip).

Regards,
Neal


Hi thanks for helping.

I have looked at the demo application. I'm trying to create a project for Altium Tasking IDE in order to compile it and analyze what I need to remove or modify in order to integrate it into my project. I'm not using MCAL and I need to analyze what parts of the demo code I need to change in order to be able to use the lib without MCAL.

The code is not compiling and is generating lots of errors like these:

ctc E207: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxCpu_regdef.h" 54/22] syntax error - token "" deleted
ctc E207: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxCpu_regdef.h" 61/22] syntax error - token "" deleted
ctc E207: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxCpu_regdef.h" 94/22] syntax error - token "" deleted


And the code that is being flagged is the one in the "IfxCpu_regdef.h" file.

Other errors are like these:

ctc W504: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxDma_reg.h" 50/9] macro "DMA_ACCEN00" redefined
ctc I801: ["C:\Program Files (x86)\TASKING\TriCore v6.0r1\ctc\include\sfr\regtc23x.sfr" 1570/9] previous definition of macro "DMA_ACCEN00"
ctc W504: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxDma_reg.h" 53/9] macro "DMA_ACCEN01" redefined
ctc I801: ["C:\Program Files (x86)\TASKING\TriCore v6.0r1\ctc\include\sfr\regtc23x.sfr" 1585/9] previous definition of macro "DMA_ACCEN01"
ctc W504: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxDma_reg.h" 56/9] macro "DMA_ACCEN10" redefined
ctc I801: ["C:\Program Files (x86)\TASKING\TriCore v6.0r1\ctc\include\sfr\regtc23x.sfr" 1571/9] previous definition of macro "DMA_ACCEN10"
ctc W504: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxDma_reg.h" 59/9] macro "DMA_ACCEN11" redefined
ctc I801: ["C:\Program Files (x86)\TASKING\TriCore v6.0r1\ctc\include\sfr\regtc23x.sfr" 1586/9] previous definition of macro "DMA_ACCEN11"
ctc W504: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\TC23x\IfxDma_reg.h" 62/9] macro "DMA_ACCEN20" redefined

These are just an example of the macros being flagged as redefined but basically all the macros from the Common\TC23X folder are being flagged as redefined. I don't know why is this because when I search for the definitions I just can see one of each.

I'm using the automatically generated make files and not using the make files that came with the demo. I don't know if this is the problem.

Regards
0 Likes
Not applicable
Hello Malagon,

TASKING provides it's own .sfr file however there's also a register definition file by Infineon.
You can disable automatic include of the TASKING .sfr in project properties / Settings / C/C++ compiler / Preprocessing by unchecking the checkbox "Automatic inclusion of .sfr file".
This should solve the issue.

Feel free to open a Altium Live support case if you have problems related to our toolset.

Best regards,
Jan Schlemminger
0 Likes
Not applicable
TASKING.jan.schlemminger wrote:
Hello Malagon,

TASKING provides it's own .sfr file however there's also a register definition file by Infineon.
You can disable automatic include of the TASKING .sfr in project properties / Settings / C/C++ compiler / Preprocessing by unchecking the checkbox "Automatic inclusion of .sfr file".
This should solve the issue.

Feel free to open a Altium Live support case if you have problems related to our toolset.

Best regards,
Jan Schlemminger


Thank you very much! this helped to get rid of all the errors. Now, the only error I get is this:

ctc E201: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\Mcal_Compiler.h" 1000/3] #error "No compiler defined!"

Making a search for the text "#if defined(_TASKING_C_TRICORE_)" indicates that there are some places where this label is getting checked but is not found. What would be the correct definition that correspond to the compiler? because clearly "_TASKING_C_TRICORE_" is not being found.

Regards.
0 Likes
Not applicable
Hello Malagon,

this is not an official TASKING define done by our compiler. It should be set somewhere in your MCAL configuration, I think the environment variable $(COMPILER_CHOICE) has to be set to TASKING
Please see the MCAL documentation for further information.

Best regards,
Jan Schlemminger
0 Likes
Not applicable
Thanks for helping!

I have almost all errors gone. I just have this one I think is for TASKING compiler:

ctc E209: ["C:\Users\malagonm\Documents\Projects\01_SafeTlib\Common\Ifx_MemMap.h" 3176/4] #pragma section farbss: empty stack

What does that mean?

Regards.
0 Likes
lifem4
Level 1
Level 1
First reply posted Welcome!

To integrate SafeTlib into a TC237 project, follow these steps:

  1. Download SafeTlib: Begin by downloading SafeTlib, ensuring compatibility with your TC237 project.

  2. Include SafeTlib in Project: Add SafeTlib to your TC237 project by incorporating the library files into your project directory.

  3. Configuration Settings: Adjust the project settings to accommodate SafeTlib, ensuring proper configuration and compatibility.

  4. Initialize SafeTlib: In your code, initialize SafeTlib by including the necessary headers and initializing the library with the required parameters.

  5. Token Maker Integration: Utilize SafeTlib's Token Maker functionality by calling the relevant functions within your project code. Ensure proper handling of tokens and integration with your TC237 project's logic.

  6. Testing: Thoroughly test the integration to identify and resolve any issues. Validate the proper functioning of SafeTlib within your TC237 project.

  7. Documentation: Document the integration process, outlining steps for future reference and for the benefit of other developers.

By following these steps, you can seamlessly integrate SafeTlib into your TC237 project, incorporating the Token Maker functionality for enhanced security features.

0 Likes