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);
}