我发现在 STM32F100RBTx 上运行程序有问题。我正在使用 eclipse + zadig + openOCD。一切正常,直到我尝试处理一些中断。
通过谷歌查看我认为问题出在启动文件和汇编文件中。我寻找合适的文件,但没有任何成功。谁能帮我修复那个文件或寻找另一个文件?
粘贴箱。com/WSrXr2Yi --vectors.c(没有声誉)
我的主要:
#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 to 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 from TIM3 (NVIC level)
while (1) {
for(dly = 0; dly < 500000; dly++)
;
blueLed::setHigh();
}
}
void TIM3_IRQHandler()
{
///irq flag cleared -- the program was never here(checked)
}