1. Have you enabled a clock to the timer anywhere like
RCC_APB1PeriphClockCmd (RCC_APB1Periph_TIM6, ENABLE); 2. Have you named an IRQ handler right?void TIM6_IRQHandler(void)
{
...
} 3. Have you added the correct startup file to the project? For instance, ''startup_stm32f10x_hd.s''. Look inside your startup file: can you find a line ''TIM6_IRQHandler'' there?
And the application works fine when located at 0x0800 0000. And I have also move the interrupt vector table using: NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x8100); It's so stange. No I have also found when the MCU receives a byte on UART5 I get a Bus Fault exception (a jump to BusFault_Handler(). I have looked at the memory addresses for these interrupt vectors and they are correct. I use a STM32F103ZET6 device. Is there any chip errata on this?
Your trouble are due to the fact that your application start boundary is not multiple of 0x200 : ''0x08008100''. Please move it to be at ''0x08008200''. Have a look on our
: Page 133 : ''you must align the offset to the number of exception entries in the vector table. The minimum alignment is 128 words'' , word is 32-bits that means 128 x 4 = 512 Bytes . This is mainly due to the Vector table size of our High-density devices Cheers, STOne- Your STM32 Moderator.
Your TIM6 interrupt doesn't seem to do much, just increment a RAM variable and leave. It does not appear to actually clear any interrupt, so it will get stuck there endlessly as it repeatedly tail-chains.
Be aware also that SystemInit() is already called before it executes main() 08008354 SUB16 TIM6_IRQHandler: 08008354 B480 push {r7} 08008356 AF00 add r7, sp, #0 08008358 F240 0300 movw r3, #0 ; $0 0800835C F2C2 0300 movt r3, #8192 ; $2000 08008360 681B ldr r3, [r3, #0] 08008362 F103 0201 add.w r2, r3, #1 ; $1 08008366 F240 0300 movw r3, #0 ; $0 0800836A F2C2 0300 movt r3, #8192 ; $2000 0800836E 601A str r2, [r3, #0] 08008370 46BD mov sp, r7 08008372 BC80 pop {r7} 08008374 4770 bx lr Translates roughly to : int foo; void TIM6_IRQHandler(void) { foo++; }
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..