Greetings!
I am trying to follow the steps in the TRM to properly initialize my controller with the Mode Entry module. I have some Mode Entry module code written in main.c that I believe closely resembles the instructions from the manual, but when my program tries to execute the second write to the MC_ME_MCTL register, it just hangs. Also, according to the MC_ME_GS register, the controller appears to start a mode transition but it never completes.
Can you please take a look at my project (attached) and help me identify what the problem is?
My end goal is to get the ADC1 module operational: configure the ADC registers and then read from the ADC. You will notice that I haven't enabled any clocks for other peripherals, and that is the reason.
Thank you for your time!
Paul
Solved! Go to Solution.
Hello,
but when my program tries to execute the second write to the MC_ME_MCTL register, it just hangs.
not sure what prevents you from transition, there could be following reasons:
1. You have incorrectly configured clocks
2. you have peripherals which clock is still active. For example CAN module, PWM module, etc.. is still running from clock source which will be changed in target mode.
I suggest to have a look at very basic examples either community ones or S32DS ones:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5746C
Best regards,
Peter
Hello,
there is a clock configuration guide:
Such will ease your work with clocks and their configuration.
https://www.nxp.com/docs/en/application-note/AN5392.pdf
best regards,
Peter
Thanks Peter.
The issue was incorrectly configured clocks, as you suggested. Once I got that right I ended up just using the clock_manager inside Processor Expert to configure everything and initialized by calling the two functions below, which I learned about through some of the examples in the S32 SDK (the functions are in clock_MPC57xx.c). Just using the CLOCK_DRV_Init processor expert function was not enough.
Hello,
but when my program tries to execute the second write to the MC_ME_MCTL register, it just hangs.
not sure what prevents you from transition, there could be following reasons:
1. You have incorrectly configured clocks
2. you have peripherals which clock is still active. For example CAN module, PWM module, etc.. is still running from clock source which will be changed in target mode.
I suggest to have a look at very basic examples either community ones or S32DS ones:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5746C
Best regards,
Peter
@petervlna Thanks for your reply.
I am looking at example MPC5746C PIT ISR GHS614 and trying to mimic Mode Entry steps from that. I am still having same issue but I will keep trying.
Question: Can I alternatively use the clock_manager component inside Processor Expert to do the Mode Entry work for me? Will it work standalone or do I still need supplement the clock_manager component with code to get everything working just right?
Paul