User stack size calculation in the map file shows zero-sized stacks after upgrading to TriCore v6.3r1

12-Nov-2024

Possible solution

In TriCore v6.3r1, the entry_points keyword was introduced to specify different entry points for the stack size calculation.

If those entry points are not defined, the map file will show a stack size of zero bytes in the 'Estimated stack usage' section like:

* Estimated stack usage
========================
+----------------------------------------------+
| Stack Name | Used | Recursive | Entry points |
|==============================================|
| ustack_tc0 | 0x0  | no        |              |
+----------------------------------------------+

If you use a customized <derivative_name>.lsl from an older TriCore toolset version in your project, you need to add the default entry_points entries for core 0.

If a multi-core application is used, entry_points entries for the other cores may also be added as shown below. The entry point may be the start label of the startup code of the respective core. For core 0, this is _START if the default startup code is used. For core 1, the entry point is _start_tc1, and so on. It's also possible to specify entry points for interrupt functions that use the interrupt stack. For more details, see chapter 7.9.12. Stack Size Estimation in the TriCore user guide and review the content of the <derivative_name>.lsl files of v6.3r1 which are included in the ctc\include.lsl sub-directory.

// macro definitions added for core 0 and core 1
#define __USTACK0_ENTRY_POINTS_ATTRIBUTE ,entry_points=["_START"] #define __USTACK1_ENTRY_POINTS_ATTRIBUTE ,entry_points=["_start_tc1"] section_setup :tc0:linear { stack "ustack_tc0" ( min_size = (USTACK_TC0) ,fixed ,align = 8 __USTACK0_ENTRY_POINTS_ATTRIBUTE ); stack "istack_tc0" ( min_size = (ISTACK_TC0) ,fixed ,align = 8 ); } section_setup :tc1:linear { stack "ustack_tc1" ( min_size = (USTACK_TC1) ,fixed ,align = 8 __USTACK1_ENTRY_POINTS_ATTRIBUTE ); stack "istack_tc1" ( min_size = (ISTACK_TC1) ,fixed ,align = 8 ); }

Map file excerpt:

* Estimated stack usage
========================
+----------------------------------------------------+
| Stack Name | Used       | Recursive | Entry points |
|====================================================|
| ustack_tc0 | 0x00000138 | no        | _START       |
|----------------------------------------------------|
| istack_tc0 | 0x0        | no        |              |
|----------------------------------------------------|
| ustack_tc1 | 0x00000150 | no        | _start_tc1   |
|----------------------------------------------------|
| istack_tc1 | 0x0        | no        |              |
|----------------------------------------------------|


More resources

Was this answer helpful?