Other Parts Discussed in Thread: EK-TM4C123GXL
Hi,
Even though GPIO AHB mode is enabled with SysCtlGPIOAHBEnable() we get ISR FAULT when we read the port in AHB mode.
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOF);
Read = HWREG(GPIO_PORTF_AHB_BASE + GPIO_O_PUR); <- this code gets ISR FAULT
Please let me know what else should be taken care when using port in AHB mode.
Attached the complete code I am using. Note: it works normal in default APB mode.
And does Tiva C ROM library support AHB mode? couldn't find such API in the ROM user guide.
Best Regards
paddu
int
main(void)
{
volatile uint32_t ReadReg = 0;
//
// Enable lazy stacking for interrupt handlers. This allows floating-point
// instructions to be used within interrupt handlers, but at the expense of
// extra stack usage.
//
ROM_FPULazyStackingEnable();
//
// Set the clocking to run directly from the crystal.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
SYSCTL_OSC_MAIN);
//
// Enable the GPIO port that is used for the on-board LED.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
//
// Enable the GPIO pins for the LED (PF2 & PF3).
//
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_2);
SysCtlGPIOAHBEnable(SYSCTL_PERIPH_GPIOF);
//
// Initialize the UART.
//
ConfigureUART();
// Getting error with below code.........
UARTprintf("Hello, world!\n");
ReadReg = HWREG(GPIO_PORTF_AHB_BASE + GPIO_O_PUR); // Error Code
UARTprintf("ReadReg=%x\n", ReadReg);
while(1);
}