cancel
Showing results for 
Search instead for 
Did you mean: 

How to program user button interrupt with ecos

huangyg11
Associate II
Posted on May 03, 2014 at 07:35

hi, i'm using a stm32f4 board. and i want to write a program with ecos embeded system that  when i push user button, an interrupt will trigerd and do something.

i find the function cyg_interrupt_create(), but i need a interrupt vector. in the file /cyg/hal/var_intr.h , there are lots of  CYGNUM_HAL_INTERRUPT_xxx, how can i know which one i should use?

thanks in advanced!

#ecos
4 REPLIES 4
Posted on May 04, 2014 at 10:10

http://opencores.org/ocsvn/openrisc/openrisc/trunk/rtos/ecos-3.0/packages/hal/cortexm/stm32/var/current/include/var_intr.h

CYGNUM_HAL_INTERRUPT_EXTI0

Isn't the USER button PA0? Then use EXTI0 and configure the pin and exti.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
huangyg11
Associate II
Posted on May 04, 2014 at 16:03

thanks for the reply. I have tried exti0, but it doesn't work. i thought it might be that i had to configured something with ecos configtool, but i don't have idea how to

Posted on May 04, 2014 at 16:11

but i don't have idea how to

Me neither, and I don't see much ecos traffic here, perhaps there is a better forum?

You could review the STM32F4-DISCO firmware library, or that of the F4 DSP library, there should be button/exti examples in there.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
huangyg11
Associate II
Posted on May 05, 2014 at 06:23

It's trully EXTI0, and it don't need to configure something. it turned out it's my program faults.

Thanks you anain!