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.

Compiler/RM48L952: Trouble enabling --stack_overflow_check on RM48L952 and TM4C123GH6PZ

Part Number: RM48L952
Other Parts Discussed in Thread: TM4C123GH6PZ, HALCOGEN

Tool/software: TI C/C++ Compiler

Hello,

I am using the RM48L952 and TM4C123GH6PZ in a project and would like to enable dynamic stack overflow checking. I am using the TI ARM C/C++ compiler version 16.9.4.LTS

When I add the --stack_overflow_check flag and add a void handle_stkovf(void) function my project compiles, when running the code on the RM48, the code doesnt get past prefetchEntry.

You find the RM48 gdb session and main file below.

The --stack_overflow_check works with the TM4C123GH6PZ, however instead of calling handle_stkovf, FaultISR() is called (from tm4c123gh6pz_startup_ccs.c which comes with the compiler).

Is there a comprehensive description how to use the --stack_overflow_check option?

Thanks,

Karel

RM48 GDB session:

(gdb) target remote localhost:55001

Remote debugging using localhost:55001
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x0000598c in ?? ()
(gdb) monitor reset
Resetting target
(gdb) file fpmain.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from fpmain.elf...done.
(gdb) b main
Breakpoint 1 at 0x5978: file /home/karel/Documents/stmatb_sourcecode/src/STMATB/functional_processor/fpmain.c, line 13.
(gdb) b handle_stkovf
Breakpoint 2 at 0x59f8: file /home/karel/Documents/stmatb_sourcecode/src/STMATB/functional_processor/fpmain.c, line 30.
(gdb) b recurse
Breakpoint 3 at 0x5984: file /home/karel/Documents/stmatb_sourcecode/src/STMATB/functional_processor/fpmain.c, line 17.
(gdb) load
Loading section .intvecs, size 0x20 lma 0x0
Loading section .text, size 0x5c58 lma 0x20
Loading section .const, size 0x23c lma 0x5c78
Loading section .cinit, size 0x24 lma 0x66b8
Start address 0x5a6c, load size 24280
Transfer rate: 78 KB/sec, 4856 bytes/write.
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
prefetchEntry () at /home/karel/Documents/herculeshallib/src/hal/sys_intvecs.asm:59
59 b prefetchEntry


RM48 Main file

#include <stdint.h>
#include "hal_stdtypes.h"

extern void recurse(void);
extern void handle_stkovf(void);

int main(void)
{

recurse();
return 0L;

}

void recurse(void ) {

uint8_t maan[100];

uint8_t roos = 0;
for(roos = 0; roos < 100; roos++){

maan[roos] = roos;
recurse();
if(maan[roos] == 99){

roos = 0;

}

}

}

void handle_stkovf(void) {

while(1);

}

  • The stack overflow check feature is not integrated with any other TI supplied software such as Halcogen.  And I suspect that is what you are attempting to do.

    The stack overflow feature has caused problems before.  It has seen little use in the field.  All things considered, I am thinking of filing a request to remove the stack overflow feature from the compiler.  How does that sound to you?

    Thanks and regards,

    -George

  • Hey George,

    You're right, on the RM48 I am trying to combine it with HalCoGen (with little succes). Seems like turning the flag off here seems like the right thing to do, I guess I would have to use the MPU to detect stack overflow.

    I already thought that the feature isn't used much as the only documentation you can find on it is that it "Enables dynamic stack overflow checking".

    It seems like a nice feature to have as it would seem easier to use than the MPU, however it seems like in the current state it's near impossible to use it.

    Thanks,

    Karel

  • I filed CODEGEN-4062 in the SDOWP system to request that the stack overflow feature be removed.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George