AnsweredAssumed Answered

STM32L152 - EXTI and SPI interference

Question asked by m schuh on May 28, 2018
Latest reply on May 28, 2018 by waclawek.jan

I am having issues using extrenal interrupts together with the spi on my stm32l152re-nucleo board.
I am using the STM32CubeL1 LL Drivers in the 1.8.0 Version.

 

I am working with an external device that should give me some interrupt on the PC7 pin. Furthermore I communicate with that device using spi. The SPI MOSI line is connected on the PA7 pin.

 

Now I have the following problem: Everytime I put data on the MOSI line my interrupt function will be invoced and I have no way to distinguish if it is a real interrupt or just data on my mosi line.

 

My interrupt initialization:

//enable active high interrupt on PC7
LL_GPIO_SetPinMode(GPIOC, LL_GPIO_PIN_7, LL_GPIO_MODE_INPUT);
LL_GPIO_SetPinPull(GPIOC, LL_GPIO_PIN_7, LL_GPIO_PULL_NO);

LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_SYSCFG);
LL_SYSCFG_SetEXTISource(LL_SYSCFG_EXTI_PORTC, LL_EXTI_LINE_7); 

LL_EXTI_EnableIT_0_31(LL_EXTI_LINE_7);
LL_EXTI_EnableRisingTrig_0_31(LL_EXTI_LINE_7);

NVIC_EnableIRQ(EXTI9_5_IRQn);
NVIC_SetPriority(EXTI9_5_IRQn, 0);

 

I suspect that there is a bug in the LL_SYSCFG_SetEXTISource function. Maybe it also sets the Bit for the PA7(MOSI) line to be passed to the EXTI line? Otherwise I think I should not get interfered with the mosi signal on the interrupt line.

Can someone confirm this as a bug or does somebody know a way to distinguish between a rising edge on mosi(PA7) and the correct interrupt line(PC7)?

Outcomes