2014-07-02 11:02 PM
Dear readers, how to configure a GPIO interrupt at port PG10 with CubeMX?
2014-07-21 08:16 AM
2015-01-21 08:03 AM
2015-07-24 03:34 AM
Actually it does NOT works with the latest version of cube MX (4.9). I'm using STM32F411 :
- I have configured input pins as EXTI 2, 3, 12 and 14 in the ''pinout'' tab- The NVIC allow EXTI interrupts for lines 3 and [15:10], so due to a bug I not able to have interrupt on EXTI2. Since this line is connected to a hi-speed ADC DRDY signal, I will obviously NOT handle it in polling mode.This is the third project in only one month that don't work because of a cubeMX bug. ST. time.wasted.2015-07-24 06:16 AM
Same here, HAl and CubeMx is just paint to work with.
this is how i was able to make interrupt work. But funny part, no other interrupt is working, only this one, maybe luck ?static void EXTI0_IRQHandler_Config(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
__HAL_RCC_GPIOA_CLK_ENABLE();
GPIO_InitStructure.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Pin = GPIO_PIN_0;
HAL_GPIO_Init(GPIOA, &GPIO_InitStructure);
HAL_NVIC_SetPriority(EXTI0_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(EXTI0_IRQn);
}
void EXTI0_IRQHandler(void)
{
if((EXTI->PR&0x0001)==0x0001)
{
//todo
EXTI->PR = 0x0001;
}
}
But i don't know will it work for you
2015-07-27 04:24 AM
Ok, so i try to config PB12 interrupt, with no luck. Have no idea what is wrong. Original EXTI example in notfunctional all together.
here is SPL approach for F4:void EXTI_Int(void)
{
EXTI_InitTypeDef EXTI_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12;
GPIO_Init(GPIOE, &GPIO_InitStructure);
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOE, EXTI_PinSource12);
EXTI_InitStructure.EXTI_Line = EXTI_Line12;
EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
EXTI_InitStructure.EXTI_LineCmd = ENABLE;
EXTI_Init(&EXTI_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x10;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
void EXTI15_10_IRQHandler(void)
{
if(EXTI_GetITStatus(EXTI_Line12) != RESET)
{
//ToDo
EXTI_ClearITPendingBit(EXTI_Line12);
}
}
Now this is what i am using right now, but it does not work.
void EXTI_Int(void)
{
uint32_t tmp = 0x00;
GPIO_InitTypeDef GPIO_InitStructure;
__HAL_RCC_GPIOE_CLK_ENABLE();
//SPL approach registers that are not set here, but still nothing
//tmp = ((uint32_t)0x0F) << (0x04 * (0x0C & (uint8_t)0x03));
//SYSCFG->EXTICR[0x0C >> 0x02] &= ~tmp;
//SYSCFG->EXTICR[0x0C >> 0x02] |= (((uint32_t)0x04) << (0x04 * (0x0C & (uint8_t)0x03)));
GPIO_InitStructure.Mode = GPIO_MODE_IT_RISING;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Pin = GPIO_PIN_12;
HAL_GPIO_Init(GPIOE, &GPIO_InitStructure);
HAL_NVIC_SetPriority(EXTI15_10_IRQn, 2, 0);
HAL_NVIC_EnableIRQ(EXTI15_10_IRQn);
}
extern uint32_t program_counter;
void EXTI15_10_IRQHandler(void)
{
if((EXTI->PR&0x01000)==0x01000)
{
SPI_Config();
EXTI->PR = 0x01000;
}
}
2015-07-28 02:15 AM
So this is fun. Switching to STM32F7 , getting lot of problems, and not even single useful replay that solved my problem in multiple threads
So basically what STM did, is reduced community to people who only developing on they own.2015-07-28 07:43 AM
Have you Googled EXT1 or EXTI interrupts and so on. There are quite a lot of information and examples about EXT interrupts on ST ARM. I found some which looked useful for my own purposes, but I have not tested them yet.
2015-07-28 09:00 AM
i was googling alot. No examples wih HAL libraries.
This is what i don't like, with SPL i have tones of examples, and with HAL, only in CubeMx folder, but not all of them work, or doing what i need, like circular dma for spi2015-07-30 07:29 AM
Dear All,
This issue will be fixed in MX 4. Please find attached C code for EXTI2 initialization on F4DISCOVERY (F407). Best regards ________________ Attachments : proj1.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzQv&d=%2Fa%2F0X0000000bMq%2F_KSjHmaUivWMy2iY2WY7cYVBAmIfgtAoGl4Q2fPUyzI&asPdf=false