Part Number: LAUNCHXL-F280049C
Other Parts Discussed in Thread: MOTORWARE
Universal motor control SDK via GPIO switch and symbol (CMD_SWITCH_EN) cause immediate motor startup fault.
Random other faults then appear just clearing fault flag bit. Simply adding the symbol into the project build adds below variables that lead to the immediate motor startup fault flag after MCU reset, application not run in CCS debug. Setting motor run (flagEnableRunAndIdentify = true) has no effect without CCS debug. So tried to configure GPIO to control the flag from an outside source but that causes other issues to evolve as described.
Applicaiton don't even have to call below function for the startup fault to occur. Setting the initial GPIO input state to write a low or high makes no difference, debounce delay time set very high >1000U. So the outside control uses 2 GPIO one is output the other input with jumper wire between booter pins so a connected HID controls motor run/stop via GPIO in the application.
// GPIO58->CMD State Button Run/Stop (J4-34)
GPIO_setMasterCore(58, GPIO_CORE_CPU1);
GPIO_setPinConfig(GPIO_58_GPIO58);
GPIO_setDirectionMode(58, GPIO_DIR_MODE_IN);
GPIO_setPadConfig(58, GPIO_PIN_TYPE_PULLUP);
GPIO_setQualificationMode(58, GPIO_QUAL_6SAMPLE);
GPIO_setQualificationPeriod(58, 6);
// GPIO59->CMD Motor State output (J2-11)
GPIO_setMasterCore(59, GPIO_CORE_CPU1);
GPIO_setPinConfig(GPIO_59_GPIO59);
GPIO_setDirectionMode(59, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(59, GPIO_PIN_TYPE_STD);
GPIO_writePin(59, 0);
Why does adding these variables cause immediate motor startup fault to occur? Alternatively, do we need to issue SW interrupt for (flagEnableRunAndIdentify) to write symbol name and set bool flag state when CCS debug is NOT being used to control several bool flags in the project build?
#if defined(CMD_SWITCH_EN)
void setExtCmdSwitchParams(MOTOR_Handle handle)
{
MOTOR_Vars_t *objMtr = (MOTOR_Vars_t *)handle;
objMtr->cmdSwitch.delayTimeSet = USER_M1_SWITCH_WAIT_TIME_SET;
objMtr->cmdSwitch.highTimeCnt = 0;
objMtr->cmdSwitch.lowTimeCnt = 0;
objMtr->cmdSwitch.flagCmdRun = false;
objMtr->cmdSwitch.flagEnablCmd = false;
return;
} // end of updateExtCmdCapFreq() function










