Tool/software: TI C/C++ Compiler
All,
I am struggling with the code below - it jumps to the fault ISR while(1) once I reach the first TiVa API (here: SysCtlClockFreqSet)
I guess it could be something wrong with the startup_ccs.c?
#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/timer.h"
void init ();
uint32_t g_ui32Flags; // Flags that contain the current value of the interrupt indicator as displayed on the UART.
int main(void)
{
//init ();
uint32_t g_ui32SysClock; // System clock rate in Hz.
g_ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_16MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000); // Set the clocking to run directly from the crystal at 120MHz.
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG); // Enable the GPIO ports
GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_0 | GPIO_PIN_1); // Enable the GPIO pins for the LEDs (PN0 & PN1)
IntMasterEnable(); // Enable processor interrupts
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // Enable Timer0
TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC); // Configure the Timer0 32-bit periodic timers
TimerLoadSet(TIMER0_BASE, TIMER_A, g_ui32SysClock);
IntEnable(INT_TIMER0A); // Setup the interrupts for the timer timeouts
TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
TimerEnable(TIMER0_BASE, TIMER_A); // Enable the timer
while(1)
{
}
}
void Timer0IntHandler(void) // The interrupt handler for the timer interrupt.
{
TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
HWREGBITW(&g_ui32Flags, 0) ^= 1; // Toggle the flag for the first timer
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_0, g_ui32Flags); // Use the flags to Toggle the LED for this timer
}
complete project attached.Notstrom.zip
Thanks for your help,
Gunter