I created two software entities: BootManager and Application. The Application uses CAN, and the BootManager jumps to the Application. When running the Application alone, it works correctly, and the clock initializes the CAN. However, when both are running together, the Application enters a fault because the clock doesn't initialize the CAN registers.
While debugging, I found that after jumping to the Application during system initialization, the MTrans register is set to 1. Commenting out this part in the system initialization resolves the issue. Is there a way to deinitialize all peripherals and clocks before jumping to the Application, ensuring the clock is correctly initialized?
Hello,
Is there a way to deinitialize all peripherals and clocks before jumping to the Application, ensuring the clock is correctly initialized?
Yes, you can do it in ME module. Not sure which device you are asking for, but most MPC has Magic carpet with Mode Entry.
For example:
Basically you will simply halt peripherals which has possibility to do so in their registers.
Then you will set Run Peripheral Configuration Register (MC_ME_RUN_PCn) to freeze clock in target mode.
Do the mode transition to target mode
And you will verify it in status register if the clock is frozen. Peripheral Status Register 0 (MC_ME_PS0)
Best regards,
Peter