MPC5746C Mode Entry Help

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5746C Mode Entry Help

Jump to solution
734 Views
pstammii
Contributor II

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

0 Kudos
Reply
1 Solution
713 Views
petervlna
NXP TechSupport
NXP TechSupport

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

View solution in original post

0 Kudos
Reply
4 Replies
674 Views
petervlna
NXP TechSupport
NXP TechSupport

Hello,

there is a clock configuration guide:

https://www.nxp.com/products/processors-and-microcontrollers/power-architecture/mpc5xxx-microcontrol...

petervlna_0-1719212957021.png

Such will ease your work with clocks and their configuration.

https://www.nxp.com/docs/en/application-note/AN5392.pdf

best regards,

Peter

 

0 Kudos
Reply
669 Views
pstammii
Contributor II

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.

pstammii_0-1719253389991.png

 

0 Kudos
Reply
714 Views
petervlna
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
708 Views
pstammii
Contributor II

@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

0 Kudos
Reply