I met a strange issue:
When online debugging,28069 SCI communication is normal.
When the program is downloaded to the chip flash, SCI is not working properly.
The following is the SCI initialization code:
void HAL_setupSciB(HAL_Handle handle) { HAL_Obj *obj = (HAL_Obj *)handle; SCI_setMode(obj->sciBHandle,SCI_Mode_IdleLine); SCI_setCharLength(obj->sciBHandle,SCI_CharLength_8_Bits); SCI_setNumStopBits(obj->sciBHandle,SCI_NumStopBits_One); SCI_setParity(obj->sciBHandle, SCI_Parity_Odd); SCI_disableParity(obj->sciBHandle); SCI_disableLoopBack(obj->sciBHandle); SCI_disableRxErrorInt(obj->sciBHandle); SCI_disable(obj->sciBHandle); SCI_disableTxWake(obj->sciBHandle); SCI_disableSleep(obj->sciBHandle); SCI_enableTx(obj->sciBHandle); SCI_enableRx(obj->sciBHandle); SCI_setBaudRate(obj->sciBHandle,SCI_BaudRate_9_6_kBaud); SCI_clearRxFifoInt(obj->sciBHandle); SCI_enableRxInt(obj->sciBHandle); SCI_enableTxInt(obj->sciBHandle); SCI_enable(obj->sciBHandle); SCI_resetRxFifo(obj->sciBHandle); SCI_resetTxFifo(obj->sciBHandle); return; } // end of HAL_setupSciB() function
GPIO_setMode(obj->gpioHandle,GPIO_Number_40,GPIO_40_Mode_SCITXDB); GPIO_setMode(obj->gpioHandle,GPIO_Number_41,GPIO_41_Mode_SCIRXDB);
//! \brief Defines the base address of the serial communications interface (SCI) B registers //! #define SCIB_BASE_ADDR (0x00007750) // initialize the SCIB handle obj->sciBHandle = SCI_init((void *)SCIB_BASE_ADDR,sizeof(SCI_Obj));