Case 1: Adding a function call for a new peripheral or a new GPIO port caused the program to go into FaultISR
Case 2: After properly enabling a peripheral, the program still goes into FaultISR
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Case 1: Adding a function call for a new peripheral or a new GPIO port caused the program to go into FaultISR
Case 2: After properly enabling a peripheral, the program still goes into FaultISR
Solution for Case 1: Each peripheral needs to be enabled, including each individual GPIO port. The following TivaWare API can be used to enable the peripheral being used.
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2);
The full list of SYSCTL_PERIPH_ #define's can be found in sysctl.h in the driverlib folder in TivaWare.
Solution for Case 2: The Enable Function writes to the SYSCTL.RCGCxxx Register for the xxx Peripheral. It takes 5 System Clock Cycles after which the peripheral will be addressable. It is advised to put a delay or even better get the Status of Ready from the Peripheral. The following code does the latter:
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C2); while(!(SysCtlPeripheralReady(SYSCTL_PERIPH_I2C2)));