HAL 2.x interrupt fail

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Frank-Lin
Level 4
Level 4
5 solutions authored 50 sign-ins 10 questions asked

Is there any bug in HAL 2.x?
I am using CY8CKIT-062S2-43012 and add a falling edge interrupt on P6_5.
When i low that pin, it can run into _cyhal_gpio_irq_handler, but Cy_GPIO_GetInterruptStatusMasked got 0 and jump to  Cy_SysLib_ProcessingFault.

following is my code:

#define _Set_Pin     (P6_5)
const char Int_Const_Set = 'S';
cyhal_gpio_init(_Set_PinCYHAL_GPIO_DIR_INPUT,  CYHAL_GPIO_DRIVE_PULLUPDOWN, 1); // input  pull high
cyhal_gpio_callback_data_t  cb;
cb.callback = Int_IntCallBack;
cb.callback_arg = (void*)&Int_Const_Set;
cyhal_gpio_register_callback(_Set_Pin,  &cb);
cyhal_gpio_enable_event(_Set_PinCYHAL_GPIO_IRQ_FALL, 1, true);


void Int_IntCallBack(void *callback_arg, cyhal_gpio_event_t event) {
  // do something
}
 
0 Likes
2 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @Frank-Lin ,

Can you try the below code example and see if you are facing the same issue.

https://github.com/Infineon/mtb-example-psoc6-gpio-interrupt/blob/master/main.c

Regards,

Alakananda
0 Likes

Hi Alakananda,
Sorry, because i have to run a demo tomorrow i will test it maybe next week.
Just for more detail, Cy_GPIO_GetInterruptStatusMasked is running ((32 >> 7) & 1) and get 0.
I'm not sure why is 7 not 5.

For now i use HAL 1.6 and everything run perfect with following code:
#define _Set_Pin     (P6_5)
const char Int_Const_Set = 'S';
cyhal_gpio_init(_Set_Pin,  CYHAL_GPIO_DIR_INPUT,  CYHAL_GPIO_DRIVE_PULLUPDOWN1); // input  pull high
cyhal_gpio_register_callback(_Set_Pin,  Int_IntCallBack, (void*)&Int_Const_Set);
cyhal_gpio_enable_event(_Set_Pin,  CYHAL_GPIO_IRQ_FALL1true);

void Int_IntCallBack(void *callback_argcyhal_gpio_event_t event) {
  // do something
}



0 Likes