I want to port uCOSIII on an ARM Cortex M4 (LM4F120XL board)
I am using Eclipse with GCC compiler and OpenOCD to flash and debug the board.
I have build the project but when I flash and debug the SW I get stuck in the hard fault interrupt handler.
By debugging I found out that the problem may be the PendSV interrupt handler.
The interrupt handler is defined in assembler file as_cpu_a.asm like follows:
also the handler is defined as global in the assembler file: .globl OS_CPU_PendSVHandler
In the startup code the handler is declared as:
extern void OS_CPU_PendSVHandler(void);
and then added in the vector table defined like this:
The PendSV interrupt is set in the following assembler routine that is executed, but then the execution reaches the hard fault interrupt:
with the defines:
I tried several things:
1. I replaced the PendSV handler with a wrapper of the same OS_CPU_PendSVHandler, basically called the assembler function, and this works first => the interrupt is executed, but then the returning from the function reaches a special routine where the execution should not reach:
By doing some research, I found that could be a stack problem, and I am not sure I am doing the right thing with my linker configuration file that looks like this:





