Hello,
At the moment I'm learning how to program the MPC5744P and am currently unable to solve this issue when trying to create a simple UART application.
When I use the UART + CAN example for the MPC5744P both UART and CAN in loopback mode work fine. However, when I create a new project and include the uart header and source file used in the example project I get a 'source not available' error as can be seen in de screenshot.
I also used the peri_clock_gating function and added the part for LINFlexD_0.
Can anyone help me fix this seemingly easy project and refer me to an explanation on IVOR? I find it hard to find more information about this online...
Regards,
Ruben
Solved! Go to Solution.
Hi Ruben,
there's problem with your peri_clock_gating() function:
void peri_clock_gating(void){
MC_ME.RUN_PC[0].R = 0x00000000; /* gate off clock for all RUN modes */
MC_ME.RUN_PC[1].R = 0x000000FE; /* config. peri clock for all RUN modes */
MC_ME.PCTL204.B.RUN_CFG = 0x1;//LINFlexD_0: select peripheral config RUN_PC[1]
}
That's not enough. To apply the configuration, it is necessary to enter or re-enter required mode.
In your project, the LINFlex peripheral is not enabled in Mode Entry module, the registers are not accessible because the module is still turned off, so access is terminated by bus error which leads to Machine Check exception.
You can take a look at this example to see how to do that:
Search for function SysClk_Init();
If you are interested in more examples:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5744P
And if you want to generate own clock configuration, you can use this tool:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Excel-MPC5744P-Clock-Configurator/ta-p/1129245
More tools can be found here:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-document-amp-tool-list/ta-p/1122346
Hope this helps.
Regards,
Lukas
Hi Ruben,
there's problem with your peri_clock_gating() function:
void peri_clock_gating(void){
MC_ME.RUN_PC[0].R = 0x00000000; /* gate off clock for all RUN modes */
MC_ME.RUN_PC[1].R = 0x000000FE; /* config. peri clock for all RUN modes */
MC_ME.PCTL204.B.RUN_CFG = 0x1;//LINFlexD_0: select peripheral config RUN_PC[1]
}
That's not enough. To apply the configuration, it is necessary to enter or re-enter required mode.
In your project, the LINFlex peripheral is not enabled in Mode Entry module, the registers are not accessible because the module is still turned off, so access is terminated by bus error which leads to Machine Check exception.
You can take a look at this example to see how to do that:
Search for function SysClk_Init();
If you are interested in more examples:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5744P
And if you want to generate own clock configuration, you can use this tool:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Excel-MPC5744P-Clock-Configurator/ta-p/1129245
More tools can be found here:
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-document-amp-tool-list/ta-p/1122346
Hope this helps.
Regards,
Lukas
Hi Lukas,
Thanks for the extensive answer. I managed to fix to the issue!
Regards,
Ruben