DSPLink下,参考readwrite的例子,定位到:当DSP调用TIMER_INIT()初始化TIMER后,ARM端的SATA数据无法存盘(具体表现umount不了DISK);若注释掉TIMER_init(),则DSP端EDMA又会跑飞…(DSP端为EDMA从EMIFA接口接收数据);TIMER为共享资源,改怎么配置或者处理!
————————————————————————————-
======================= USTIMER_init(void)====================================
//—————————————————————————–
// \brief initialize the microsecond timer.
//
// \param none.
//
// \return uint32_t
// ERR_NO_ERROR – everything is ok…us timer ready to use.
// ERR_INIT_FAIL – something happened during initialization.
//—————————————————————————–
uint32_t USTIMER_init(void)
{
// configure timer 0 for free run.
// 32-bit unchained mode, timer3:4 /12 prescaler.
// enable muxed pins as gpio outputs and disable all related interrupts.
// would need to also setup the pinmux register to select the gpio
// function of these pins in order to use as gpio.
TMR0->GPINT_GPEN = GPENO12 | GPENI12;
TMR0->GPDATA_GPDIR = GPDIRO12 | GPDIRI12;
// stop and reset timer.
TMR0->TGCR = 0x00000000;
TMR0->TCR = 0x00000000;
// disable interrupts and set emulation to free run.
TMR0->INTCTLSTAT = 0;
SETBIT(TMR0->EMUMGT, SOFT | FREE);
// config timer0 in 32-bit unchained mode.
// remove timer0 – 3:4 from reset.
SETBIT(TMR0->TGCR, PRESCALER(TIMER_DIV – 1) | TIMMODE_32BIT_UNCHAINED | TIM34RS );
// init timer0 – 1:2 period….use full range of counter.
TMR0->TIM34 = 0x00000000;
TMR0->PRD34 = 0xFFFFFFFF;
// start timer0 – 3:4.
SETBIT(TMR0->TCR, ENAMODE34_CONT);
// configure timer 1 for start/stop.
// 32-bit unchained mode, timer3:4 /12 prescaler.
// enable muxed pins as gpio outputs and disable all related interrupts.
// would need to also setup the pinmux register to select the gpio
// function of these pins in order to use as gpio.
TMR1->GPINT_GPEN = GPENO12 | GPENI12;
TMR1->GPDATA_GPDIR = GPDIRO12 | GPDIRI12;
// stop and reset timer.
TMR1->TGCR = 0x00000000;
TMR1->TCR = 0x00000000;
// disable interrupts and set emulation to free run.
TMR1->INTCTLSTAT = 0;
SETBIT(TMR1->EMUMGT, SOFT | FREE);
// config timer1 in 32-bit unchained mode.
SETBIT(TMR1->TGCR, PRESCALER(TIMER_DIV – 1) | TIMMODE_32BIT_UNCHAINED);
// init timer1 – 3:4 period….0 until someone calls delay().
TMR1->TIM34 = 0x00000000;
TMR1->PRD34 = 0x00000000;
return (ERR_NO_ERROR);
}
gg weee:
linux用TIMER0来维持自身的jiffies,TIMER1用于看门狗定时器,所以DSP最好用TIMER2和TIMER3
你DSP直接操作TIMER0是要出问题的
user3688025:
回复 gg weee:
从哪里看到的linux使用到了定时器0与1呢,或是其他的外设