120MHz, K21 controller causes hard fault if I set flash clock between 20 to 24MHz, it is fine for Below 20MHz, I am using external (12MHz) crystal with PEE mode.
I could not corner the issue, please help!
Thank you for your post, however please consider moving it to the right community place (e.g. Kinetis Microcontrollers) to get it visible for active members.
For details please see general advice Where to post a Discussion? ( https://community.freescale.com/docs/DOC-99909 )
Thank you for using Freescale Community.
If the Flash clock is too high Flash reads are unreliable and the code will tend to fail (immediately).
Are you sure of the clock speed that you are setting since it should work reliably up to 25MHz - the bus clock speed should however not be set lower than the Flash clock speed.
I recommend setting the Flash clock to a lower speed that works and then let the SW verify the system clock speed (eg. switch a clock to the CLOCKOUT pin so that it ca be measured, or use a timer interrupt that is running from a defined clock to verify that it is as expected.
I have seen similar problems where the system clock was mistakenly set up too high (thinking that it was 100MHz for example when it was really 200MHz) and so the Flash clock rate was also too high. It tends to be the Flash that fails first in this case.
Retrieving data ...