Search found 17 matches

by Coreglider
Tue Apr 21, 2015 3:17 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

The

Code: Select all

#define PORT_INT_REQUIRED_STACK         128

seems to be working. Both of my boards are blinking LED's for almost an hour. I'll try to test it for a more long time, and I hope, problem will not appear again. Thank you!
by Coreglider
Tue Apr 21, 2015 1:38 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

Do you found any interactions between fast interrupts and context switching code (with FPU enabled)?
by Coreglider
Mon Apr 20, 2015 1:08 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

You code with some modifications to run it under 2.6.8 get the same result - stuck in the context switching or in idle thread. But I didn't get chDbgPainic event, despite all checks are enabled. When I edited thread code (just added more led switching commands), I get chDbgPainic with "stack ...
by Coreglider
Sun Apr 19, 2015 8:31 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

"SV#4" it can be seen on screenshot
by Coreglider
Sun Apr 19, 2015 8:21 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

In the meanwhile, could you try to enable assertions, checks and "state checker" in chconf.h?

I already enabled them and posted a screenshot with a result of debug check.
Ok, I'll try your code tomorrow on f4.
by Coreglider
Sun Apr 19, 2015 6:30 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

And here I again. The problem seems to be here, when both FPU(compiler and chconf.h) options are enabled. After some amount of time program stucks at the chthd.c

do {
cp = cp->p_next;
} while (cp->p_prio >= tp->p_prio);

Tested on 2.6.8 discovery demo without optimization enabled, and with FPU ...
by Coreglider
Sun Apr 19, 2015 4:53 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

Yes, compiler option and ChibiOS CORTEX_USE_FPU must be the same value. I've encountered this problem earlier. The problem was in define checks in my project

#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
#endif ...
by Coreglider
Sun Apr 19, 2015 4:30 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

It seems, problem is related not to interrupts, but to FPU. It somehow is not initialized. Sorry for wasting your time.
by Coreglider
Sun Apr 19, 2015 3:59 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

I give up. If I modify ALMOST ANYTHING in the demo project, it crashes.
I tried to use stm32_clock_init() instead of SystemInit() in my project, but it has no effect.
Here's modified main.c from m, and I modified no files except it.
With standard chconf.h this test project is working, but it ...
by Coreglider
Sun Apr 19, 2015 1:25 pm
Forum: STM32 Support
Topic: getting Hard Fault when using fast interrupts
Replies: 32
Views: 14086

Re: getting Hard Fault when using fast interrupts

I don't want to use HAL in my project, it's not quite clear for me. I'll try to use stm32_clock_init() from HAL, to determine whether problem in SystemInit() or not.