Hello Radek,
Looks like I have identified the root cause for the issue mentioned.
Here, In bootloader I do initialize the CPU registers as shown below,
CPMUCOP = 0x44;
CPMUPROT = 0x26;
CPMUCLKS = 0x80;
CPMUOSC = 0x80;
CPMUREFDIV = 0x80;
CPMUSYNR = 0x01;
CPMUPOSTDIV = 0x00;
CPMUPLL = 0x00;
while (!UPOSC){}
CPMUCLKS |= 3;
Now, in application I do initialize the initialize the CPU registers in the same way except watchdog.
CPMUPROT = 0x26;
CPMUCLKS = 0x80;
CPMUOSC = 0x80;
CPMUREFDIV = 0x80;
CPMUSYNR = 0x01;
CPMUPOSTDIV = 0x00;
CPMUPLL = 0x00;
while (!UPOSC){}
CPMUCLKS |= 3;
So now, please look into the observations below,
1) When I flash application only, and monitor the CPMUCLKS register value at run time, I can observe 0x83,
2) When I flash bootloader only, and monitor the CPMUCLKS register value at run time, I can observe 0x83.
3) But when both the bootloader and application are flashed on to the bus, and controll is in application now I can read CPMUCLKS value as 0x82 only.
So in the 3rd observation I can see COPOSCSEL0 is not set, but I need that bit to be set because OSCCLK should be used for COP on my project.
So, One more observation I have made in application is I am initializing the CPMUCOP far later the initialization of CPU clock regusters.
What I observed is when control jumps from bootloader to application watchdog is already initialized and I am not able to set the COPOSCSEL0 forever.
What should I do to set the COPOSCSEL0 bits in application when bootloader is present.
Is there any dependency between the COPOSCSEL0 and CPMUCOP registers?
Please let me know your comments.
Thanks in advance,
Regards
Ganesh Vijaya Kumar P.