CH_DBG_SYSTEM_STATE_CHECK => chSysHalt Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
kdums
Posts: 5
Joined: Tue Oct 17, 2017 4:06 pm

CH_DBG_SYSTEM_STATE_CHECK => chSysHalt  Topic is solved

Postby kdums » Tue Oct 17, 2017 4:14 pm

Hi!

I just found out that by enabling CH_DBG_SYSTEM_STATE_CHECK, at first switch to a thread in chSysInit() and calling chThdSleepMilliseconds() the OS is halted, because nil.lock_cnt == 1.
Version 17.6.0
I am pretty sure, this is not due to my stuff.

Kind regards,
Klaus

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

Re: CH_DBG_SYSTEM_STATE_CHECK => chSysHalt

Postby Giovanni » Tue Oct 17, 2017 5:49 pm

Hi,

I am trying the demo NIL-STM32F746G-DISCOVERY with state checker enabled. It does not trigger the problem. Could you share a minimal project that I could test?

Moving this topic in "bug reports".

Giovanni

kdums
Posts: 5
Joined: Tue Oct 17, 2017 4:06 pm

Re: CH_DBG_SYSTEM_STATE_CHECK => chSysHalt

Postby kdums » Thu Oct 19, 2017 12:14 pm

Hi!

Sorry, I think I have more problems than I thought, and most of them have to do with the Tasking comiler/linker.

I have a SysTick_Handler, that shall do the scheduling during CH_IRQ_EPILOGUE().
In _port_irq_epilogue a new exception return context is created, but it does not branche neiter to _port_switch_from_isr nor to _port_exit_from_isr but returns to the idle thread. (I have only one thread.)
But it shall return from the ISR to _port_switch_from_isr or to _port_exit_from_isr, right?

Kind regards,
Klaus

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

Re: CH_DBG_SYSTEM_STATE_CHECK => chSysHalt

Postby Giovanni » Sat Oct 21, 2017 4:54 pm

Hi,

Correct, ISRs can have two enforced return points, the ones you mentioned.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest