Working with the MIMXRT1021 EVK board with MCUXpresso and gcc.
I'm changing the clock frequency to conform to the lower maximum core clock for the industrial temperature rated parts.
The auto-generated code in clock_config.c may have an issue when changing the source and frequency of the AHB clock. In this case is is necessary to not declare SKIP_SYSCLK_INIT. The generated code is:
#ifndef SKIP_SYSCLK_INIT
/* Disable Semc clock gate. */
CLOCK_DisableClock(kCLOCK_Semc);
/* Set SEMC_PODF. */
CLOCK_SetDiv(kCLOCK_SemcDiv, 5);
/* Set Semc alt clock source. */
CLOCK_SetMux(kCLOCK_SemcAltMux, 0);
/* Set Semc clock source. */
CLOCK_SetMux(kCLOCK_SemcMux, 0);
#endif
- (Simple issue for information). If this is compiled with no optimization then the inline functions are treated as normal functions. If the stack pointer is in external RAM this causes a problem when the SEMC clock is disabled. Perhaps this could be highlighted in a comment.
- There is no corresponding call to CLOCK_EnableClock(kCLOCK_Semc). This can be added by hand, but the change is over-written if the file is updated again from the tool.
In point (2). Have I missed something? If not then could the call to CLOCK_EnableClock(kCLOCK_Semc) be added to this section of code as an output from the Clocks tool?
Hi John Aldridge,
Thanks for your reply.
Yes, you're right, it conditionally depending on whether external RAM is used.
Have a great day,
TIC
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------