c++ - Startup of stm32f100rbtx -
i found problem running program on stm32f100rbtx. using eclipse + zadig + openocd. working fine until tried handle interrupts.
looking through google think problem in startup file , assembler file. looked proper files without success. me repair file or 1 ?
pastebin . com/wsrxr2yi -- vectors.c (have no reputation)
my main:
#include "stm32f10x.h" #include "mygpio.h" typedef my_gpio<gpioc_base,8> blueled; typedef my_gpio<gpioa_base,0> button; int main(void) { //gpio_inittypedef gpio_initstructure; volatile int dly; rcc->apb2enr |= rcc_apb2enr_iopcen | rcc_apb2enr_iopaen; rcc->apb1enr |= rcc_apb1enr_tim3en; blueled::setmode(pinmode_output_2mhz); tim3->psc = 23999; // set prescaler 24 000 (psc + 1) tim3->arr = 1000; // auto reload value 1000 tim3->dier = tim_dier_uie; // enable update interrupt (timer level) tim3->cr1 = tim_cr1_cen; // enable timer nvic_enableirq(tim3_irqn); // enable interrupt tim3 (nvic level) while (1) { for(dly = 0; dly < 500000; dly++) ; blueled::sethigh(); } } void tim3_irqhandler() { ///irq flag cleared -- program never here(checked) }
Comments
Post a Comment