S32K144 Can Callback Issue With Freertos TaskNotify

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144 Can Callback Issue With Freertos TaskNotify

Jump to solution
1,801 Views
HarunCSaykal
Contributor II
   Hello
I work with S32K144 processor. I'm using Freertos. I'm using an interrupt for Can RX. When the RX interrupt occurs, I send a notify to a task. But when I send notify, I get stuck in the "portFORCE_INLINE static void vPortRaiseBASEPRI( void)" function.

    CAN_Init(&can_pal1_instance, &can_pal1_Config0);
    CAN_InstallEventCallback(&can_pal1_instance, CAN_TX_RX_Callback, NULL);

    can_recvtask_handle = xTaskCreateStatic(CAN_RecvTask,
                                            APP_CAN_RECV_TASK_NAME,
                                            APP_CAN_RECV_TASK_STACK,
                                            NULL,
                                            APP_CAN_RECV_TASK_PRIO,
                                            xRecvStack,          /* Array to use as the task's stack. */
                                            &xRecvTaskBuffer);

    
    void CAN_TX_RX_Callback(uint32_t instance, can_event_t eventType, uint32_t objIdx, void      *driverState)
    {
         /*check and handle the RX complete event*/
        if (CAN_EVENT_RX_COMPLETE == eventType) {
            CAN_Receive(&can_pal1_instance, objIdx, &rx_msg);
            BaseType_t xHigherPriorityTaskWoken = pdFALSE;
            xTaskNotifyFromISR(can_recvtask_handle, 0, eNoAction, &xHigherPriorityTaskWoken);  // The function that encounters the error.
            if (xHigherPriorityTaskWoken) {
                 portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
            }
         }
      }


    static void CAN_RecvTask(void *Params)
   {
        (void)Params;
        while (pdTRUE) {
             xTaskNotifyWait(0, 0, eNoAction, portMAX_DELAY);
             J1939_Parser(rx_msg.id, &(rx_msg.data[0]));
        }
     }

xTaskNotifyFromISR(can_recvtask_handle, 0, eNoAction, &xHigherPriorityTaskWoken) is the function that falls into error.

I found out that this is an interrupt priority error. In another function, I was able to solve this problem by setting the interrupt priority.
http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html 

The code block below works without any issues.

#define LZ_PORT_IRQN        PORTD_IRQn
#define LZ_PORT_IRQN_PRI    (1)


app_status_t GPIO_install_int (void)

{
    /* Install LZ Button & INT interrupt handler */
    INT_SYS_InstallHandler(LZ_PORT_IRQN, RF_Instance_Int_Handler, (isr_t *)NULL);
    /* Enable LZ Button interrupt handler */
    INT_SYS_EnableIRQ(LZ_PORT_IRQN);

    INT_SYS_SetPriority(LZ_PORT_IRQN, LZ_PORT_IRQN_PRI);

    if (INT_SYS_GetPriority(LZ_PORT_IRQN) != LZ_PORT_IRQN_PRI) {
        return APP_STATUS_FAIL;
    }

    return APP_STATUS_OK;
}

void RF_Instance_Int_Handler (void)
{
    uint32_t u32Flags;

    u32Flags = GPIO_AML_GetInterruptFlags(SW_INT_LZ_INSTANCE);

    /* Check if interrupt comes from LZ INT pin */
    if (u32Flags & (1 << LZ_INT_PIN_NB)) {
        BaseType_t xHigherPriorityTaskWoken = pdFALSE;
        xTaskNotifyFromISR(RF_TaskHandle, 0, eNoAction, &xHigherPriorityTaskWoken);
        if (xHigherPriorityTaskWoken) {
            portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
        }
        GPIO_AML_ClearInterruptFlags(SW_INT_LZ_INSTANCE, LZ_INT_PIN_NB);
    }
}


But I couldn't set this priority for Can interrupt. How can I set this priority for CAN RX, or what other solutions are there for this problem?
0 Kudos
Reply
1 Solution
1,760 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can set interrupt priority for given ISR in similar manner as for Port interrupt, using NT_SYS_SetPriority function. Just use right function parameters, like
INT_SYS_SetPriority(CAN0_ORed_0_15_MB_IRQn, 1);

BR, Petr

View solution in original post

0 Kudos
Reply
2 Replies
1,761 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can set interrupt priority for given ISR in similar manner as for Port interrupt, using NT_SYS_SetPriority function. Just use right function parameters, like
INT_SYS_SetPriority(CAN0_ORed_0_15_MB_IRQn, 1);

BR, Petr

0 Kudos
Reply
1,736 Views
HarunCSaykal
Contributor II

Solved. Yes, that's right fucn. Thank you.

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1971923%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K144%20Can%20Callback%20Issue%20With%20Freertos%20TaskNotify%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1971923%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3BHello%3CBR%20%2F%3EI%20work%20with%20S32K144%20processor.%20I'm%20using%20Freertos.%20I'm%20using%20an%20interrupt%20for%20Can%20RX.%20When%20the%20RX%20interrupt%20occurs%2C%20I%20send%20a%20notify%20to%20a%20task.%20But%20when%20I%20send%20notify%2C%20I%20get%20stuck%20in%20the%20%22%3CSTRONG%3EportFORCE_INLINE%20static%20void%20vPortRaiseBASEPRI(%20void)%3C%2FSTRONG%3E%22%20function.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3CFONT%20color%3D%22%23FF9900%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%3CFONT%20color%3D%22%23003366%22%3ECAN_Init(%26amp%3Bcan_pal1_instance%2C%20%26amp%3Bcan_pal1_Config0)%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20CAN_InstallEventCallback(%26amp%3Bcan_pal1_instance%2C%20CAN_TX_RX_Callback%2C%20NULL)%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3CDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20can_recvtask_handle%20%3D%20xTaskCreateStatic(CAN_RecvTask%2C%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20APP_CAN_RECV_TASK_NAME%2C%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20APP_CAN_RECV_TASK_STACK%2C%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20NULL%2C%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20APP_CAN_RECV_TASK_PRIO%2C%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20xRecvStack%2C%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F*%20Array%20to%20use%20as%20the%20task's%20stack.%20*%2F%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26amp%3BxRecvTaskBuffer)%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%3CBR%20%2F%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3CDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20void%20CAN_TX_RX_Callback(uint32_t%20instance%2C%20can_event_t%20eventType%2C%20uint32_t%20objIdx%2C%20void%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B*driverState)%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%7B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2F*check%20and%20handle%20the%20RX%20complete%20event*%2F%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3Bif%20(CAN_EVENT_RX_COMPLETE%20%3D%3D%20eventType)%20%7B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3BCAN_Receive(%26amp%3Bcan_pal1_instance%2C%20objIdx%2C%20%26amp%3Brx_msg)%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3BBaseType_t%20xHigherPriorityTaskWoken%20%3D%20pdFALSE%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CFONT%20color%3D%22%23FF0000%22%3ExTaskNotifyFromISR(can_recvtask_handle%2C%200%2C%20eNoAction%2C%20%26amp%3BxHigherPriorityTaskWoken)%3B%26nbsp%3B%20%2F%2F%20%3CSPAN%3EThe%20function%20that%20encounters%20the%20error.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3Bif%20(xHigherPriorityTaskWoken)%20%7B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BportYIELD_FROM_ISR(xHigherPriorityTaskWoken)%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%7D%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20static%20void%20CAN_RecvTask(void%20*Params)%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%7B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20(void)Params%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3Bwhile%20(pdTRUE)%20%7B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BxTaskNotifyWait(0%2C%200%2C%20eNoAction%2C%20portMAX_DELAY)%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BJ1939_Parser(rx_msg.id%2C%20%26amp%3B(rx_msg.data%5B0%5D))%3B%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%3E%3CSPAN%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%7D%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CFONT%20color%3D%22%23003366%22%3E%3CSTRONG%3ExTaskNotifyFromISR(can_recvtask_handle%2C%200%2C%20eNoAction%2C%20%26amp%3BxHigherPriorityTaskWoken)%26nbsp%3B%3C%2FSTRONG%3Eis%20the%20function%20that%20falls%20into%20error.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CP%20class%3D%22%22%3EI%20found%20out%20that%20this%20is%20an%20interrupt%20priority%20error.%20In%20another%20function%2C%20I%20was%20able%20to%20solve%20this%20problem%20by%20setting%20the%20interrupt%20priority.%3CBR%20%2F%3E%3CA%20href%3D%22http%3A%2F%2Fwww.FreeRTOS.org%2FRTOS-Cortex-M3-M4.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.FreeRTOS.org%2FRTOS-Cortex-M3-M4.html%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EThe%20code%20block%20below%20works%20without%20any%20issues.%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSTRONG%3E%23define%20LZ_PORT_IRQN%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BPORTD_IRQn%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%23define%20LZ_PORT_IRQN_PRI%20%26nbsp%3B%20%26nbsp%3B(1)%3C%2FSTRONG%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%20class%3D%22%22%3E%3CSTRONG%3E%3CBR%20%2F%3Eapp_status_t%20GPIO_install_int%20(void)%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CSTRONG%3E%7B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%2F*%20Install%20LZ%20Button%20%26amp%3B%20INT%20interrupt%20handler%20*%2F%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20INT_SYS_InstallHandler(LZ_PORT_IRQN%2C%20RF_Instance_Int_Handler%2C%20(isr_t%20*)NULL)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%2F*%20Enable%20LZ%20Button%20interrupt%20handler%20*%2F%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20INT_SYS_EnableIRQ(LZ_PORT_IRQN)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20INT_SYS_SetPriority(LZ_PORT_IRQN%2C%20LZ_PORT_IRQN_PRI)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20if%20(INT_SYS_GetPriority(LZ_PORT_IRQN)%20!%3D%20LZ_PORT_IRQN_PRI)%20%7B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20return%20APP_STATUS_FAIL%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSTRONG%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20return%20APP_STATUS_OK%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%3CSTRONG%3E%7D%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FSTRONG%3E%3CDIV%3E%3CDIV%3E%3CSTRONG%3Evoid%20RF_Instance_Int_Handler%20(void)%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%7B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20uint32_t%20u32Flags%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20u32Flags%20%3D%20GPIO_AML_GetInterruptFlags(SW_INT_LZ_INSTANCE)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%2F*%20Check%20if%20interrupt%20comes%20from%20LZ%20INT%20pin%20*%2F%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20if%20(u32Flags%20%26amp%3B%20(1%20%26lt%3B%26lt%3B%20LZ_INT_PIN_NB))%20%7B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20BaseType_t%20xHigherPriorityTaskWoken%20%3D%20pdFALSE%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20xTaskNotifyFromISR(RF_TaskHandle%2C%200%2C%20eNoAction%2C%20%26amp%3BxHigherPriorityTaskWoken)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20if%20(xHigherPriorityTaskWoken)%20%7B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20portYIELD_FROM_ISR(xHigherPriorityTaskWoken)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20GPIO_AML_ClearInterruptFlags(SW_INT_LZ_INSTANCE%2C%20LZ_INT_PIN_NB)%3B%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%26nbsp%3B%20%26nbsp%3B%20%7D%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%7D%3C%2FSTRONG%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CSPAN%3EBut%20I%20couldn't%20set%20this%20priority%20for%20Can%20interrupt.%26nbsp%3BHow%20can%20I%20set%20this%20priority%20for%20CAN%20RX%2C%20or%20what%20other%20solutions%20are%20there%20for%20this%20problem%3F%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1973912%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Can%20Callback%20Issue%20With%20Freertos%20TaskNotify%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1973912%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ESolved.%20Yes%2C%20that's%20right%20fucn.%20Thank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1973282%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K144%20Can%20Callback%20Issue%20With%20Freertos%20TaskNotify%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1973282%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eyou%20can%20set%20interrupt%20priority%20for%20given%20ISR%20in%20similar%20manner%20as%20for%20Port%20interrupt%2C%20using%26nbsp%3B%3CSTRONG%3ENT_SYS_SetPriority%3C%2FSTRONG%3E%20function.%20Just%20use%20right%20function%20parameters%2C%20like%3CBR%20%2F%3EINT_SYS_SetPriority(CAN0_ORed_0_15_MB_IRQn%2C%201)%3B%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E