Assertion error in I2C interrupt (thread not suspended) Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
lerela
Posts: 11
Joined: Tue Mar 21, 2017 7:08 pm
Been thanked: 2 times

Assertion error in I2C interrupt (thread not suspended)

Postby lerela » Wed May 24, 2017 4:07 pm

Hi,

I am running an STM32F417.

When I start an I2C3 transfer using i2cMasterTransmitTimeout(), I encounter the following assertion error (chthreads.c:571), called by the _i2c_wakeup_isr from the I2C interrupt "i2c_lld_serve_event_interrupt" (I2Cv1/i2c_lld.c:322):

Code: Select all

chDbgAssert(tp->p_state == CH_STATE_SUSPENDED, "not THD_STATE_SUSPENDED");


The thread ChibiOS is trying to wake up is indeed the one that called the i2c transfer function. I am wondering if it's possible that the I2C transfer started and ended before osalThreadSuspendTimeoutS() was even called, but if that's the case I don't understand why would I be the only person to encounter this error.

Any idea?

Thanks!

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

Re: Assertion error in I2C interrupt (thread not suspended)

Postby Giovanni » Wed May 24, 2017 5:44 pm

Hi,

It could also be a spurious interrupt when there is no thread waiting.

Very strange, moving this topic in "bug reports", you should explain how to reproduce the problem, that would make things easier.

Giovanni

lerela
Posts: 11
Joined: Tue Mar 21, 2017 7:08 pm
Been thanked: 2 times

Re: Assertion error in I2C interrupt (thread not suspended)

Postby lerela » Wed May 24, 2017 6:44 pm

There's no other task using I2C and this spurious interrupt comes after my call to the transmit function so I suspect this is the intended interrupt (especially since the rx buffer contains the data I am expecting), that's why I thought it might come from a misuse of the API.
If that does not ring a bell I'll dig deeper, I'll let you know what I find.

Thank you

lerela
Posts: 11
Joined: Tue Mar 21, 2017 7:08 pm
Been thanked: 2 times

Re: Assertion error in I2C interrupt (thread not suspended)  Topic is solved

Postby lerela » Tue May 30, 2017 12:40 pm

Turned out to be an undetected stack overflow. Sorry about that.

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

Re: Assertion error in I2C interrupt (thread not suspended)

Postby Giovanni » Tue May 30, 2017 12:41 pm

Np, glad you fixed it.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 13 guests