2

I am trying to run an external DAC via SPI on a STM32L475 using DMA TX and I want to reset a variable (wait flag) in the interrupt routine

It works if I am not using DMA and the interrupt so I have setup SPI a.s.o. correctly but I want it to run faster and minimize software involvement.

I am using STM32CubeMX V 4.22.0 and IAR Workbench V 8.11.2.13606.

I declared a wait flag in main.c file before main function, tried volatile int, uint8_t and other variable settings but I cannot access it from the interrupt routine in stm32l4xx_it.c file.

I can access the variable in main function and in functions in the main.c file.

Do I need some include statement somehow for access from the interrupt routine?

I have spent all morning searching for a clue without any luck, I know this is a beginner question and appreciate any help I can get, thanks.

Peter1
  • 87
  • 1
  • 9
  • 1
    I found the solution looking in the interrupt file, I added the "extern" statement and my variable and it was solved. – Peter1 Jun 22 '18 at 08:54
  • Sorry, Berendi, I did not update the page so I did not see your answer. – Peter1 Jun 22 '18 at 08:56

0 Answers0