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.

TM4C123GXL - Trying to get Blink to work, but compile/target error.

Other Parts Discussed in Thread: TM4C123GH6PM, EK-TM4C123GXL

Hi guys - sorry for the probably dumb question. Just trying to get an LED blinking using the t4mc123gxl microcomputer. I've used it a lot in the past, but this is my first time using TivaWare to streamline the process. I rewrote Blink using some TivaWare functions. It doesn't seem to be the code (KEIL isn't telling me I have any errors, but I am getting a strange compiler issue. Unfortunately this is the one issue I have no idea how to solve, so I thought I'd turn to you guys.

My code is as follows:

//*****************************************************************************
//
// the goal is to turn on a sequence of LEDs as the onboard button is pressed
//with shitty debounce using delay
//
//*****************************************************************************

#include <stdint.h>
#include <stdint.h>
#include <stdbool.h>
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_gpio.h"
#include "inc/hw_ints.h"
#include "inc/hw_nvic.h"
#include "inc/hw_sysctl.h"
#include "inc/hw_uart.h"
#include "inc/hw_types.h"
#include "inc/hw_memmap.h"
#include "driverlib/pin_map.h"
#include "driverlib/gpio.h"
#include "driverlib/pwm.h"
#include "driverlib/sysctl.h"

static volatile uint32_t ui32Loop;

//*****************************************************************************
//
// Blink the on-board LED.
//
//*****************************************************************************

void Setup(void)
{
	SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
	printf("let's wait a moment");
	printf("or two");
	
	
	//Enable GPIO Ports F, A, B, C.
//	SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF;
//	SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOA;
//	SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOC;
//	SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOB;
	
	SYSCTLPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	SYSCTLPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	SYSCTLPeripheralEnable(SYSCTL_PERIPH_GPIOC);
	SYSCTLPeripheralEnable(SYSCTL_PERIPH_GPIOB);
	
	// Do a dummy read to insert a few cycles after enabling the peripheral.
	ui32Loop = SYSCTL_RCGC2_R;
	
	 //Set as Outputs (DIR). Embedded within here is the DEN.
	
		GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);
		GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);
		GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);
		GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3|GPIO_PIN_1|GPIO_PIN_2);
	
	//F0 and F4 are board buttons. Let's set them as inputs.
	GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4);
	//With luck this is activating the weak pull up resistors. 
	HWREG(GPIO_PORTF_BASE+GPIO_O_PUR) |= (GPIO_PIN_0|GPIO_PIN_4);
	

}

void delay_ms(int del)     //generates delay in milliseconds
{
del = (SysCtlClockGet()/3.0)*del/1000.0;
SysCtlDelay(del);
}

int
main(void)
{
	Setup();

    while(1)
    {
        //
        // Turn on the LED.
        //
        //GPIO_PORTF_DATA_R |= 0x08;
			

        //
        // Delay for a bit.
        //
        for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
        {
        }

        //
        // Turn off the LED.
        //
        GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_2, 0x00);

        //
        // Delay for a bit.
        //
        for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
        {
        }
    }
}

When I build the Target File (single arrow), I get this error:

*** Using Compiler 'V5.05 update 2 (build 169)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
linking...
.\Objects\commence.axf: Error: L6320W: Ignoring --entry command. Cannot find argument 'Reset_Handler'.
.\Objects\commence.axf: Warning: L6320W: Ignoring --first command. Cannot find argument '__Vectors'.
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 1 warning and 1 error messages.
".\Objects\commence.axf" - 1 Error(s), 1 Warning(s).
Target not created.
Build Time Elapsed: 00:00:00

And when I "Rebuild All Target Files" (double arrow), I get this error:


*** Using Compiler 'V5.05 update 2 (build 169)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'Target 1'
compiling cycle.c...
inc/hw_ints.h(352): warning: #47-D: incompatible redefinition of macro "INT_ADC0SS0" (declared at line 62 of "inc/tm4c123gh6pm.h")
#define INT_ADC0SS0 INT_CONCAT(INT_ADC0SS0_, INT_DEVICE_CLASS)
inc/hw_ints.h(353): warning: #47-D: incompatible redefinition of macro "INT_ADC0SS1" (declared at line 63 of "inc/tm4c123gh6pm.h")
#define INT_ADC0SS1 INT_CONCAT(INT_ADC0SS1_, INT_DEVICE_CLASS)
inc/hw_ints.h(354): warning: #47-D: incompatible redefinition of macro "INT_ADC0SS2" (declared at line 64 of "inc/tm4c123gh6pm.h")
#define INT_ADC0SS2 INT_CONCAT(INT_ADC0SS2_, INT_DEVICE_CLASS)
inc/hw_ints.h(355): warning: #47-D: incompatible redefinition of macro "INT_ADC0SS3" (declared at line 65 of "inc/tm4c123gh6pm.h")
#define INT_ADC0SS3 INT_CONCAT(INT_ADC0SS3_, INT_DEVICE_CLASS)
inc/hw_ints.h(356): warning: #47-D: incompatible redefinition of macro "INT_ADC1SS0" (declared at line 92 of "inc/tm4c123gh6pm.h")
#define INT_ADC1SS0 INT_CONCAT(INT_ADC1SS0_, INT_DEVICE_CLASS)
inc/hw_ints.h(357): warning: #47-D: incompatible redefinition of macro "INT_ADC1SS1" (declared at line 93 of "inc/tm4c123gh6pm.h")
#define INT_ADC1SS1 INT_CONCAT(INT_ADC1SS1_, INT_DEVICE_CLASS)
inc/hw_ints.h(358): warning: #47-D: incompatible redefinition of macro "INT_ADC1SS2" (declared at line 94 of "inc/tm4c123gh6pm.h")
#define INT_ADC1SS2 INT_CONCAT(INT_ADC1SS2_, INT_DEVICE_CLASS)
inc/hw_ints.h(359): warning: #47-D: incompatible redefinition of macro "INT_ADC1SS3" (declared at line 95 of "inc/tm4c123gh6pm.h")
#define INT_ADC1SS3 INT_CONCAT(INT_ADC1SS3_, INT_DEVICE_CLASS)
inc/hw_ints.h(361): warning: #47-D: incompatible redefinition of macro "INT_CAN0" (declared at line 85 of "inc/tm4c123gh6pm.h")
#define INT_CAN0 INT_CONCAT(INT_CAN0_, INT_DEVICE_CLASS)
inc/hw_ints.h(362): warning: #47-D: incompatible redefinition of macro "INT_CAN1" (declared at line 86 of "inc/tm4c123gh6pm.h")
#define INT_CAN1 INT_CONCAT(INT_CAN1_, INT_DEVICE_CLASS)
inc/hw_ints.h(363): warning: #47-D: incompatible redefinition of macro "INT_COMP0" (declared at line 73 of "inc/tm4c123gh6pm.h")
#define INT_COMP0 INT_CONCAT(INT_COMP0_, INT_DEVICE_CLASS)
inc/hw_ints.h(364): warning: #47-D: incompatible redefinition of macro "INT_COMP1" (declared at line 74 of "inc/tm4c123gh6pm.h")
#define INT_COMP1 INT_CONCAT(INT_COMP1_, INT_DEVICE_CLASS)
inc/hw_ints.h(369): warning: #47-D: incompatible redefinition of macro "INT_FLASH" (declared at line 76 of "inc/tm4c123gh6pm.h")
#define INT_FLASH INT_CONCAT(INT_FLASH_, INT_DEVICE_CLASS)
inc/hw_ints.h(370): warning: #47-D: incompatible redefinition of macro "INT_GPIOA" (declared at line 48 of "inc/tm4c123gh6pm.h")
#define INT_GPIOA INT_CONCAT(INT_GPIOA_, INT_DEVICE_CLASS)
inc/hw_ints.h(371): warning: #47-D: incompatible redefinition of macro "INT_GPIOB" (declared at line 49 of "inc/tm4c123gh6pm.h")
#define INT_GPIOB INT_CONCAT(INT_GPIOB_, INT_DEVICE_CLASS)
inc/hw_ints.h(372): warning: #47-D: incompatible redefinition of macro "INT_GPIOC" (declared at line 50 of "inc/tm4c123gh6pm.h")
#define INT_GPIOC INT_CONCAT(INT_GPIOC_, INT_DEVICE_CLASS)
inc/hw_ints.h(373): warning: #47-D: incompatible redefinition of macro "INT_GPIOD" (declared at line 51 of "inc/tm4c123gh6pm.h")
#define INT_GPIOD INT_CONCAT(INT_GPIOD_, INT_DEVICE_CLASS)
inc/hw_ints.h(374): warning: #47-D: incompatible redefinition of macro "INT_GPIOE" (declared at line 52 of "inc/tm4c123gh6pm.h")
#define INT_GPIOE INT_CONCAT(INT_GPIOE_, INT_DEVICE_CLASS)
inc/hw_ints.h(375): warning: #47-D: incompatible redefinition of macro "INT_GPIOF" (declared at line 78 of "inc/tm4c123gh6pm.h")
#define INT_GPIOF INT_CONCAT(INT_GPIOF_, INT_DEVICE_CLASS)
inc/hw_ints.h(402): warning: #47-D: incompatible redefinition of macro "INT_HIBERNATE" (declared at line 87 of "inc/tm4c123gh6pm.h")
#define INT_HIBERNATE INT_CONCAT(INT_HIBERNATE_, INT_DEVICE_CLASS)
inc/hw_ints.h(403): warning: #47-D: incompatible redefinition of macro "INT_I2C0" (declared at line 56 of "inc/tm4c123gh6pm.h")
#define INT_I2C0 INT_CONCAT(INT_I2C0_, INT_DEVICE_CLASS)
inc/hw_ints.h(404): warning: #47-D: incompatible redefinition of macro "INT_I2C1" (declared at line 83 of "inc/tm4c123gh6pm.h")
#define INT_I2C1 INT_CONCAT(INT_I2C1_, INT_DEVICE_CLASS)
inc/hw_ints.h(405): warning: #47-D: incompatible redefinition of macro "INT_I2C2" (declared at line 103 of "inc/tm4c123gh6pm.h")
#define INT_I2C2 INT_CONCAT(INT_I2C2_, INT_DEVICE_CLASS)
inc/hw_ints.h(406): warning: #47-D: incompatible redefinition of macro "INT_I2C3" (declared at line 104 of "inc/tm4c123gh6pm.h")
#define INT_I2C3 INT_CONCAT(INT_I2C3_, INT_DEVICE_CLASS)
inc/hw_ints.h(415): warning: #47-D: incompatible redefinition of macro "INT_PWM0_0" (declared at line 58 of "inc/tm4c123gh6pm.h")
#define INT_PWM0_0 INT_CONCAT(INT_PWM0_0_, INT_DEVICE_CLASS)
inc/hw_ints.h(416): warning: #47-D: incompatible redefinition of macro "INT_PWM0_1" (declared at line 59 of "inc/tm4c123gh6pm.h")
#define INT_PWM0_1 INT_CONCAT(INT_PWM0_1_, INT_DEVICE_CLASS)
inc/hw_ints.h(417): warning: #47-D: incompatible redefinition of macro "INT_PWM0_2" (declared at line 60 of "inc/tm4c123gh6pm.h")
#define INT_PWM0_2 INT_CONCAT(INT_PWM0_2_, INT_DEVICE_CLASS)
inc/hw_ints.h(418): warning: #47-D: incompatible redefinition of macro "INT_PWM0_3" (declared at line 89 of "inc/tm4c123gh6pm.h")
#define INT_PWM0_3 INT_CONCAT(INT_PWM0_3_, INT_DEVICE_CLASS)
inc/hw_ints.h(419): warning: #47-D: incompatible redefinition of macro "INT_PWM0_FAULT" (declared at line 57 of "inc/tm4c123gh6pm.h")
#define INT_PWM0_FAULT INT_CONCAT(INT_PWM0_FAULT_, INT_DEVICE_CLASS)
inc/hw_ints.h(420): warning: #47-D: incompatible redefinition of macro "INT_PWM1_0" (declared at line 122 of "inc/tm4c123gh6pm.h")
#define INT_PWM1_0 INT_CONCAT(INT_PWM1_0_, INT_DEVICE_CLASS)
inc/hw_ints.h(421): warning: #47-D: incompatible redefinition of macro "INT_PWM1_1" (declared at line 123 of "inc/tm4c123gh6pm.h")
#define INT_PWM1_1 INT_CONCAT(INT_PWM1_1_, INT_DEVICE_CLASS)
inc/hw_ints.h(422): warning: #47-D: incompatible redefinition of macro "INT_PWM1_2" (declared at line 124 of "inc/tm4c123gh6pm.h")
#define INT_PWM1_2 INT_CONCAT(INT_PWM1_2_, INT_DEVICE_CLASS)
inc/hw_ints.h(423): warning: #47-D: incompatible redefinition of macro "INT_PWM1_3" (declared at line 125 of "inc/tm4c123gh6pm.h")
#define INT_PWM1_3 INT_CONCAT(INT_PWM1_3_, INT_DEVICE_CLASS)
inc/hw_ints.h(424): warning: #47-D: incompatible redefinition of macro "INT_PWM1_FAULT" (declared at line 126 of "inc/tm4c123gh6pm.h")
#define INT_PWM1_FAULT INT_CONCAT(INT_PWM1_FAULT_, INT_DEVICE_CLASS)
inc/hw_ints.h(425): warning: #47-D: incompatible redefinition of macro "INT_QEI0" (declared at line 61 of "inc/tm4c123gh6pm.h")
#define INT_QEI0 INT_CONCAT(INT_QEI0_, INT_DEVICE_CLASS)
inc/hw_ints.h(426): warning: #47-D: incompatible redefinition of macro "INT_QEI1" (declared at line 84 of "inc/tm4c123gh6pm.h")
#define INT_QEI1 INT_CONCAT(INT_QEI1_, INT_DEVICE_CLASS)
inc/hw_ints.h(428): warning: #47-D: incompatible redefinition of macro "INT_SSI0" (declared at line 55 of "inc/tm4c123gh6pm.h")
#define INT_SSI0 INT_CONCAT(INT_SSI0_, INT_DEVICE_CLASS)
inc/hw_ints.h(429): warning: #47-D: incompatible redefinition of macro "INT_SSI1" (declared at line 80 of "inc/tm4c123gh6pm.h")
#define INT_SSI1 INT_CONCAT(INT_SSI1_, INT_DEVICE_CLASS)
inc/hw_ints.h(430): warning: #47-D: incompatible redefinition of macro "INT_SSI2" (declared at line 96 of "inc/tm4c123gh6pm.h")
#define INT_SSI2 INT_CONCAT(INT_SSI2_, INT_DEVICE_CLASS)
inc/hw_ints.h(431): warning: #47-D: incompatible redefinition of macro "INT_SSI3" (declared at line 97 of "inc/tm4c123gh6pm.h")
#define INT_SSI3 INT_CONCAT(INT_SSI3_, INT_DEVICE_CLASS)
inc/hw_ints.h(432): warning: #47-D: incompatible redefinition of macro "INT_SYSCTL" (declared at line 75 of "inc/tm4c123gh6pm.h")
#define INT_SYSCTL INT_CONCAT(INT_SYSCTL_, INT_DEVICE_CLASS)
inc/hw_ints.h(433): warning: #47-D: incompatible redefinition of macro "INT_SYSEXC" (declared at line 121 of "inc/tm4c123gh6pm.h")
#define INT_SYSEXC INT_CONCAT(INT_SYSEXC_, INT_DEVICE_CLASS)
inc/hw_ints.h(435): warning: #47-D: incompatible redefinition of macro "INT_TIMER0A" (declared at line 67 of "inc/tm4c123gh6pm.h")
#define INT_TIMER0A INT_CONCAT(INT_TIMER0A_, INT_DEVICE_CLASS)
inc/hw_ints.h(436): warning: #47-D: incompatible redefinition of macro "INT_TIMER0B" (declared at line 68 of "inc/tm4c123gh6pm.h")
#define INT_TIMER0B INT_CONCAT(INT_TIMER0B_, INT_DEVICE_CLASS)
inc/hw_ints.h(437): warning: #47-D: incompatible redefinition of macro "INT_TIMER1A" (declared at line 69 of "inc/tm4c123gh6pm.h")
#define INT_TIMER1A INT_CONCAT(INT_TIMER1A_, INT_DEVICE_CLASS)
inc/hw_ints.h(438): warning: #47-D: incompatible redefinition of macro "INT_TIMER1B" (declared at line 70 of "inc/tm4c123gh6pm.h")
#define INT_TIMER1B INT_CONCAT(INT_TIMER1B_, INT_DEVICE_CLASS)
inc/hw_ints.h(439): warning: #47-D: incompatible redefinition of macro "INT_TIMER2A" (declared at line 71 of "inc/tm4c123gh6pm.h")
#define INT_TIMER2A INT_CONCAT(INT_TIMER2A_, INT_DEVICE_CLASS)
inc/hw_ints.h(440): warning: #47-D: incompatible redefinition of macro "INT_TIMER2B" (declared at line 72 of "inc/tm4c123gh6pm.h")
#define INT_TIMER2B INT_CONCAT(INT_TIMER2B_, INT_DEVICE_CLASS)
inc/hw_ints.h(441): warning: #47-D: incompatible redefinition of macro "INT_TIMER3A" (declared at line 81 of "inc/tm4c123gh6pm.h")
#define INT_TIMER3A INT_CONCAT(INT_TIMER3A_, INT_DEVICE_CLASS)
inc/hw_ints.h(442): warning: #47-D: incompatible redefinition of macro "INT_TIMER3B" (declared at line 82 of "inc/tm4c123gh6pm.h")
#define INT_TIMER3B INT_CONCAT(INT_TIMER3B_, INT_DEVICE_CLASS)
inc/hw_ints.h(443): warning: #47-D: incompatible redefinition of macro "INT_TIMER4A" (declared at line 105 of "inc/tm4c123gh6pm.h")
#define INT_TIMER4A INT_CONCAT(INT_TIMER4A_, INT_DEVICE_CLASS)
inc/hw_ints.h(444): warning: #47-D: incompatible redefinition of macro "INT_TIMER4B" (declared at line 106 of "inc/tm4c123gh6pm.h")
#define INT_TIMER4B INT_CONCAT(INT_TIMER4B_, INT_DEVICE_CLASS)
inc/hw_ints.h(445): warning: #47-D: incompatible redefinition of macro "INT_TIMER5A" (declared at line 107 of "inc/tm4c123gh6pm.h")
#define INT_TIMER5A INT_CONCAT(INT_TIMER5A_, INT_DEVICE_CLASS)
inc/hw_ints.h(446): warning: #47-D: incompatible redefinition of macro "INT_TIMER5B" (declared at line 108 of "inc/tm4c123gh6pm.h")
#define INT_TIMER5B INT_CONCAT(INT_TIMER5B_, INT_DEVICE_CLASS)
inc/hw_ints.h(451): warning: #47-D: incompatible redefinition of macro "INT_UART0" (declared at line 53 of "inc/tm4c123gh6pm.h")
#define INT_UART0 INT_CONCAT(INT_UART0_, INT_DEVICE_CLASS)
inc/hw_ints.h(452): warning: #47-D: incompatible redefinition of macro "INT_UART1" (declared at line 54 of "inc/tm4c123gh6pm.h")
#define INT_UART1 INT_CONCAT(INT_UART1_, INT_DEVICE_CLASS)
inc/hw_ints.h(453): warning: #47-D: incompatible redefinition of macro "INT_UART2" (declared at line 79 of "inc/tm4c123gh6pm.h")
#define INT_UART2 INT_CONCAT(INT_UART2_, INT_DEVICE_CLASS)
inc/hw_ints.h(454): warning: #47-D: incompatible redefinition of macro "INT_UART3" (declared at line 98 of "inc/tm4c123gh6pm.h")
#define INT_UART3 INT_CONCAT(INT_UART3_, INT_DEVICE_CLASS)
inc/hw_ints.h(455): warning: #47-D: incompatible redefinition of macro "INT_UART4" (declared at line 99 of "inc/tm4c123gh6pm.h")
#define INT_UART4 INT_CONCAT(INT_UART4_, INT_DEVICE_CLASS)
inc/hw_ints.h(456): warning: #47-D: incompatible redefinition of macro "INT_UART5" (declared at line 100 of "inc/tm4c123gh6pm.h")
#define INT_UART5 INT_CONCAT(INT_UART5_, INT_DEVICE_CLASS)
inc/hw_ints.h(457): warning: #47-D: incompatible redefinition of macro "INT_UART6" (declared at line 101 of "inc/tm4c123gh6pm.h")
#define INT_UART6 INT_CONCAT(INT_UART6_, INT_DEVICE_CLASS)
inc/hw_ints.h(458): warning: #47-D: incompatible redefinition of macro "INT_UART7" (declared at line 102 of "inc/tm4c123gh6pm.h")
#define INT_UART7 INT_CONCAT(INT_UART7_, INT_DEVICE_CLASS)
inc/hw_ints.h(459): warning: #47-D: incompatible redefinition of macro "INT_UDMA" (declared at line 90 of "inc/tm4c123gh6pm.h")
#define INT_UDMA INT_CONCAT(INT_UDMA_, INT_DEVICE_CLASS)
inc/hw_ints.h(460): warning: #47-D: incompatible redefinition of macro "INT_UDMAERR" (declared at line 91 of "inc/tm4c123gh6pm.h")
#define INT_UDMAERR INT_CONCAT(INT_UDMAERR_, INT_DEVICE_CLASS)
inc/hw_ints.h(461): warning: #47-D: incompatible redefinition of macro "INT_USB0" (declared at line 88 of "inc/tm4c123gh6pm.h")
#define INT_USB0 INT_CONCAT(INT_USB0_, INT_DEVICE_CLASS)
inc/hw_ints.h(462): warning: #47-D: incompatible redefinition of macro "INT_WATCHDOG" (declared at line 66 of "inc/tm4c123gh6pm.h")
#define INT_WATCHDOG INT_CONCAT(INT_WATCHDOG_, INT_DEVICE_CLASS)
inc/hw_ints.h(463): warning: #47-D: incompatible redefinition of macro "INT_WTIMER0A" (declared at line 109 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER0A INT_CONCAT(INT_WTIMER0A_, INT_DEVICE_CLASS)
inc/hw_ints.h(464): warning: #47-D: incompatible redefinition of macro "INT_WTIMER0B" (declared at line 110 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER0B INT_CONCAT(INT_WTIMER0B_, INT_DEVICE_CLASS)
inc/hw_ints.h(465): warning: #47-D: incompatible redefinition of macro "INT_WTIMER1A" (declared at line 111 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER1A INT_CONCAT(INT_WTIMER1A_, INT_DEVICE_CLASS)
inc/hw_ints.h(466): warning: #47-D: incompatible redefinition of macro "INT_WTIMER1B" (declared at line 112 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER1B INT_CONCAT(INT_WTIMER1B_, INT_DEVICE_CLASS)
inc/hw_ints.h(467): warning: #47-D: incompatible redefinition of macro "INT_WTIMER2A" (declared at line 113 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER2A INT_CONCAT(INT_WTIMER2A_, INT_DEVICE_CLASS)
inc/hw_ints.h(468): warning: #47-D: incompatible redefinition of macro "INT_WTIMER2B" (declared at line 114 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER2B INT_CONCAT(INT_WTIMER2B_, INT_DEVICE_CLASS)
inc/hw_ints.h(469): warning: #47-D: incompatible redefinition of macro "INT_WTIMER3A" (declared at line 115 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER3A INT_CONCAT(INT_WTIMER3A_, INT_DEVICE_CLASS)
inc/hw_ints.h(470): warning: #47-D: incompatible redefinition of macro "INT_WTIMER3B" (declared at line 116 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER3B INT_CONCAT(INT_WTIMER3B_, INT_DEVICE_CLASS)
inc/hw_ints.h(471): warning: #47-D: incompatible redefinition of macro "INT_WTIMER4A" (declared at line 117 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER4A INT_CONCAT(INT_WTIMER4A_, INT_DEVICE_CLASS)
inc/hw_ints.h(472): warning: #47-D: incompatible redefinition of macro "INT_WTIMER4B" (declared at line 118 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER4B INT_CONCAT(INT_WTIMER4B_, INT_DEVICE_CLASS)
inc/hw_ints.h(473): warning: #47-D: incompatible redefinition of macro "INT_WTIMER5A" (declared at line 119 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER5A INT_CONCAT(INT_WTIMER5A_, INT_DEVICE_CLASS)
inc/hw_ints.h(474): warning: #47-D: incompatible redefinition of macro "INT_WTIMER5B" (declared at line 120 of "inc/tm4c123gh6pm.h")
#define INT_WTIMER5B INT_CONCAT(INT_WTIMER5B_, INT_DEVICE_CLASS)
cycle.c(35): warning: #223-D: function "printf" declared implicitly
printf("let's wait a moment");
cycle.c(45): warning: #223-D: function "SYSCTLPeripheralEnable" declared implicitly
SYSCTLPeripheralEnable(SYSCTL_PERIPH_GPIOA);
cycle.c: 80 warnings, 0 errors
linking...
.\Objects\commence.axf: Error: L6320W: Ignoring --entry command. Cannot find argument 'Reset_Handler'.
.\Objects\commence.axf: Warning: L6320W: Ignoring --first command. Cannot find argument '__Vectors'.
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 1 warning and 1 error messages.
".\Objects\commence.axf" - 1 Error(s), 81 Warning(s).
Target not created.
Build Time Elapsed: 00:00:01

So I think it's an error with the compiling or the targets, but I've pretty clueless about that. If someone could point me in the right direction that'd be great. Thank you.

  • Hello Zero_PD.

    It would be simpler loading one of the existing examples which use TivaWare and then update the same for your code.

    Some of the Issues that I see...

    1. printf is not natively supported in TivaWare, it is called UARTprintf and requires UART Initlalization
    2. Bulk of the warnings is due to inclusion of tm4c123gh6pm.h file

    Regards
    Amit
  • Zero_PD said:
    GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);

    Perhaps it's to your advantage that your project, "would not build!"

    While you state that you've, "used this a lot in the past" that quoted function call will quickly/superbly land you in dreaded, "MCU Lock-Out Land!"   Port C must be treated w/some respect - not evident w/in your code, here.

    Also - you plan to use PF0 - which has an especially delightful limitation - and will not work as you desire w/out, "special care/handling."   Your search of the MCU manual will reveal the (unwanted) nature of PF0.

    As Amit advised - always best to "attach" your project to a, "known good" - existing, vendor supplied one. 

  • Hi Amit. This is actually what I usually do - copy the entire folder from something like Blink and then "grow" it with my own code. I thought this was a bit of a cheat and I ought to be able to make a project folder up from scratch, but if this is actually the recommended way of going about things, I'll happily do it.

  • Hello Zero_PD,

    The blink example uses the DRM, while other examples use TivaWare. So the latter set of examples which use TivaWare are complete from actual product-software example perspective.

    Regards
    Amit
  • Thanks CB1 -
    I'm far from a master, but I have used this microcomputer a very great deal. I spent the last year in a microcomputer control class, building autonomous robots and the like. We weren't allowed to use tivaware, and did everything with individual register setup. Ten to twenty lines of register manipulation to set up things like UART, SPI, various interrupts etc. I've dug through most of the pages of that 1409 page manual.

    That being said, our hands were definitely held here and there. Some pins weren't brought out to the boards we usually used, and I'm betting C0 was one of them. After digging through the tm4c123g datasheet I do see that C0:C3 are JTAG/SWD and it looks like they require a special process to be configured as GPIOs. I found the pinout from my class and sure enough we were only allowed access to C4-C7. In the future, I'll only use the pins I was allowed in class. Thanks for the heads up. Would love some more info on the MCU Lock Out, though.

    F0 was allowed us though - but after digging I see that it is locked by default.

    You're going to be a good person to have on my side.
  • Zero_PD said:
    You're going to be a good person to have on my side.

    One hopes mon ami - one hopes.

    As small tech firm owner - we never/ever can afford to WASTE time/effort & produce "untested/unknown" DRM code - when a tried/true, years tested API stands - at the ready.   (fortunate that many prof's have "tenure" - getting to market LAST - & with uncertain program code - seems not, "best practice!)

    Indeed you need to have general register familiarity - but to adopt the "DRM-only" approach "ejects" the baby w/the bathwater!   Not good that.

    Friends indeed - but we're not DRM fans - and refuse to critique code in that inefficient, error-inviting, untested format.

    May we note that the "excess time" you spent in "combing thru" the MCU "Register parade" (just wait till you seek to program a PWM Generator - via DRM) - most likely "absorbed" the time/effort available for you to properly note the PC0-PC3 and PF0/PD7 "restrictions!"

    As small biz owner - IBM/similar, "ain't often calling!"   But multiple other - small biz are - and we all agree that DRM-only code approach is severely flawed - and too often retards (rather than advancing) your programming & related skills...  (which is demanded by most any small biz - those most likely to hire/advance...)

  • cb1- said:

    just wait till you seek to program a PWM Generator - via DRM

    Haha - Unfortunately for my sanity I have programmed a PWM generator via DRM, the gen for this microcomputer at that. Only took about 20 lines of code. Trust me I agree with what you say...but there' s something to be said for learning the rules before you break them. Now that I've gone through the experience of DRM, these tivaware libraries look amazingly simple and much more importantly, I well and truly know what's going on within their code.

    But I would never DRM again, outside of the classroom setting. That's why I'm learning the tivaware way now! 

  • While "anonymity" is sought - 16 is far in the "rear view mirror" - free time is far from infinite - and co-founding, taking past tech firm public is bit notable. 

    Cannot find any trace of, "argument" - thus "Neal's" introduction seems questionable...

  • Hmm..I don't actually understand. Though I agree that taking a tech firm public sounds like a great resume builder.

    That quote is just my signature. I find it funny and very true and I'm a fan of the author's books. I hope you did not think it was directed towards you!
  • Multiple of my staff - and I - could not recognize that writing as a, "signature."    Perception is important - that writing may not (especially here) prove best...

  • Ah this is true. I had hoped the dashed line would make it clearer. I wouldn't want people to get the wrong idea. I will certainly consider removing it.

  • To risk offending people you've sought to "friend" - and who've assisted - seems not to win, "best judgment award" anytime soon...

    And to your point of your, "Achieving successful PWM Generator operation under DRM, exclusively" - I did not claim that to be impossible.   But I've no doubt that the same (likely better) results would have been achieved (and far faster & w/greater confidence) via API usage!

    Do the schools, "Miss the fact that greatest profits accrue to those first to market?"   Exclusive DRM use almost guarantees, "Late or even last to market!"

  • Fortunately I've a wide array of science fiction author quotes to choose from. I'll try another.
  • Ok, I think I fixed the errors in the setup and the potentially catastrophic errors in the port pins. 

    For the setup, I copied the hello subfolder from the examples/boards/ek-tm4c123gxl folder. I renamed that folder to myproject and the uvproj file within to myproject. I then added my own code. I hope it's not a problem that I commented out the delay loop.

    For the port pins, I removed the problematic C0-C3 and added C4-7. Also took out F0 and am only turning F4 into an input. Everything compiles now and I'll test it this afternoon.

    //*****************************************************************************
    //
    // the goal is to blink an LED. 
    // Once that works, I'll cycle through leds with a button press.
    //*****************************************************************************
    
    #include <stdint.h>
    #include <stdbool.h>
    #include "hw_gpio.h"
    #include "hw_ints.h"
    #include "hw_nvic.h"
    #include "hw_sysctl.h"
    #include "hw_uart.h"
    #include "hw_types.h"
    #include "hw_memmap.h"
    #include "gpio.h"
    #include "pwm.h"
    #include "sysctl.h"
    #include "cycle.h"
    
    static volatile uint32_t ui32Loop;
    
    //*****************************************************************************
    //
    // Blink the on-board LED.
    //
    //*****************************************************************************
    
    void Setup(void)
    {
    	SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
    
    	//Enable GPIO Ports F, A, B, C.
    	
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    	
    	// Do a dummy read to insert a few cycles after enabling the peripheral.
    	//ui32Loop = SYSCTL_RCGC2_R;
    	
    	 //Set as Outputs (DIR). Embedded within here is the DEN.
    	
    		GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4);
    		GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);
    		GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6);
    		GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3|GPIO_PIN_1|GPIO_PIN_2);
    	
    	// F4 is board button. Input.
    	GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_4);
    	//With luck this is activating the weak pull up resistor. 
    	HWREG(GPIO_PORTF_BASE+GPIO_O_PUR) |= (GPIO_PIN_4);
    	
    
    }
    
    void delay_ms(int del)     //generates delay in milliseconds
    {
    del = (SysCtlClockGet()/3.0)*del/1000.0;
    SysCtlDelay(del);
    }
    
    int
    main(void)
    {
    	Setup();
    
        while(1)
        {
            // Turn on the LED.
           GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_2, 0xFF);
            // Delay for a bit.
    			
            for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
            {
            }
    				
            // Turn off the LED.
    				
            GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_2, 0x00);
    
            // Delay for a bit.
    
            for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++)
            {
            }
        }
    }
    

  • While Monsieur Gibson claims, "Future is already here" - for your program's sake - let's hope not!

    Nothing is wrong with "Science Fiction" - other than the "fiction."

    Speaking to fiction: "GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_2, 0x00);"

    and "GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_2, 0xFF);"

    Your statement, "I removed the problematic C0-C3..." appears (somewhat) in conflict w/2 code lines above - does it not?

    I didn't check much further - and the "removal of delays" - w/out the full understanding of their impact - may prove unwise...

  • Hello cb1,

    That would not work. PC0-PC3 are JTAG and locked. There is no unlock sequence so the writes will have no affect. And if there is an unlock sequence done, then the debugger "would" break. Fiction becoming Reality.

    Regards
    Amit
  • Amit Ashara said:
    That would not work. PC0-PC3 are JTAG and locked.

    That was precisely my point Amit - those 2 poster code lines I imported were flawed - or "fiction" - as poster prefers.

    Too much "sci-fi" reading/emphasis perhaps...

  • Yup thanks guys! As you can see I swapped out the initializations to C4-C7 but missed that in the Main code.

    And there's no such thing as too much science fiction! 

    I found the SysCtlDelay() function and used it to add in a small delay after starting the system clocks.

    //*****************************************************************************
    // the goal is to blink an LED. 
    // Once that works, I'll cycle through leds with a button press.
    //*****************************************************************************
    
    #include <stdint.h>
    #include <stdbool.h>
    #include "hw_gpio.h"
    #include "hw_ints.h"
    #include "hw_nvic.h"
    #include "hw_sysctl.h"
    #include "hw_uart.h"
    #include "hw_types.h"
    #include "hw_memmap.h"
    #include "gpio.h"
    #include "pwm.h"
    #include "sysctl.h"
    #include "cycle.h"
    
    static volatile uint32_t ui32Loop;
    
    //*****************************************************************************
    //
    // Blink the on-board LED.
    //
    //*****************************************************************************
    
    void Setup(void)
    {
    	SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
    
    	//Enable GPIO Ports F, A, B, C.
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    	
    	// Do a dummy read to insert a few cycles after enabling the peripheral.
    	//ui32Loop = SYSCTL_RCGC2_R;
    	SysCtlDelay(10);
    	
    	 //Set as Outputs (DIR). Embedded within here is the DEN.
    		GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4);
    		GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2);
    		GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6);
    		GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3|GPIO_PIN_1|GPIO_PIN_2);
    	
    	// F4 is board button. Input.
    	GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_4);
    	//With luck this is activating the weak pull up resistor. 
    	HWREG(GPIO_PORTF_BASE+GPIO_O_PUR) |= (GPIO_PIN_4);	
    }
    
    void delay_ms(int del)     //generates delay in milliseconds
    {
    del = (SysCtlClockGet()/3.0)*del/1000.0;
    SysCtlDelay(del);
    }
    
    int
    main(void)
    {
    	Setup();
    
        while(1)
        {
            // Turn on the LED.
           GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_4, 0xFF);
            // Delay for a bit.
            for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++){}
            // Turn off the LED
            GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_4, 0x00);
            // Delay for a bit.
            for(ui32Loop = 0; ui32Loop < 200000; ui32Loop++){}
        }
    }
    

  • Zero_PD said:
     
    And there's no such thing as too much science fiction! 

    Perhaps true - but you risk "irking" some here.   (your sci-fi signature "remains long in view" during reply - thus may become obnoxious - I'm NOT a fan...)