AM263P4: Understand existing stack usage and changing stack size

Part Number: AM263P4
Other Parts Discussed in Thread: TMDSCNCD263P,

Hi

I am currently evaluating the TI AM263P4 using the TMDSCNCD263P evaluation board, with the intention of running a motor‑control application on this device.

Our motor‑control application is developed in Simulink, and I am using the Embedded Coder Hardware Support Package for TI AM26x (https://uk.mathworks.com/matlabcentral/fileexchange/174295-embedded-coder-hardware-support-package-for-ti-am26x) for the hardware integration. I am able to successfully Build, Deploy and Start the application on the micro, running entirely from RAM.

As part of the evaluation, I also want to analyse the auto‑generated code and project structure. To do this, I imported the auto‑generated CCS project into TI CCS 12.8.1. When reviewing the Stack Usage report, I noticed the following. 

  • main() shows 100% usage
  • PWM ISR 146 shows 72% usage (Screenshots attached)

Pictures attached.

Questions:

  1. What is the unit of the “Inclusive Size” field in the Stack Usage view? It is not clear whether this value is in bytes or another unit. The CCS GUI does not appear to specify this, which makes interpretation difficult.  
  2. How can the stack size be modified for the auto‑generated project? I attempted to change the stack size in the default linker command file located at: ..\am26x-hsp-PACKAGE_0014\toolchain\am263px\+matlabshared\+toolchain\+ti_arm_clang\linker.cmd   However, this did not appear to affect the stack‑usage calculation shown in CCS. (Screenshot attached)
  1. image.png

image.png

image.png

 

Any guidance on how TI CCS determines stack usage for auto‑generated projects, and how to correctly configure or override the stack size, would be greatly appreciated.

Thanks

  • Hi Stack usage is created based on a FreeRTOS demo program stack depth, which is configured via Syscfg->Memeory configurator.

    Please note it is always advised for customer to populate their own stack size based on their application and know how

  • What is the unit of the “Inclusive Size” field in the Stack Usage view? It is not clear whether this value is in bytes or another unit. The CCS GUI does not appear to specify this, which makes interpretation difficult.  

    It is in KB

  • Hi Nilabh.

    Many thanks for your feedback. As mentioned earlier, the TI CCS project was auto-generated by the Simulink / Embedded coder HSP toolchain during the build process. Could stack usage only be defined using the Syscfg->Memeory configurator? If so, then how can i ingrate it to the Simulink / Embedded coder work flow?