cancel
Showing results for 
Search instead for 
Did you mean: 

STM429I-EVAL1 Joystick Interrupt by ISR

OBorz.1
Associate II

Hello,

I am using a STM429I-EVAL1 board. With this I try to trigger an interrupt by pressing on the joystick, which is on the board. The interrupt is executed correctly a few times, but then it aborts. You can't tell when, it can abort after the 10 times or 20 times. The joystick is connected to the processor via I²C. Does anyone maybe have an idea what the problem could be?

Many thanks in advance.

2 REPLIES 2

Aborts how exactly?

Don't call blocking code from interrupt/callback context.

Arbitrate ownership via a mutex or semaphore so only one query or I2c transaction occurs at once.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
OBorz.1
Associate II

After repeated pressing of the joystick, the process pauses in Task.c and toggles between the two functions.

static void prvCheckTasksWaitingTermination( void )

{

       /** THIS FUNCTION IS CALLED FROM THE RTOS IDLE TASK **/

      #if ( INCLUDE_vTaskDelete == 1 )

      {

            TCB_t *pxTCB;

            /* uxDeletedTasksWaitingCleanUp is used to prevent vTaskSuspendAll()

            being called too often in the idle task. */

            while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )

            {

                   taskENTER_CRITICAL();

                   {

                          pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );

                          ( void ) uxListRemove( &( pxTCB->xStateListItem ) );

                         --uxCurrentNumberOfTasks;

                          --uxDeletedTasksWaitingCleanUp;

                   }

                   taskEXIT_CRITICAL();

                   prvDeleteTCB( pxTCB );

            }

      }

      #endif /* INCLUDE_vTaskDelete */

}

___________________________________________________________________________________________________________

            #if ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) )

            {

                   /* When using preemption tasks of equal priority will be

                   timesliced. If a task that is sharing the idle priority is ready

                   to run then the idle task should yield before the end of the

                   timeslice.

                   A critical region is not required here as we are just reading from

                   the list, and an occasional incorrect value will not matter. If

                   the ready list at the idle priority contains more than one task

                   then a task other than the idle task is ready to execute. */

                   if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > ( UBaseType_t ) 1 )

                   {

                          taskYIELD();

                   }

                   else

                   {

                          mtCOVERAGE_TEST_MARKER();

                   }

            }

            #endif /* ( ( configUSE_PREEMPTION == 1 ) && ( configIDLE_SHOULD_YIELD == 1 ) ) */

____________________________________________________________________________________________________________________

How can I arbitrate the ownership? Do you have an example?