Hi, I'm stopped with strange problem - the following code:
static void test(void) {
fnDebugMsg("x\r\n");
}
static void node_schedule_write_timer(int delay) {
DMA_TIMER_SETUP dma_timer_setup;
uMemset(&dma_timer_setup, 0, sizeof(dma_timer_setup));
dma_timer_setup.int_type = DMA_TIMER_INTERRUPT;
dma_timer_setup.int_handler = test;
dma_timer_setup.channel = 1; // DMA timer channel 1
dma_timer_setup.int_priority = DMA_TIMER1_INTERRUPT_PRIORITY; // define interrupt priority
dma_timer_setup.mode = (DMA_TIMER_INTERNAL_CLOCK | DMA_TIMER_SINGLE_SHOT_INTERRUPT);
dma_timer_setup.count_delay = DMA_TIMER_MS_DELAY(1, 1, 5000);
fnConfigureInterrupt((void *)&dma_timer_setup); // enter interrupt for DMA timer test
}
Works fine compiled in CW but hangs on interrupt route exit in GCC. Interrupt route is executed (original interrupt routing is more complicated, I've shrink it for debug purposes). Hang is immediately after exit and the only way of recovery is watchdog reset.
Assembler code:
CW (works):
0000bbf8 <_test>:
bbf8: 41f9 0001 522e lea 1522e <_@527>,%a0
bbfe: 4eb9 0000 5e80 jsr 5e80 <_fnDebugMsg>
bc04: 4e75 rts
and GCC (hangs):
000116f8 <test>:
116f8: 4e56 0000 linkw %fp,#0
116fc: 4879 0001 8167 pea 18167 <dbm_to_mw_table+0x296>
11702: 4eb9 0000 6e7c jsr 6e7c <fnDebugMsg>
11708: 588f addql #4,%sp
1170a: 4e5e unlk %fp
1170c: 4e75 rts
Does anybody have an idea how can I go further with debugging it? The problem is more than strange because PIT timer and interrupt works fine at the same time.
Regards,
--
Andriy