steverino2 wrote on Monday, January 13, 2014:
Hi all, here is a problem running FreeRTOS on an STM32F4 Discovery target using IAR EWARM toolchain.
I appreciate any ideas on how to fix it.
The project is for STM32F4 Discovery using FreeRTOS 6.1.0 / lwIP 1.3.2
It builds and runs OK on IAR EWARM 6.6.
But when I build the project with IAR EWARM 6.7 it hard faults in vTaskSwitchContext
I tried increasing heap size but did not help.
Could there be a vulnerability to the code generated by IAR EWARM 6.7 ?
I added a hard fault handler to output the register dump
[Hard fault handler]
R0 = a5a5a5a5
R1 = a5a5a5a5
R2 = 20014dcc
R3 = 200150e4
R12 = a5a5a5a5
LR [R14] = 080125e3 function call return address
PC [R15] = 08011974 program counter
PSR = a100000e
BFAR = a5a5a5b1
CFSR = 00008200
HFSR = 40000000
DFSR = 0000000b
AFSR = 00000000
SCB_SHCSR = 00000400
In the link map the fault is isolated somewhere in vTaskSwitchContext
called from portasm.o
CODE ro code 0x080125c0 0x88 portasm.o 
vTaskIncrementTick 0x08011853 0xc2 Code Gb tasks.o 
vTaskSwitchContext 0x08011915 0xe8 Code Gb tasks.o 
vTaskPlaceOnEventList 0x080119ff 0x5e Code Gb tasks.o 
noname 0x08011a5d 0x6c Code Gb tasks.o