This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Strange Timer4 ISR Flag behavior after booting from SPI flash

I have a simple StarterWare project and it runs fine when loading/debugging through JTAG. This code runs in DDR memory. This project configures TIMER4 for auto reload interrupts every 75Hz. The ISR pulses GPIO_0_8 as shown below:

static void Timer4Isr(void)

{

uint32_t reg32;

 

GPIO_LED_SET(GPIO_LED_TIMER4_INT);             // GPIO_0_8 = 1

 

reg32 = DMTimerIntStatusGet(SOC_DMTIMER_4_REGS);

if (reg32 != DMTIMER_INT_OVF_EN_FLAG)

debug_print(DEBUG_INFO, "DMTimer4IntStatusGet %d\n", reg32);

 

// Clear interrupt status

DMTimerIntStatusClear(SOC_DMTIMER_4_REGS, DMTIMER_INT_OVF_EN_FLAG);

 

   GPIO_LED_CLR(GPIO_LED_TIMER4_INT);         // GPIO_0_8 = 0

}

 

When running thru CCS JTAG debugger, reg32 is always DMTIMER_INT_OVF_EN_FLAG so debug_print never gets called which is correct.

I then boot and load from SPI flash. The code runs but it now prints “DMTimer4IntStatusGet 0” on the 2nd and subsequent interrupts. In other words, the IRQ status is “0” even though GPIO_0_8 still pulses at 75Hz.

I then added the following line after DMTimerIntStatusClear:

HWREG(SOC_DMTIMER_4_REGS + DMTIMER_IRQ_EOI) = 0;

 

DMTimerIntStatusGet now always returns DMTIMER_INT_OVF_EN_FLAG. According to the TRM, DMTIMER_IRQ_EOI is for DMA.

What is my bootloader missing or doing wrong that would cause it to behave differently than running from the CCS IDE/JTAG? The same thing happens with Timer2. JTAG debugging uses the BeagleboneBlack.gel file. My SPI boot loader is based on the StarterWare bootloader project.