cancel
Showing results for 
Search instead for 
Did you mean: 

STWINBX1 datalogger - struggling to configure a digital input as an external interrupt

johngj
Senior

I am using the STEVAL-STWINBX1 development board with the FP-SNS-DATALOG2 software.

I am struggling to configure PB1 as a digital input for an external interrupt (which is on pin 12 of the expansion connector CN1)...

 

johngj_0-1720779802175.png

I start by opening the .ioc file in STM32CubeMX...

  • \STM32CubeFunctionPack_DATALOG2_V2.1.1\Projects\STM32U585AI-STWIN.box\Applications\DATALOG2\mx\STEVAL-STWINBX1_FP-SNS-DATALOG2.ioc

 

Then I change PB1 to be an external interrupt, with a pull up resistor and falling edge trigger...

johngj_1-1720780624744.png

I then generate code in STM32CubeMX and refresh the project in STM32CubeIDE.

Am I correct in saying the interrupts are in the file stm32u5xx_it.c (as shown below) ?

johngj_2-1720781165393.png

Confusingly, there are two stm32u5xx_it.c files in the project in the following folders...

  • STM32CubeFunctionPack_DATALOG2_V2.1.1\Projects\STM32U585AI-STWIN.box\Applications\DATALOG2\mx\Src
  • STM32CubeFunctionPack_DATALOG2_V2.1.1\Projects\STM32U585AI-STWIN.box\Applications\DATALOG2\Core\Src

The file in the DATALOG2\mx\Src folder seems to be the one generated by STM32CubeMX, so I copied the stm32u5xx_it source and header files from the mx folder to the Core folder...

  • copied stm32u5xx_it.c from \DATALOG2\mx\Src to \DATALOG2\Core\Src
  • copied stm32u5xx_it.h from \DATALOG2\mx\Inc to \DATALOG2\Core\Inc 

When I tried to build the code, I got an error saying multiple definitions of "PendSV_Handler()" and "SysTick_Handler()".

So I deleted these from the stm32u5xx_it.c file and now it builds.

However, when I debug the project it appears to be going to a default interrupt and sitting in a for loop...

johngj_3-1720782541233.png

 

What am I doing wrong, how do I get this working ?

 

0 REPLIES 0