Hello,
When I activate the CACHE_ALL in my code i get some strange behavior.
The DMTimerPreScalerClkEnable() function seems not working correctly.
After some investigation, I remarks that when I write to a DMTimer register and directly read that register, the data read doesn't reflect the data written before....If I wait for some delay before reading data, the data is correct.
Thus, I add some line in the DMTimer driver code (starterware) to wait until the data is correct.
void DMTimerPreScalerClkEnable(unsigned int baseAdd, unsigned int ptv)
{
/* Clear the PTV field of TCLR */
HWREG(baseAdd + DMTIMER_TCLR) &= ~DMTIMER_TCLR_PTV;
while((HWREG(baseAdd + DMTIMER_TCLR) & DMTIMER_TCLR_PTV));
/* Set the PTV field and enable the pre-scaler clock */
HWREG(baseAdd + DMTIMER_TCLR) |= (ptv & (DMTIMER_TCLR_PTV | DMTIMER_TCLR_PRE));
while(ptv != (HWREG(baseAdd + DMTIMER_TCLR) & (DMTIMER_TCLR_PTV | DMTIMER_TCLR_PRE)));
}
My question is "Is it a normal behavior ???"
FYI, I remark that also with another 32KHz clock source and without any cache activated...
Best regards,
Christian Lambricht