TC275 stacksize

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

cross mob
User15397
Level 1
Level 1
I need to increase the size of the stack on my TC275 by some kB.

How can I do that? I tried to modify the iRAM.ld files as well as the memoryIntCode.x files in my workspace (HighTec Plattform) as well as in the path of the tricore-gcc compiler, i changed the USTACK_SIZE whereever i found it from 4k to 12k for example.
Nethertheless, my iRAM.ld file always got overwritten during compiling/linking, and the standard 4k had been used.

Thank you for helping me out.
0 Likes
4 Replies
User15397
Level 1
Level 1
i have got it, i needed to set __STACK_SIZE = 12k; in the iRAM.ld file, BUT inside the /*Protection-Area for your own LDF-Code*/
0 Likes
User13290
Level 5
Level 5
First like received First solution authored
Hi Jonas,

jonnyx wrote:
i have got it, i needed to set __STACK_SIZE = 12k; in the iRAM.ld file, BUT inside the /*Protection-Area for your own LDF-Code*/


It takes some getting used to, but you're correct that changes/additions need to be inside the protected blocks. Those will not be overwritten when the linker description file is re-generated. By default this happens before each build, but it can be changed on a workspace global scope, using the following steps:


  • Select 'Window | Preferences' MENU
  • Select 'HighTec Preferences | Linker description Model'
  • Untick 'Create linker description file before each build'


You may wonder what source is being used to generate the linker description file. For that you need to go to the models folder in your project. In here you'll find iROM.lm which is the source from which iROM.ld is generated. If you were to double-click iROM.lm it will launch the model editor and you'll be presented with a high-level model of your linker script that you can tinker with. Mostly there is no need and you can make do with the protected blocks, but sometimes it can be handy though. For example when you want to add a new memory region, or change an existing one. As there are no protected blocks for these, you'll have to do it from here. Also note that the stack size can be changed from here. I'll inline a snapshot for that.


3199.attach


Best regards,

Henk-Piet Glas
Principal Technical Specialist
0 Likes
User15397
Level 1
Level 1
Thank you, that is exaclty what I was wondering about. I did actually look at the iRAM.lm file but must have overseen the memory reservation part... Thank you!
0 Likes
User13290
Level 5
Level 5
First like received First solution authored
Hi Jonas,

jonnyx wrote:
Thank you, that is exaclty what I was wondering about. I did actually look at the iRAM.lm file but must have overseen the memory reservation part... Thank you!


My pleasure. Happy developing.


Henk-Piet Glas
Principal Technical Specialist
0 Likes