Hello, I am new in ChibiOS.
I have got a project with CLI.
I can't put message to console from interrupt handler. When I call "chprintf" from interrupt handler I enter to infinite loop with error SV#4. I followed step by step in debugging mode and find the problem in hal_buffers.c -> obqPutTimeout (674) -> osalSysLock();
But when i call "chprintf" from CLI it works fine, osalSysLock() don't initiate infinite loop.
I have check all parameters they are valid.
chSysLock SV#4 mismatched
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: chSysLock SV#4 mismatched
Hi,
There are things you cannot do from interrupt handlers, this includes calling any API with name not terminated by an upper case i. The stream you are using as output cannot be used from an ISR thus that error.
Please read the "kernel concepts" section in the RT manual, function classes are described there.
Giovanni
There are things you cannot do from interrupt handlers, this includes calling any API with name not terminated by an upper case i. The stream you are using as output cannot be used from an ISR thus that error.
Please read the "kernel concepts" section in the RT manual, function classes are described there.
Giovanni
-
- Posts: 7
- Joined: Fri Aug 25, 2017 1:07 pm
Re: chSysLock SV#4 mismatched
Giovanni, thank you so much.
I obligatory read RT manual.
Can you derive me how to solve this?
I obligatory read RT manual.
Can you derive me how to solve this?
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: chSysLock SV#4 mismatched
You cannot print on a serial port from an ISR.
What you could do is to wakeup a thread that then does the printing.
Giovanni
What you could do is to wakeup a thread that then does the printing.
Giovanni
-
- Posts: 7
- Joined: Fri Aug 25, 2017 1:07 pm
-
- Posts: 7
- Joined: Fri Aug 25, 2017 1:07 pm
Re: chSysLock SV#4 mismatched
I have a next question about using EXTI on STM32.
I use EXTI on GIOPB0, and GPIOB1. I find that i have to define call back function and I did that for GPIOB1. In works fine. But when I do the same for GPIOB0 a get unhandled_exception. As a result i find that GPIOB0 handler Vector58() doesn't defined, but for GPIOB1 Vector5C() is defined. Is it bug or am I doing some thing wrong?
I use EXTI on GIOPB0, and GPIOB1. I find that i have to define call back function and I did that for GPIOB1. In works fine. But when I do the same for GPIOB0 a get unhandled_exception. As a result i find that GPIOB0 handler Vector58() doesn't defined, but for GPIOB1 Vector5C() is defined. Is it bug or am I doing some thing wrong?
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: chSysLock SV#4 mismatched
It is possible there is a bug, you should verify if the correct interrupt vectors are used or just post a note in the "bug reports" forum.
Giovanni
Giovanni
Who is online
Users browsing this forum: No registered users and 20 guests