Part Number: 66AK2G12
Hi All,
I am trying to perform hard reset with software on microprocessor 66AK2G12. I managed to implement soft reset by software but not hard reset. Can anyone advice please? what is the problem with my code and why I couldn't have successful hard reset?
Thank you
The code:
#define PLLC_CFG_REGS 0x02310000U
#define RSCTRL_OFFSET 0x000000E8UL
#define RSCFG_OFFSET 0x000000ECUL
#define RSCTRL (PLLC_CFG_REGS + RSCTRL_OFFSET)
#define RSCFG (PLLC_CFG_REGS + RSCFG_OFFSET)
.
typedef unsigned long DWORD;
void Reboot()
{
volatile DWORD* rsctrl = (DWORD*)RSCTRL;
volatile DWORD* rscfg = (DWORD*)RSCFG;
DWORD key = 0x00005A69;
DWORD temp = *rsctrl;
temp &= ~(0x0000FFFF);
temp |= key;
*rsctrl = temp;
temp = *rscfg;
temp |= 0x0002000; //soft reset, by PLL controller: successful
// temp &= ~(0x0002000); //hard reset, by PLL controller: failed
*rscfg = temp;
temp = *rsctrl;
temp &= ~(0x0000FFFF);
temp |= key;
*rsctrl = temp;
temp = *rsctrl;
temp &= ~(0x00010000);
*rsctrl &= temp;
}
