My program runs completely fine when flashed from within the CCS debug tools.
When I make a binary file and use LM Flash, I have to make odd adjustments to the code for it to run correctly.
For example, the following code runs correctly when flashed from within CCS. But when converted to a binary and flashed with LM Flash, it crashes immediately.
int etherInit(void) { /* normal code */ ipaddr_aton(OUR_IP,&gd.requestedIpAddr); /* normal code */ ipaddr_aton(OUR_SUBNET,&gd.subnetMask); }
Inserting the following lines, allows the code to run both from CCS and LM Flash.
int etherInit(void) { /* had to add this to have the program run correctly using LM Flash */ gd.u32_junk_variable++; /* normal code */ ipaddr_aton(OUR_IP,&gd.requestedIpAddr); /* had to add this to have the program run correctly using LM Flash */ gd.u32_junk_variable++; /* normal code */ ipaddr_aton(OUR_SUBNET,&gd.subnetMask); }
Regardless what variants of compiler/linker configurations (optimization levels, data alignments, etc), the code always works when flashed with CCS.
But nothing will allow me to remove my junk variable incrementers when flashed with LM Flash.
Any suggestions would be very much welcomed,
Peter
Environment:
Code Composer Studio Version: 11.2.0.00007
Invoking: ARM Compiler
"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -O1 --fp_mode=relaxed --include_path="C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/include" --include_path="C:/Users/peter/workspace_v11/FlexGen" --include_path="C:/ti/TivaWare/" --include_path="C:/ti/TivaWare/third_party/lwip-1.4.1/" --include_path="C:/ti/TivaWare/third_party/lwip-1.4.1/src/include/" --include_path="C:/ti/TivaWare/third_party/lwip-1.4.1/src/include/netif/" --include_path="C:/ti/TivaWare/third_party/lwip-1.4.1/ports/tiva-tm4c129/include" --include_path="C:/ti/TivaWare/third_party/lwip-1.4.1/src/include/ipv4" --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=TARGET_IS_TM4C129_RA0 --define=LWIP_PROVIDE_ERRNO --define=LWIP_COMPAT_MUTEX -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --fp_reassoc=off --preproc_with_compile --preproc_dependency="ether.d_raw" "../ether.c"
Finished building: "../ether.c"
Building target: "FlexGen.out"
Invoking: ARM Linker
"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 -me -O1 --fp_mode=relaxed --define=ccs="ccs" --define=PART_TM4C1294NCPDT --define=TARGET_IS_TM4C129_RA0 --define=LWIP_PROVIDE_ERRNO --define=LWIP_COMPAT_MUTEX -g --gcc --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi --fp_reassoc=off -z -m"FlexGen.map" --heap_size=4096 --stack_size=8192 -i"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/lib" -i"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/include" --reread_libs --diag_wrap=off --display_error_number --warn_sections --xml_link_info="FlexGen_linkInfo.xml" --rom_model -o "FlexGen.out" "./dataCollect.obj" "./dataLog.obj" "./define.obj" "./dq.obj" "./ether.obj" "./filter.obj" "./hardware.obj" "./intHandlers.obj" "./lwiplib.obj" "./main.obj" "./menu.obj" "./parameters.obj" "./pi.obj" "./pll.obj" "./sensor.obj" "./software.obj" "./tm4c1294ncpdt_startup_ccs.obj" "../tm4c1294ncpdt.cmd" -llibc.a -l"C:/ti/TivaWare/driverlib/ccs/Debug/driverlib.lib"
<Linking>
Finished building target: "FlexGen.out"
Building secondary target: "FlexGen.bin"
Invoking: ARM Hex Utility
"C:/ti/ccs1120/ccs/tools/compiler/ti-cgt-arm_20.2.5.LTS/bin/armhex" --fill=0 --binary -o "FlexGen.bin" "FlexGen.out"
Translating to Binary format...
"FlexGen.out" .intvecs ==> .intvecs
"FlexGen.out" .text ==> .text
"FlexGen.out" .const ==> .const
"FlexGen.out" .cinit ==> .cinit
Finished building secondary target: "FlexGen.bin"