Page 1 of 1

SV#8 error on stmf429-discovery

Posted: Wed Oct 07, 2015 5:13 pm
by enrico.dallavia
Hello,
after a variable amount of time, my program stops working (it could be a minute, an hour, 1 second)
I have 3 thread,
1) read from SPI the MEMS and it is run every 500ms
2) is on waiting a wake-up event from EXTI callback
3) perform the initialization and normal operation for a bluenrg chip through another SPI, it runs every 1ms (the fastest I made it run, the quickest the problem arises)

in the point when I write something to SPI and I need to wait data from the other chip, I've used a binary semaphore with timeout (the thread nr.2 gives a signal once the activities are done, means reading from SPI until the irq line drove by bluenrg chip is kept high).
I have a problem now, the system stop working and from openocd I got the message:
Program received signal SIGINT, Interrupt.
chSysHalt (reason=0x800d478 "SV#8") at ../../../os/rt/src/chsys.c:179

I read from the wiki that SV#8 means "The macro CH_IRQ_PROLOGUE() has not been placed at very beginning of an ISR or it has been placed within a critical zone"

Since I use a EXTI callback, I never use CH_IRQ_PROLOGUE on the callback.
Any idea how to solve this problem?

Thanks

Re: SV#8 error on stmf429-discovery

Posted: Wed Oct 07, 2015 8:19 pm
by Giovanni
It could be a problem with IRQ priorities, do you have interrupt sources external to the HAL? If so you are assigning to it an invalid priority, valid are 2..15.

Giovanni

Re: SV#8 error on stmf429-discovery

Posted: Thu Oct 08, 2015 8:42 am
by enrico.dallavia
Indeed I've changed STM32_EXT_EXTI3_IRQ_PRIORITY from 6 to 0 (since ST original code was assigning this value to the interrupt source). I'll try with value above 2.
Thank you! I would never ever spotted this one.

Re: SV#8 error on stmf429-discovery

Posted: Thu Oct 08, 2015 11:04 am
by enrico.dallavia
After I've changed the value of irq from 0 to 2 it seems to work flawlessly!
Thanks!