FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2010 Threads] STM32 F101CProgram goes to HardFaultExceptionPosted by baranov on August 26, 2010 Hello All. I'm trying to run FreeRtos on STM32F101C8. I have 2 simple tasks: static void vLCDTask( void *pvParameters ) { (void)(*pvParameters);
for(;;) { GPIOB->ODR &= 0x03FF; vTaskDelay(1); } }
static void vLSDTask( void *pvParameters ) { (void)(*pvParameters);
for(;;) { GPIOB->ODR |= 0xFC00; vTaskDelay(1); } }
I debug with IAR jtag emulator and see that each of them is executed only once. After that program goes to HardFault Exception. If I add one more task - it goes through 3 tasks. If I replace xTaskDelay by TaskYield() it works good. I use IAR 5.41 compiler. Thanks
RE: STM32 F101CProgram goes to HardFaultExceptionPosted by Dave on August 27, 2010 Is there a standard demo application you can try? Are you running into mutual exclusion having two tasks attempting to access the same port so rapidly?
RE: STM32 F101CProgram goes to HardFaultExceptionUnfortunately I have only a board with STM32F101C8 and standard demo is designed for STM32F101F103. So, I simplified standard demo reducing it to these small tasks, modified linker script file stm32f10x_flash.icf and changed value f the CPU clock frequency to 24MHz. The 1ms delay seems to be large enough to provide access to port, isn't it? I initially tried vTaskDelay(1000). Maybe there is a reference to STM32F101C8 FreeRtos example somewhere?
RE: STM32 F101CProgram goes to HardFaultExceptionPosted by Dave on August 27, 2010 > Unfortunately I have only a board with STM32F101C8 and standard demo > is designed for STM32F101F103. So, I simplified standard demo > reducing it to these small tasks, modified linker script file > stm32f10x_flash.icf and changed value f the CPU clock > frequency to 24MHz.
You are doing the right things, but did you start with the project for the standard demo you mention, or create a new project?
> The 1ms delay seems to be large enough to > provide access to port, isn't it?
I doubt this is the source of your problem, but it is worth looking at. The delay period does not provide mutual exclusion, if a tick interrupt occurs between reading the current port value and writing the new one then you have a problem. I don't think it would make it crash though. Look at the partest.c files in the FreeRTOS/Demo directory to see how they do port access.
RE: STM32 F101CProgram goes to HardFaultExceptionPosted by baranov on August 27, 2010 I downloaded demo project and modified it deleting everything except LED blinking. After that I customized LED ports to my board ports and pins. Preliminary I wrote a separate simple program to test board LEDs switching. Thanks, I'll look at partest.c
RE: STM32 F101CProgram goes to HardFaultExceptionPosted by baranov on August 30, 2010 Well, I replaced LED blinking with a++ and b++ operations, where a and b are two long globals. I still have Hard Fault Exception but I noticed that the system works about two second before it catches it. Can it be something with bus timing?
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|