7035 - Propel: Why Propel Timer/Counter IP register settings were reset when I start/stop the timer with driver API?

7035 - Propel: Why Propel Timer/Counter IP register settings were reset when I start/stop the timer with driver API?

Description:
This is due to a software bug in gp_timer.c where the gp_timer_config and gp_timer_stop API used reg_32b_write instead of read-modify-write reg_32b_modify. When write to control register, it overwrite the register value instead of masking the specific bit. Thus the pre-set value in timer control register was reset.

Solution:
The workaround is to apply read-modify-write which is reg_32b_modify to replace reg_32b_write. It will preserve other bits and only change stop bit (bit-3). This apply the same to gp_timer_config and gp_timer_stop .

Example:
unsigned char gp_timer_stop(struct gp_timer_instance *this_timer, unsigned char timer_src)
{
if(this_timer == NULL || timer_src > this_timer->timer_num || timer_src < GP_TIMER0)
return 1;

        reg_32b_modify(this_timer->base_addr | TIMER0_CON | timer_src*0x10, 0x08);

return 0;
}

This issue is schedule to be fixed in upcoming Propel software release.