AnsweredAssumed Answered

Writing to Peripheral Timer on SC589

Question asked by jon_harris8 on Mar 21, 2017
Latest reply on Mar 21, 2017 by jon_harris8

I am trying to configure one of the peripheral timers on the SC-589.  It seems that writes to the config register do not work.  For example:

 

   * (volatile uint32_t *) REG_TIMER0_TMR2_CFG = 0x088C; // has no effect

 

The hardware reference says to verify the timer is not running before writing this register, which I did.  the TIMER0_RUN register is all zeros.

I tried this both from the ARM and the SHARC1 core.  Same results.  I can watch the TIMER0 registers in the CCES debugger and they do not change.  I can however change them from the CCES register browser and my changes take effect.  I am using the SC589 EZ-BOARD via the ICE 1000.

Other register writes to the timer block do appear to work.  If I first manually set the config register to 0x88C using the debugger, then this code works as expected:

   * (volatile uint32_t *) REG_TIMER0_TMR2_PER = 0x12345678; // works as expected, debugger shows change, reads back correctly

 

It seems to just be the configuration registers.

Furthermore, if I try to read back a config register from the ARM, I get a data fault exception:

 

   uint32_t rb = * (volatile uint32_t *) REG_TIMER0_TMR2_CFG; // generates data fault

A non-recoverable error or exception has occurred.

Description: Data Fault Exception - caused by attempting to access invalid data memory.

General Type: RunTimeError

Specific Type: ExceptAbrtData

Error Message: If this is a synchronous fault, address 0x310010a0 held in Data Fault Address Register (DFAR) is the problem address.

Error PC: 0xc1005124

 

 

 

From the SHARC, I can read back values set using the debugger, but still can't ever write to it.

This was tested after creating a very simple new bare metal project in CCES.  It is right after reset, so the timer registers are almost all zeros.

Outcomes