Hello all,
I friendly forum member found an issue right off the bat with MotorWare _12 (this has actually been in every version of MotorWare).
The HAL_setupClks (formerly DRV_sertupClks) function needs the order of its commands adjusted slightly.
The CLK_setOscSrc function should be called before CLK_disableClkIn
Otherwise you can run into an issue if the device already has code running from flash.
This has been updated on our working branch and will be released in _13. If you would like to fix it now, just update the hal.c function in all of the board directories you are using:
C:\ti\motorware\motorware_1_01_00_12\sw\modules\hal\boards\..
void HAL_setupClks(HAL_Handle handle)
{
HAL_Obj *obj = (HAL_Obj *)handle;
// enable internal oscillator 1
CLK_enableOsc1(obj->clkHandle);
// set the oscillator source
CLK_setOscSrc(obj->clkHandle,CLK_OscSrc_Internal);
// disable the external clock in
CLK_disableClkIn(obj->clkHandle);
// disable the crystal oscillator
CLK_disableCrystalOsc(obj->clkHandle);
// disable oscillator 2
CLK_disableOsc2(obj->clkHandle);
// set the low speed clock prescaler
CLK_setLowSpdPreScaler(obj->clkHandle,CLK_LowSpdPreScaler_SysClkOut_by_4);
// set the clock out prescaler
CLK_setClkOutPreScaler(obj->clkHandle,CLK_ClkOutPreScaler_SysClkOut_by_1);
return;
} // end of HAL_setupClks() function