I'm working thru the TM4C workbook, currently on lab 9. I copied the code exactly as it is from main.txt into my main.c
#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/fpu.h"
#include "driverlib/sysctl.h"
#include "driverlib/rom.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define SERIES_LENGTH 100
float gSeriesData[SERIES_LENGTH];
int32_t i32DataCount = 0;
int main(void)
{
float fRadians;
ROM_FPULazyStackingEnable();
ROM_FPUEnable();
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);
fRadians = ((2 * M_PI) / SERIES_LENGTH);
while(i32DataCount < SERIES_LENGTH)
{
gSeriesData[i32DataCount] = sinf(fRadians * i32DataCount);
i32DataCount++;
}
while(1)
{
}
}
However the project has errors. I get warnings on the ROM calls about being declared implicitly and then I get linker errors because of unresolved symbols from the ROM functions. Below is the build output
**** Build of configuration Debug for project lab9 ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../main.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --include_path="C:/ti/TivaWare_C_Series-2.1.3.156" -g --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="main.d" "../main.c"
"../main.c", line 24: warning #225-D: function "ROM_FPULazyStackingEnable" declared implicitly
"../main.c", line 25: warning #225-D: function "ROM_FPUEnable" declared implicitly
"../main.c", line 27: warning #225-D: function "ROM_SysCtlClockSet" declared implicitly
'Finished building: ../main.c'
' '
'Building file: ../tm4c123gh6pm_startup_ccs.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_15.12.1.LTS/include" --include_path="C:/ti/TivaWare_C_Series-2.1.3.156" -g --define=PART_TM4C123GH6PM --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="tm4c123gh6pm_startup_ccs.d" "../tm4c123gh6pm_startup_ccs.c"
'Finished building: ../tm4c123gh6pm_startup_ccs.c'
' '
'Building target: lab9.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"lab9.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="lab9_linkInfo.xml" --rom_model -o "lab9.out" "./main.obj" "./tm4c123gh6pm_startup_ccs.obj" "../tm4c123gh6pm.cmd" -llibc.a
<Linking>
undefined first referenced
symbol in file
--------- ----------------
ROM_FPUEnable ./main.obj
ROM_FPULazyStackingEnable ./main.obj
ROM_SysCtlClockSet ./main.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "lab9.out" not built
>> Compilation failure
makefile:135: recipe for target 'lab9.out' failed
gmake: *** [lab9.out] Error 1
gmake: Target 'all' not remade because of errors.
**** Build Finished ****