MQX 3.8 (CW10.2)
in BSP: bsp_twrk60f120m Rev #: 3.8 Modified: 1/31/2012
file: bsp_cm.c
function: pll_init()
Line 349 appears to have an error and likely should be an OR-EQUAL (|=) instead of EQUAL (=) assignment.
Otherwise the AND-EQUAL (&=) line above it has no function. Without it, it never clears the IREFS and always returns 0x11 and stays clocked by the internal ref clock and throws off the timer calculations.
code snippet:
temp_reg = MCG_C1;
temp_reg &= ~(MCG_C1_CLKS_MASK | MCG_C1_FRDIV_MASK | MCG_C1_IREFS_MASK);
temp_reg = MCG_C1_CLKS(2) | MCG_C1_FRDIV(frdiv_val);
MCG_C1 = temp_reg;
My bsp_cm.c file is dated 12/28/2011.
I installed it 2/29/12 from FSLMQX_3.8.0_TWRK60F120M_PATCH.exe which seems to match the current one in the downloads area.
I have derived a BSP from this one. Is there a list anywhere of changes and corrections for the bsp_twrk60f120m BSP?
Thanks.
Hi Tugboat Captain,
The MQX3.8.1 will be released end of June or first week of July at latest.
That release will have a different method of handling the clocks.
We will be using the Processor Expert tool to initialize the clocks and using that tool should help to avoid the potential error you have found.
Hope this helps.
Regards,
David