Other Parts Discussed in Thread: C2000WARE,
Tool/software: Code Composer Studio
HI. I am a beginner in C2000 microcontrollers. My only previous experience is with Arduino and Arduino-compatible microcontrollers. So, please explain like I'm five!
I can connect to the Launchpad, compile the demo program Example_F2802xLaunchPadDemo (the "demo"), download it to the board, run and debug it. It all works fine as long as it's plugged in. If I power cycle the board or press the reset button, it doesn't boot. It requires the program to be downloaded into Flash again, either with the downloader or the debugger in CSS.
By comparison, the Example_F2802xLEDBlink (the "blinker") from the same version of C2000Ware does boot correctly from Flash. So I know that everything is basically working in terms of the hardware and communication. I can compile, build, link, download, debug, and boot from Flash. There must be an incorrect setting or error that is specific to the demo project
Here is the vintage of the hardware and software I am using. The board was recently purchased from the TI store, and CCS and C2000Ware were downloaded last week.
- LAUNCHXL-F28027: Lot: 03262017I2; Week: 19/2017
- CCS: Version 9.0.1.00004
- C2000Ware - v:1.00.06.00
The example code is from C2000Ware/English/Devices/F2802x/F28027/Examples/Driverlib/C2kLaunchPadDemo
Some settings:
- The Active (and only) Build Configuration is Flash
- The C2000 compiler has the define=_FLASH flag
- The C2000 linger has the --define=_FLASH and --define=LARGE_MODEL flags set
- I have the S1 switch set to 111 when connected to the PC and to 110 when trying to boot standalone.
- All settings and code are exactly as loaded from C2000Ware - I have not modified the demo.
Linker flags:
-v28 -ml -mt -O0 -g --define=_FLASH --define=NDEBUG --define=_DEBUG --define=LARGE_MODEL --quiet --verbose_diagnostics --diag_warning=225 --diag_suppress=552 --gen_func_subsections=on -z --stack_size=0x300 -m"Example_F2802xLaunchPad_demo.map" --heap_size=0x200 --warn_sections -i"C:/TI/ccs901/ccs/tools/compiler/ti-cgt-c2000_18.12.1.LTS/lib" -i"C:/TI/ccs901/ccs/tools/compiler/ti-cgt-c2000_18.12.1.LTS/include" -i"C:/Users/Jeremy/Documents/workspace_v9/Example_F2802xLaunchPadDemo" -i"C:/TI/C2000Ware_1_00_06_00_Software/device_support/f2802x/common/lib" -i"C:/TI/C2000Ware_1_00_06_00_Software/libraries/math/IQmath/c28/lib" --reread_libs --verbose_diagnostics --issue_remarks --entry_point=_c_int00 --rom_model
Compiler flags:
-v28 -ml -mt -O0 -g --include_path="C:/TI/ccs901/ccs/tools/compiler/ti-cgt-c2000_18.12.1.LTS/include" --include_path="C:/TI/C2000Ware_1_00_06_00_Software/device_support/f2802x/common/include" --include_path="C:/TI/C2000Ware_1_00_06_00_Software/device_support/f2802x/headers/include" --define=_FLASH --define=NDEBUG --define=_DEBUG --define=LARGE_MODEL --quiet --verbose_diagnostics --diag_warning=225 --diag_suppress=552 --gen_func_subsections=on
Update:
The demo will boot from Flash with linker flag --entry_point=_c_int00 changed to --entry_point=code_start
Since I started writing this note, I found a solution to the problem. I changed the linker flag from --entry_point=_c_int00 to --entry_point=code_start, because I noticed that is what the blinker demo used, and it boots from Flash successfully. This produces a build warning: "warning: entry-point symbol other than "_c_int00" specified: "code_start"". However, when this change is made, the board will boot from Flash upon powerup. It will also boot from Flash if RST button is pressed as long as S1 is set to 110.
This is what the linkInfo.xml file for the original demo says:
<entry_point>
<name>_c_int00</name>
<address>0x3f2d46</address>
</entry_point>
This is what the llinkInfo.xml for the modified demo says:
<entry_point>
<name>code_start</name>
<address>0x3f7ff6</address>
From the Boot ROM documentation, 0x3f7ff6 is the correct entry point.
Questions:
- I thought _c_int00 defined the entry point. Why does the working blinker demo use --entry_point=code_start?
- Where is the value for _c_int00 defined, and why is it wrong?
- Where is the value for code_start defined?
- Why does the linker give a warning for --entry_point=code_start?
- Why doesn't the demo program shipping with the launch pad work correctly? It will be quick, they said! It will be easy, they said! And days later here I am, surrounded by a stack of TI Reference Guides and Application Notes, having read through dozens of E2E threads, single stepping through the boot ROM in the disassembly window, wondering why my "simple and complete" eval kit won't boot its demo program correctly.
Thanks,
Ciaran