Hello all,
I'm using TivaWare_C_Series-2.1.0.12573, with CCS6.1.0. My code is just a simple blinky code I have writen for the custom board:
#include <stdint.h> #include <stdbool.h> #include "inc/tm4c1294ncpdt.h" #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/rom.h" #include "driverlib/rom_map.h" #include "driverlib/sysctl.h" #include "driverlib/interrupt.h" #include "driverlib/gpio.h" #include "driverlib/timer.h" #include "../../../UnitestLibraries/unitest_tm4c1294ncpdt_peripherals.h" #include "../../../UnitestLibraries/unitest_tm4c1294ncpdt_gpio_init.h" #include "../../../UnitestLibraries/unitest_tm4c1294ncpdt_timer_init.h" #include "../../../UnitestLibraries/unitest_tm4c1294ncpdt_timer_func.h" void Timer0IntHandler(void); uint32_t timerVal; int main(void) { uint32_t ui32SysClkFreq; ui32SysClkFreq = SysCtlClockFreqSet(SYSCTL_OSC_INT | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_320, 40000000); //ui32SysClkFreq = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000); //SYSCTL_OSC_INT initGPIOKOutput(GPIO_PIN_0|GPIO_PIN_1, 0x00); init32BitTIMERPeriodicMode(SYSCTL_PERIPH_TIMER0, TIMER0_BASE, time2TimerLoadbySysClk(ui32SysClkFreq, 0.5, 0)); // 2ms interruptInitTIMER(INT_TIMER0A, TIMER0_BASE, TIMER_A, TIMER_TIMA_TIMEOUT, Timer0IntHandler); IntMasterEnable(); MAP_TimerEnable(TIMER0_BASE, TIMER_A); while(1); } void Timer0IntHandler(void) { // Clear the timer interrupt TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT); // Read the current state of the GPIO pin and // write back the opposite state if(GPIOPinRead(GPIO_PORTK_BASE, GPIO_PIN_0)) { GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_0|GPIO_PIN_1, 0); } else { GPIOPinWrite(GPIO_PORTK_BASE, GPIO_PIN_0|GPIO_PIN_1, 1); } }
The issue is that when I am using the internal oscillator I can embed the code and no problem appears. But when I switch the code from internal oscillator to 25 MHz crystal, I can embed the code but the MCU gets locked. I have to go through an erase procedure to contect to the chip. I am using the recomended crystals (which is exactly the same as the crystal used in the Tiva connected board.) and I also have the RBIAS resistor connected.
I haven't been able to find the source of the error, and would be happy if someone could help out.