Greetings, trying to expand my knowledge of micro-controllers by working on the TIVA C Series Launchpad and completing the workbook
Below is the code straight from Lab 5 workbook.
#include <stdint.h> #include <stdbool.h> #include "inc/hw_memmap.h" #include "inc/hw_types.h" #include "driverlib/debug.h" #include "driverlib/sysctl.h" #include "driverlib/adc.h" #define TARGET_IS_BLIZZARD_RB1 #include "driverlib/rom.h" int main(void) { uint32_t ui32ADC0Value[4]; volatile uint32_t ui32TempAvg; volatile uint32_t ui32TempValueC; volatile uint32_t ui32TempValueF; ROM_SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_OSC_MAIN|SYSCTL_XTAL_16MHZ); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); ROM_ADCHardwareOversampleConfigure(ADC0_BASE, 64); ROM_ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0); ROM_ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS); ROM_ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS); ROM_ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS); ROM_ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END); ROM_ADCSequenceEnable(ADC0_BASE, 1); while(1) { ROM_ADCIntClear(ADC0_BASE, 1); ROM_ADCProcessorTrigger(ADC0_BASE, 1); while(!ROM_ADCIntStatus(ADC0_BASE, 1, false)) { } ROM_ADCSequenceDataGet(ADC0_BASE, 1, ui32ADC0Value); ui32TempAvg = (ui32ADC0Value[0] + ui32ADC0Value[1] + ui32ADC0Value[2] + ui32ADC0Value[3] + 2)/4; ui32TempValueC = (1475 - ((2475 * ui32TempAvg)) / 4096)/10; ui32TempValueF = ((ui32TempValueC * 9) + 160) / 5; } }
I'm getting a warning on the call
ROM_ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
That states: function "ROM_ADCSequenceConfigure" declared implicitly
When debugging i get a linker error, the CDT console says:
**** Build of configuration Debug for project lab5 ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building target: lab5.out'
'Invoking: ARM Linker'
"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off -z -m"lab5.map" --heap_size=0 --stack_size=100 -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="lab5_linkInfo.xml" --rom_model -o "lab5.out" "./main.obj" "./tm4c123gh6pm_startup_ccs.obj" "C:/ti/TivaWare_C_Series-2.1.3.156/driverlib/ccs/Debug/driverlib.lib" "../tm4c123gh6pm.cmd" -llibc.a
<Linking>
undefined first referenced
symbol in file
--------- ----------------
ROM_ADCSequenceConfigure ./main.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "lab5.out" not built
>> Compilation failure
makefile:136: recipe for target 'lab5.out' failed
gmake: *** [lab5.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****
I've searched on the forums the linker error possibly being related to not having the driverlib added to the file search path under build options, however this does not fix the issue. If i comment out the call to ROM_ADCSequenceConfigure the project complies no problem, no linker errors.