I’m trying to make a simple demo work with a similar MCU.
I’m using the TIVA Launchpad (that runs on TM4C123).
I’m using TI CCS (V 10.0.0.00010) and TI compiler (v20.2.1.LTS) with the last FreeRTOS version (10.3.1).
The project compiles without warnings.
The main program is very simple, it creates a task and start the scheduler.
I read the FAQ and I’m reading the book too.
The issue I have is similar to the one Jeff reported.
As soon as the vTaskStartScheduler() starts the PC jumps to the Default_Handler. I stepped into the code and I found that this happens when the function vPortStartFirstTask() is invoked.
The first time that I run the program, the PC jumps (as wrote above) to the Default_Handler, but if I just Restart the debug it finishes into the HardFault_Handler and if I restart again (third time and more) the PC finishes to the instruction svc #0 (last one here):
;/* Use the NVIC offset register to locate the stack. */
ldr r0, NVICOffsetConst
ldr r0, [r0]
ldr r0, [r0]
;/* Set the msp back to the start of the stack. */
msr msp, r0
;/* Clear the bit that indicates the FPU is in use in case the FPU was used
;before the scheduler was started - which would otherwise result in the
;unnecessary leaving of space in the SVC stack for lazy saving of FPU
mov r0, #0
msr control, r0
;/* Call SVC to start the first task. */
I know these lasts are not really helpful, but there is nothing more that I can mention.
My project is the one depictd in this post and the configuration used it is basically this.
Regarding the memory management I’m using the heap_4.
I checked both the stack and the heap configuration and to me looks fine. In particular I’m using the following:
#define configMINIMAL_STACK_SIZE ( ( uint16_t ) 100 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 10 * 1024 ) )
#define configCHECK_FOR_STACK_OVERFLOW 2
I can see the SRAM filled with the pattern A5A5A5A5.
So, to understand which is the exception that triggers the Default_Handler I found very helpful this page although I couldn’t run the code contained in the section Determining Which Exception Handler is Executing. Is there someone that can help me to translate this for the compiler I use? I tried using the __asm"" or the asm"", but didn’t work.
I think that this would be very helpful not only for the developing phase, so I’d really like to have it.
Any other ideas?
Anyone else had this issue?