cancel
Showing results for 
Search instead for 
Did you mean: 

interrupt isn't executed, CodeSourcery G++ toolchain

rockydt18
Associate II
Posted on October 27, 2009 at 11:09

interrupt isn't executed, CodeSourcery G++ toolchain

4 REPLIES 4
rockydt18
Associate II
Posted on May 17, 2011 at 13:27

Hey!

I'm using the newest toolchain from CodeSourcery and the provided linker scripts files from lanchon(CS3 framework). I can download and debug my project without any problems to the target, but none of my interrupts is executed.

I have i.e. configured the SysTick interrupt correctly(initialized it,enabled interrupt, set clock, reload value etc.) and in my nvic_init() i have used this expression:

extern void (* const __cs3_interrupt_vector[])(void);

 

SCB->VTOR = (u32) __cs3_interrupt_vector

depending on the linker file i choose(ram.ld or rom.ld) the value for __cs3_interrupt_vector is 0x20000000(ram) or 0x08000000(rom), so the location of the vector table is done correclty. Where else could the error be? What could i check to get an idea where the error might be...??

with kind regards

--

rocky

gds2
Associate II
Posted on May 17, 2011 at 13:27

Not familiar with what ''lancheon'' has set up. However, I am also using the CS chain but with just the STM32 library code. To make a systick ISR you have to override the ''weak'' function definition ''SysTick_Handler'' provided in startup_*.s with a real definition. For me SysTick_Handler is located at 0x080035dc in flash.

A useful way to see where thing are is with:

arm-none-eabi-objdump -sxS .elf | less

rockydt18
Associate II
Posted on May 17, 2011 at 13:27

Hey!

First of all, thx gds for your reply.

I'm now getting interrupts when i download in FLASH section, without any problems.

But it still doesn't work in the RAM section. Relocation of the vector table is done correctly, also the interrupt handlers are initialized correctly and i looked in my disassembled file, and there where push and pop instructions for the interrupt handlers. So it seems everything should work ok...

What could be still wrong...?

If i download in flash, i press resume in eclipse and the application starts and breaks at main(i inserted a ''break main'' command in the GDB init).

Then I press again resume to run it. If I try now to trigger an interrupt it won't work. The next thing that I do, is to press the reset button on my target board and the application gets stopped again at ''main'' in eclipse. Therefore I press again resume to run the application but now the interrupts get fired. So if i would do that same sequence while downloading the application in the RAM, the application would be lost when press the reset button 🙂 somehow clear...

Hope someone has a good advice..

with kind regards

--

rocky

janvi
Associate II
Posted on May 17, 2011 at 13:27

Possibly your GDB is doing any peripheral initialisation what is incompatible to parts of your startup initialisation? The periph-library typically offers a de-init function call for each peripheral what allows to start the own init setup from a well defined state equal to reset.