cancel
Showing results for 
Search instead for 
Did you mean: 

External IRQ on PB15

erastus
Associate II

I am trying to catch a pulse on PB15. So I set the port PB15 to external irq with falling edge as per screen shot below

The code in MX_GPIO_Init() generated by MX is:

/*Configure GPIO pin : MPuls_Pin */

GPIO_InitStruct.Pin = MPuls_Pin;

GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;

GPIO_InitStruct.Pull = GPIO_PULLUP;

HAL_GPIO_Init(MPuls_GPIO_Port, &GPIO_InitStruct);

and the code in the call back is a simple test

// External Interrupt ISR Handler CallBackFun

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)

{

if(GPIO_Pin == MPuls_Pin) // INT Source is pin PB15{

// HAL_NVIC_DisableIRQ(EXTI15_10_IRQn);

// Serialprint((uint8_t *) "Hi\n");

if( IRQCheckI > 0) {

IRQCheckI = 0;

sprintf (TempBufCA, "%3d -> ", ++TempCI);

Serialprint(TempBufCA);

}

if ( MotorPosGI > 0) {

MotorPosGI=0;

Serialprint("\nMagnet at position\n");

}

// HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_11); // Toggle LED

}

}

I put a break point on the line if(GPIO_Pin == MPuls_Pin) // INT Source is pin PB15{ but the loop never get accessed by the external event.

Before the upgrade all was working well.
Can any one please assist.

erastus_0-1713595698892.png

 

 

 

 

 

6 REPLIES 6
MM..1
Chief III

Primary check if EXTI in NVIC is checked.

Yes it is unless I am missing something

If I set the pin to read the IO I do get the level changes but not the IRQ

 

erastus_0-1713597216782.png

erastus_1-1713597275256.png

 

 

 

 

You write update what? I see sometimes on updates is it file empty = code for irq isnt generated.

Thanks for you help.  I reinstalled the software (cube) and it is working. Something must have gone wrong its working now.

I mean uncheck NVIC generate and check back next generate repair this, but this bug i see long time in MX

First generate after update fail produce right files...

Many thanks,

I understand what you mean I thought the installation was not good.

Regards