Dear Support team,
How to monitor stack pointer periodically during runtime and check if SW is going to stack overflow in SW?
Regards,
Manoraj Selvaraj
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.
Dear Support team,
How to monitor stack pointer periodically during runtime and check if SW is going to stack overflow in SW?
Regards,
Manoraj Selvaraj
Hi Manoraj Selvaraj,
If you are using TI Code Composer Studio, it offers a Stack Usage view option as shown on this page: Stack Usage View in CCS (ti.com)., viewable using View menu on CCS v12
.
Other options such as Watchpoint Breakpoints are also available in CCS to use in order to track for this purpose as detailed for unrelated products on Checking for Stack Overflow with CCS (ti.com).
I hope it helps with checking Stack Overflow on CCS with your Hercules MCU.
Hi Manoraj,
You can use MPU overlapping regions and subregions for stack protection.
Please refer to section 7.1.2 of ARM Cortex-R5 TRM

How to set the least-significant subregion disable bit( like below configuration)?

Regards,
Manoraj Selvaraj
This is the right way to disable the sub-region:
1. checking box 0,
2. save project and generate code,
3. the bit 8 of CP15 MPU region size register of new code will be set.
It indicates that a data abort happens. I am not sure it is MPU background fault or not.
An access to a memory address in a disabled sub-region uses the attributes and permissions of a lower priority region or generates a background fault if no other regions overlap at that address.
Please check the value of C15 Data Fault Status Register (DFSR).
This is an example of accessing an disabled subregion:
1. Disable the subregion #6 and #7 (0x08060000~0x08080000)

2. Access a location in those disabled subregions.

3. Data abort is generated:

4. Check the value of CP15 DFSR and address register. The fault happens at 0x08070000, and the fault is caused by background
