Other Parts Discussed in Thread: SYSBIOS
Tool/software: Code Composer Studio
Hello,
when using TCXO on CC1312, with simplelink_cc13x2_26x2_sdk_3_30_00_03, and calling Power_init early in main():
simplelink_cc13x2_26x2_sdk_3_30_00_03\source\ti\drivers\power\PowerCC26X2.c :
Power_init() tries to construct TCXO clock, but it is first call to ClockP_construct and this call sets ClockP_tickPeriod.
PowerCC26X2.c : 287: ClockP_construct(&PowerCC26X2_module.tcxoEnableClock, (ClockP_Fxn)&switchToTCXO, (CCFGRead_TCXO_MAX_START()*100)/ClockP_tickPeriod, NULL);
ClockP_tirtos:ClockP_construct:
77: /* temp workaround, need to reconsider */
78: ClockP_tickPeriod = Clock_tickPeriod;
This results in division by zero and passing 0 as timeout parameter, later failing in ClockP_start() call.
Trivial and ugly workaround:
#include <ti/drivers/dpl/ClockP.h>
#include <ti/sysbios/knl/Clock.h>
int main(void)
{
ClockP_tickPeriod = Clock_tickPeriod;
Power_init(); // or Board_init();
Best Regards,
Petr Ledvina