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.

tm4c123gh6pm includes

Other Parts Discussed in Thread: TM4C123GH6PM, SYSBIOS

HI,

I'am a new user and have been trying to configure the PWM modual on my tm4c123gh6pm board using CCS Version 5. If I start with an example project, I am able to build the entirety with no problem. When I use some sample code which I found, I encounter what appears to be linking errors in the include statements, I have tried going project-properties-ARM Compiler-includes, and searching my computer to find the correct files, then adding the link to include path. This gets rid of the errors within the code but still gives me a link error. I also checked the linked resources, based upon a source, and was missing TIVAWARE_INSTALL which did not fix any errors. Under advanced options I was missing the Pre-defines PART_TM4C123GH6PM and TARGET_IS_BLIZZARD_RB1 using the same source above. I do not believe the code to be the error but I have pasted it, and the errors I am receiving below. Thank you for your help.

**** Build of configuration Debug for project hello_TivaTM4C123GH6PM ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
making ../src/sysbios.aem4f ...
gmake[1]: Nothing to be done for `all'.
'Building file: ../hello.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv5/tools/compiler/arm_5.1.1/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/inc" --include_path="C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib" --include_path="C:/ti/ccsv5/tools/compiler/arm_5.1.1/include" -g --define=PART_TM4C123GH6PM --define=TARGET_IS_BLIZZARD_RB1 --diag_warning=225 --display_error_number --diag_wrap=off --preproc_with_compile --preproc_dependency="hello.pp" --cmd_file="./configPkg/compiler.opt" "../hello.c"
"../hello.c", line 55: warning #225-D: function "ROM_SysCtlPeripheralenable" declared implicitly
"../hello.c", line 81: warning #112-D: statement is unreachable
'Finished building: ../hello.c'
' '
'Building target: hello_TivaTM4C123GH6PM.out'
'Invoking: ARM Linker'
"C:/ti/ccsv5/tools/compiler/arm_5.1.1/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --define=PART_TM4C123GH6PM --define=TARGET_IS_BLIZZARD_RB1 --diag_warning=225 --display_error_number --diag_wrap=off -z -m"hello_TivaTM4C123GH6PM.map" -i"C:/ti/ccsv5/tools/compiler/arm_5.1.1/lib" -i"C:/ti/ccsv5/tools/compiler/arm_5.1.1/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="hello_TivaTM4C123GH6PM_linkInfo.xml" --rom_model -o "hello_TivaTM4C123GH6PM.out" -l"./configPkg/linker.cmd" "./hello.obj" "../tm4c123gh6pm.cmd" -l"libc.a"
<Linking>

undefined first referenced
symbol in file
--------- ----------------
PWMGenConfigure ./hello.obj
PWMGenPeriodSet ./hello.obj
ROM_SysCtlPeripheralenable ./hello.obj
SysCtlClockGet ./hello.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "hello_TivaTM4C123GH6PM.out" not built

>> Compilation failure
gmake: *** [hello_TivaTM4C123GH6PM.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

/*
* ======== hello.c ========
* The hello example serves as a basic sanity check program for SYS/BIOS. It
* demonstrates how to print the string "hello world" to stdout.
*/

#include <xdc/std.h>

#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>

#include <stdint.h>
#include <stdbool.h>
#include "hw_memmap.h"
#include "hw_types.h"
#include "sysctl.h"
#include <gpio.h>
#include "debug.h"
#include "pwm.h"
#include "pin_map.h"
#include "hw_gpio.h"
#include "rom.h"

/*
* ======== main ========
*/

#define PWM_FREQUENCY 55
Int main()
{
//System_printf("hello world\n");

/*
* normal BIOS programs, would call BIOS_start() to enable interrupts
* and start the scheduler and kick BIOS into gear. But, this program
* is a simple sanity test and calls BIOS_exit() instead.
*/
// PWM variables
volatile uint32_t ui32load;
volatile uint32_t ui32pwmclock;
volatile uint8_t ui8adjust;
//volatile uint8_t GPIO_PD0_M1PWM0;
volatile uint8_t PWM1_Base;
volatile uint8_t PWM_BASE;
ui8adjust=83;
//GPIO_PD0_M1PWM0=0;
//PWM1_Base=1;
//PWM_BASE=1;


ROM_SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ);
ROM_SysCtlPWMClockSet(SYSCTL_PWMDIV_64);

ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1);
ROM_SysCtlPeripheralenable(SYSCTL_PERIPH_GPIOD);
ROM_SysCtlPeripheralenable(SYSCTL_PERIPH_GPIOF);

ROM_GPIOPinTypePWM(GPIO_PORTD_BASE,GPIO_PIN_0);
ROM_GPIOPinConfigure(GPIO_PD0_M1PWM0);

HWREG(GPIO_PORTF_BASE +GPIO_O_LOCK) = GPIO_LOCK_KEY;
HWREG(GPIO_PORTF_BASE + GPIO_O_CR) |= 0X01;
HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = 0;
ROM_GPIODirModeSet(GPIO_PORTF_BASE,GPIO_PIN_4|GPIO_PIN_0,GPIO_DIR_MODE_IN);
ROM_GPIOPadConfigSet(GPIO_PORTF_BASE,GPIO_PIN_4|GPIO_PIN_0,GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU);

ui32pwmclock=SysCtlClockGet() / 64;
ui32load=(ui32pwmclock / PWM_FREQUENCY) - 1;
PWMGenConfigure(PWM1_Base,PWM_GEN_0,PWM_GEN_MODE_DOWN);
PWMGenPeriodSet(PWM1_BASE,PWM_GEN_0,ui32load);

ROM_PWMPulseWidthSet(PWM_BASE,PWM_OUT_0,ui8adjust*ui32load / 1000);
ROM_PWMOutputState(PWM1_BASE, PWM_OUT_0_BIT,true);
ROM_PWMGenEnable(PWM1_BASE,PWM_GEN_0);

while(1)
{

}

BIOS_exit(0); /* terminates program and dumps SysMin output */
return(0);
}