chSysLock SV#4 mismatched

Discussions and support about ChibiOS/RT, the free embedded RTOS.
nonameletters
Posts: 7
Joined: Fri Aug 25, 2017 1:07 pm

chSysLock SV#4 mismatched

Postby nonameletters » Fri Aug 25, 2017 1:23 pm

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.

User avatar
Giovanni
Site Admin
Posts: 10220
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 212 times
Been thanked: 197 times
Contact:

Re: chSysLock SV#4 mismatched

Postby Giovanni » Fri Aug 25, 2017 1:34 pm

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

nonameletters
Posts: 7
Joined: Fri Aug 25, 2017 1:07 pm

Re: chSysLock SV#4 mismatched

Postby nonameletters » Fri Aug 25, 2017 1:42 pm

Giovanni, thank you so much.
I obligatory read RT manual.
Can you derive me how to solve this?

User avatar
Giovanni
Site Admin
Posts: 10220
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 212 times
Been thanked: 197 times
Contact:

Re: chSysLock SV#4 mismatched

Postby Giovanni » Fri Aug 25, 2017 1:57 pm

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

nonameletters
Posts: 7
Joined: Fri Aug 25, 2017 1:07 pm

Re: chSysLock SV#4 mismatched

Postby nonameletters » Fri Aug 25, 2017 2:21 pm

Great thanks

nonameletters
Posts: 7
Joined: Fri Aug 25, 2017 1:07 pm

Re: chSysLock SV#4 mismatched

Postby nonameletters » Mon Aug 28, 2017 2:43 pm

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?

User avatar
Giovanni
Site Admin
Posts: 10220
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 212 times
Been thanked: 197 times
Contact:

Re: chSysLock SV#4 mismatched

Postby Giovanni » Mon Aug 28, 2017 3:47 pm

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


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest