Part Number: TMS320F28069M
Other Parts Discussed in Thread: TMS320F28069, C2000WARE
Hello,
I am working with a custom board that includes a TMS320F28069 microcontroller. We tried to implement the Watchdog using the TI functions but it doesnt work. The microcontroller is constantly being reset by Watchdog.
These are the functions that we are using:
WDOG_BASE_ADDR = 0x00007022;
// initialize the watchdog driver
obj->wdogHandle = WDOG_init((void *)WDOG_BASE_ADDR,sizeof(WDOG_Obj));
WDOG_setPreScaler((void *)WDOG_BASE_ADDR, WDOG_PreScaler_OscClk_by_512_by_64);
WDOG_setCount((void *)WDOG_BASE_ADDR, 10);
WDOG_enable((void *)WDOG_BASE_ADDR);
WDOG_clearCounter((void *)WDOG_BASE_ADDR);
Debugging the code, these are the main points that we are seeing that are not working properly:
1- WDOG_init
Retuning NULL comparing "sizeof(WDOG_Obj) < sizeof(WDOG_Obj)".

2- WDOG_setPreScaler
Writing the same value of the WDCR in the WDKEY register.

3- WDOG_setCount
Not writting the value set (10) on the WDCNTR register.

4- WDOG_clearCounter
Not executing this step wdog->WDKEY = 0x55. I think this happen due to the Compiler Optimization Level -> 2- GLobal Optimizations. The point is that we cannot deactivated the Optimization due to not enough space in the flash.
Not writting the register wdog->WDKEY = 0xAA.

Due to the values 0x55 and 0xAA are not written in the WDKEY register the microcontroller resets.
Do you have any advice?
Thank you in advance
