FreeRTOS for STM32 not workig

Hi Team, I am trying to run a demo application listed on the FreeRTOS demo folder. I’m using STM32 standard STM32 F1 discovery board. I was able to compile the project. When I try to debug the project, the program directly enters in to run mode(Normally the user should click on the run button to continue the execution). Then the execution stops at “HardFaultHandler”. When I click on stop and the again click on the run button, the cursor remains at “HardFaultHandler” . The location of the file is “FreeRTOSv8.0.1FreeRTOSDemoCORTEXSTM32F103Keil”. Thanks Arun.S

FreeRTOS for STM32 not workig

I don’t have the hardware in front of me, but I just tried opening that project from the FreeRTOS V8.2.0 distribution, in the latest version of the Keil tools (which requires the legacy libraries to be added as they have changed the tool since the project was created), switch the project to use the simulator rather than the hardware….after which it seems to be executing as expected. From your description it sounds like something went wrong before the application started. You should be able to download the code at at least stop the debugger on program entry, but it sounds like you can’t get that far as the debugger is not in control of the hardware. Regards.

FreeRTOS for STM32 not workig

Hi, Thanks for the reply. I have edited the stm32f10x.s file. The HeapSize and StackSize were 0x00000000 and 0x00000200 respectively. I changed it to 0x00000800 and 0x00000500 respectively. Then the execution never halted in HardFaultHandler, instead it stopped at MemManageHandler. I don’t know whether the previous issue was resolved or a new one is generated. Before starting the debugging, I have unchecked the “Run to main” option. Then started the debugging. Control first comes to Line 122 (Please see the fig 1.), then to 123. As I continue, the execution stops at MemManage_Handler and doesn’t go further. Keil is the IDE. Regards, Arun

FreeRTOS for STM32 not workig

Any Idea????

FreeRTOS for STM32 not workig

As before – this does not sound like a FreeRTOS issue because you are never even getting to main(). If you are receiving a memory management exception then it sounds like the MPU is on, which it shouldn’t be, so it still sounds like your tools are not controlling, resetting and/or managing the hardware. Regards.

FreeRTOS for STM32 not workig

May be that’s correct. But i have used the project file I got from the FreeRTOS demo folder. There is another project file that works in IAR. I tried to run the project and that also stopped in a function “void HardFaultException(void)”. Thanks Arun

FreeRTOS for STM32 not workig

There is another project file that works in IAR. I tried to run the project and that also stopped in a function “void HardFaultException(void)”.
which makes it sound like a hardware or hardware configuration problem. Do you have the jumpers correctly on your dev board?

FreeRTOS for STM32 not workig

After running the program I opened the fault report window(Keil: Peripherals–>Core Peripherals–>Fault reports). The windows contains lot of parameters with check marks. Image is attached. In the report total three check box are enabled. There is an appnote from keil(http://www.keil.com/appnotes/files/apnt209.pdf) which indicates the errors and their description. But I don’t understand the anything described in the doc. Any advice??? Regards, Arun

FreeRTOS for STM32 not workig

I guess the Keil docs will tell you how to interpret the information. If not then the ARM docs do. Have you tried this http://www.freertos.org/Debugging-Hard-Faults-On-Cortex-M-Microcontrollers.html

FreeRTOS for STM32 not workig

Hi, Yes I have gone through the docs. But none of the doc tells us about the solution. It mainly provide solution to address the error. Attached is the image of the error and the description. But I dont know how to do execute the STKERR (No 3) desription shown in the fig. Regards, Arun

FreeRTOS for STM32 not workig

Hi, The issue is resolved. The problem is resolved now. Thanks for the replies which leads to fix the issue. The actual problem was related to selection of correct controller. We choose the wrong controller. The actual controller to be selected was STM32F100RBT6 the project was designed for STM32F103. We choose the correct controller and made some changes in main.c file and FreeRTOScofig.h file and now everything is ok. Once again thanks for the support. Regards, Arun.S