我在omap4460(皮质a9)上编写裸机代码(无操作系统),但我没有成功设置正确的gptimer1。
这是我的代码(遵循 OMAP4460 TRM)
/* for forwarding pending interrupts from distributor to Cpu interfaces */
*(volatile unsigned int *)(GICD_BASE + GICD_CTLR ) |= 0x00000001;
/* signaling interrupt by the cpu interface to the connected processor*/
*(volatile unsigned int *)(GICC_BASE + GICC_CTLR ) |= 0x00000001;
/* position the timer1 handler */
irq_table_function[GPT1_IRQ] = timer1handler;
/* clocks timer1 block */
*(volatile unsigned int *)CM_WKUP_CLKSTCTRL |= 0x00000003;
*(volatile unsigned int *)CM_WKUP_GPTIMER1_CLKCTRL |= 0x01000000;
*(volatile unsigned int *)CM_WKUP_GPTIMER1_CLKCTRL |= 0x00000002;
/* enable GPTimer1 functional and interface blocks */
*(volatile unsigned int *)GPT1MS_TIOCP_CFG |= 0x00000300;
/* capture interrupt enable */
*(volatile unsigned int *)GPT_TIER |= 0x00000004;
/* enable autoreload */
*(volatile unsigned int *)GPT_TCLR |= 0x00000002;
/* prescaler equal to zero */
*(volatile unsigned int *)GPT_TCLR &= ~0x0000003C;
/* positive increment value */
*(volatile unsigned int *)GPT_TPIR = 232000;
/* negative increment value */
*(volatile int *)GPT_TNIR = -768000;
/* load value */
*(volatile unsigned int *)GPT_TLDR = 0xFFFFFFE0;
/* enable timer1 */
*(volatile unsigned int *)GPT_TIER |= 0x00000001;
当我运行代码时,我从不去我的中断向量表,我的中断向量表设置正确,因为“svc 0”有效。
我什至没有看到计时器在运行。
请任何想法,我错过了什么?罗尼。