Other Parts Discussed in Thread: C2000WARE
I have problems restarting CPU2 with the following code (running on CPU1 of course):
EALLOW;
// Reset pulse to CPU2
DevCfgRegs.CPU2RESCTL.all = 0xA5A50001;
DELAY_US(100);
DevCfgRegs.CPU2RESCTL.all = 0xA5A50000;
EDIS;
// And restart CPU2
IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
This code works fine after power up but can fail for restart later on.
Debugging the boot code of CPU2 I noted that the variable c2brom_status in the file c2brom_boot.c is not being initialized after reset or at least at the start of the function c2brom_system_init().
In the function c2brom_system_init() the progress of the boot is shown setting one bit after the other. CPU1 waits for a special pattern (0x2) on the lower 4 bits of the boot status to see that CPU2 has booted succesfully.
As c2brom_status is not initialized and often starts with the LSB set, the pattern 0x2 can't be reached but instead 0x3. So the boot fails.
The resulting question is:
How can I restart CPU2 in a save way from flash?
Best regards
Stefan