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.

TM4C1294NCPDT: EXAMPLE OUT OF BOX FAILURE

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: SYSBIOS, , EK-TM4C1294XL

As is typical of example projects, I create a new one, and it doesn't even work.

I have the TIVA TM4C1294 XL launch pad. I am using CCS 7.2,  GCC 6.3.1.  No SysBios

Steps to reproduce:

  1. Create a new, empty, project with only main.c... Right out of the CCS menu.
  2. Build it.
  3. Load it.
  4. Launch the debugger.
  5. Watch it go to Fault ISR from the get-go.  I can't even set a breakpoint in tm4c1294ncpdt_startup_ccs_gcc.c

The project is attached.  The Stellaris debugger is loading the code, as it erased what was on the board previously.

How do you expect someone to learn this environment using the launchpad, if even the most rudimentary project shell that is created doesn't even work??

Can anyone help me out?

1488.Project0.zip

  • Hi Chris,
    There is a project0 example plus various TivaWare examples under <TivaWare_Installation>/examples/boards/ek-tm4c1294xl. Please import these projects into CCS to try them. You can start with the project0, hello, or blinky. These projects all have the device fully initialized.
  • Feel your pain!    Really!     And you must be advised - you are FAR (very far) from being alone!

    Christopher Weber said:
    I create a new one, and it doesn't even work.

    As vendor/friend Charles suggests - you are far better advised to 'Start from a 'KNOWN WORKING (i.e. vendor supplied/tested) PROJECT' - rather than attempting to 'Create your own.'

    Why is that?      (Staff/I - read your mind/hear you!)     The IDE has MANY 'Nooks & Crannies' - for those attempting to 'create their own' - success most always (likely always) proves elusive.    In no way is this any reflection upon you - your desire and/or capabilities.    It is - instead - the 'Bowing to Reality' - which (should) warrant consideration.    Note that  'your code's addition/placement' - w/in the  vendor's 'known good project' - insures that all of those (often hidden/obscure) 'IDE Nooks/Crannies' - have been 'FULLY MANAGED' - for you!     (Your attempt to 'create' - minus that 'IDE Expertise' - can never compete!)

    It should also be noted - what IS the motivation - for 'Always and ONLY - the 'urge' to, 'CREATE ONE's OWN PROJECT?'     (that's NEVER/EVER explained!)

    It proves easy to, 'Add your own code - w/in the existing vendor project - run & check  it - and then 'carefully & systematically' - remove vendor's example code.    (ideally one piece/section at a time - always testing/confirming - after each piece of vendor's code - is excised.    (killed/banished)     This 'method' - most always - saves you the time (and great effort) demanded to become an 'IDE Maven' - while enabling your project's success!    (which IS the goal - is it not?)

    Such guidance clearly - deserves better (i.e. some) vendor promotion.    (clearly their current 'method' is failing - that's widely known - perhaps 'one day'...)

    Piggy-Backing your code - w/in a Vendor Supplied/tested Project - is 'absolutely the way to go!       Allez!

  • Charles Tsai said:
    Hi Chris,
    There is a project0 example plus various TivaWare examples under <TivaWare_Installation>/examples/boards/ek-tm4c1294xl. Please import these projects into CCS to try them. You can start with the project0, hello, or blinky. These projects all have the device fully initialized.

    Charles,

    Nope.

    The only "examples" folder I have is "tirtos_tivac_2_16_01_14_examples"  in "C:\ti\tirtos_tivac_2_16_01_14".  And CCS finds nothing in there to import.  See:

    I seached for any examples, and there is nothing that follows your "<TivaWare_Installation>/examples/boards/ek-tm4c1294xl."  folder tree. 

    And I tried making CCS search from a root level, and got a massive list of things named "com_ti_rtsc_tirtos_example_xxx".  After digging through the list of over 300 of them, I selected example #141, and tried to import it (C:\ti\tirtos_tivac_2_16_01_14\resources\ek_tm4C1294XLEvaluationKit\driverExamples\tiDriverExamples\emptyExamples\com_ti_rtsc_tirtostivac_example_141.projectspec )

    It won't import, it gives me this error:

    Considering the TivaWare installation is older than CCS (I was using this almost 2 years ago with CCS 6.2, now I'm on 7.2 ) I don't see why updating is necessary...  and fails anyway.

    Cannot complete the install because one or more required items could not be found.
    Software being installed: CCS Flash Content 8.1.0.1297 (com.ti.dsflash.win32.feature.group 8.1.0.1297)
    Missing requirement: Debug Server - Win32 7.4.0.1313 (com.ti.ccstudio.debugserver.win32.feature.group 7.4.0.1313) requires 'com.ti.ccstudio.installer.win32.feature.group 7.4.0.00015' but it could not be found
    Cannot satisfy dependency:
    From: CCS Flash Content 8.1.0.1297 (com.ti.dsflash.win32.feature.group 8.1.0.1297)
    To: com.ti.ccstudio.debugserver.win32.feature.group 7.4.0.1313

    And this "super informative" message appears:

    All this, when all I want is a simple "empty example project with Main.c"...  which doesn't work with the GCC compiler...

  • Hi Chris,

     Please download the TivaWare from this link which provides a suite  of software tools for the development of Tiva C Series-based MCU applications.

     Once you download them you will find many examples as shown below.

    The TivaWare examples are non TI-RTOS based. If you want to run some TI-RTOS examples, you will use CCS Resource Explorer to import these examples. I will suggest you start with the TivaWare examples first and once you are familiar with the device you can move on to play with the TI-RTOS examples. 

  • cb1_mobile said:

    Piggy-Backing your code - w/in a Vendor Supplied/tested Project - is 'absolutely the way to go!       Allez!

    As I have done many other times, in another device, and in a previous incarnation of this IDE on this device...
    But now, it is not the way to go... Not when it doesn't work.  See my reply to Charles.
    But the "Vendor" as you so politely call them, gives a project generation option, in a similar manner to Visual Studio, Net Beans, Android Studio, MPLab, Quartus, IAR, and just about every other IDE package on the planet, but this one generates code that doesn't work.
    One would assume that "a Vendor Supplied/tested Project" would also include a simple "auto generated empty project".  After all, they give you that ability in the IDE.  And it would set all those "nooks and crannies" you speak of, because the project detail dialog asks you enough to create such a simple project.  How difficult could it be to supply a "tm4c1294ncpdt_startup_ccs.c" and "tm4c1294ncpdt.lds" file that woks properly??  In both compilers??  They can do that for the other device I used.
    Because I am confident that the "main.c" doesn't have any nooks and crannies that are configured wrong.  After all, it's only 4 lines:
    int main(void)
    {
    	return 0;
    }

    Lastly, why does it work when the compiler is set to "TI" but not when set to "GNU"?  I was told, on another post, to not use the TI compiler.  That they were no longer supporting it, and to move to GNU (in a Sitara forum).

    The difference between the TI project and GNU is somewhere in the startup, which is "Vendor Supplied".  In the TI world:

    • It sets the vector table, jumps to ResetISR, which calls _c_int00. All makes sense.  Except...
    • Yet, the map file says the entry is "_c_int00_noinit_noargs"...  where did it get this from?
    • And in the debugger, it jumped to an entry point named "_c_int00_template"...  from "boot_cortex_m.c" ( in .../compilers/ti-cgt-arm_17.9.0.STS/lib/src)  where did it get this name from? 

    What kind of shell games are they playing with changing symbol names under the covers?

    The vendor is deciding to hide too much.  In the decades of developing, I have been able to uncover and learn those "nooks and crannies" in all the other environments.  This is the only one that says "You don't need to know that, just move along"
  • So, I need to go backward?
    I have something called "tirtos_tivac_2_16_01_14"
    Now I need to install version 2.1.4.178

    What is the other thing I have? I was instructed to install that a couple years ago. For all I remember, it may have been installed through the Resource tool in CCS.
  • Hi Chris,
    People who are not developing TI-RTOS based applications use TivaWare. The tirtos_tivac_2_16_01_14 installation will also infer the TivaWare but to an older version. The TI-RTOS drivers wrap around the TivaWare drivers so the TI-RTOS drivers (i.e. UART, SPI, I2C and etc) can be used across all TI platforms of devices. In your original post you mentioned that you were creating a simple non-BIOS based example. This is why I suggested you can start with the TivaWare examples which are non TI-RTOS based. Many customers do not use OS and TivaWare is where they begin with the project development. If your application is solely TI-RTOS based, then you can start with the TI-RTOS examples for TM4C as I pointed out via the CCS resource explorer. I will still suggest if you have time, please give a try to the TivaWare to get a feel of what the library can provide you with. Please note that the TI-RTOS does not provide all drivers. For example, if you want to use the CAN or ADC module there is no TI-RTOS drivers for them. You will still need to use the TivaWare drivers.
  • Charles,
    The example "project0" I pulled in with the resource explorer used the TI Compiler. It works.
    I also installed the package you referred to, however CCS did not prompt me with a "new package found"

    I was also able to get a "new Project" | "Empty Project" to run if it is set for the TI compiler, but not if it is set for the GNU compiler.

    Does this mean you are not supporting the GNU compiler?

    That is the core question regarding this post.
  • Hi Chris,
    Did you upload some image? Not sure what you meant by <Code shown is not actual size.>. I will ask our TI-RTOS team to comment on GNU support for TM4C devices.
  • Charles,
    No, that is just a "signature" line to my posting... Meant as a bit of humor.

    Everything working as expected using the TI compiler. It's the GNU compiler that is the problem. And I use that compiler for Sitara, so I was expecting it to work for Tiva as well. Especially since it is an option when creating a new project.
  • TI-RTOS supports TI, GCC and IAR compiler. Please refer to the TI-RTOS release notes for recommended versions.

    I echo Charles response.

    If you don't want to use an RTOS, start with TivaWare.
    If you want to use FreeRTOS, start with TivaWare.
    If you want to use TI-RTOS, start with TI-RTOS for TivaC. As noted, TI-RTOS do not have full coverage on the drivers though. So it you want to use CAN or ADC, you'll need to do that yourself. You can use the examples in the stand-alone TivaWare product. We just ship parts of TivaWare in TI-RTOS (e.g. driverlib code and libraries) but not the TivaWare examples.

    Todd
  • Christopher Weber said:
    Watch it go to Fault ISR from the get-go

    I can repeat that with your example using GCC 6.3.1 and the latest CCS 8.1.0.00011. Adding the following to the tm4c1294ncpdt.lds linker script means the program then runs to main when launching the debug session:

    ENTRY(ResetISR)

    The need for this modification is "hidden" on Known issue when using CCS 6.1/Linaro GCC 4.8.4

    I originally reported this problem in Project for a TM4C1294NCPDT created in CCS 6.1 using GNU compiler doesn't run to main, and need to check if my suggestion of updating the default linker script provided with CCS got actioned.

  • I used CCS 8.1.0 to create a new "Empty project (with main.c)" using the GCC 7.2.1 compiler for a TM4C1294NCPDT and the program went to the Fault ISR when started a debug session. I.e. the default linker scripts supplied with the "latest" CCS 8.1.0 still have the problem.

  • Chester,
    Confirmed. Thanks for that info, it clears this up. Can I also ask a question about the TI build? Along the same topic:

    The TI build works, but doesn't set any "Entry(...)" like this solution for GNU.
    The "Entry" calls _c_int00 as expected, but that is not listed in the linker settings as the entry point.
    So I can find nothing that tells it to jump to "ResetISR" when the debugger loads... How does it know in the TI compiler/linker?
    And the map files shows the entry point as _c_int00_noargs... Where did it get that from?

    The vector table reset entry points to ResetISR as I would expect. So on the GNU... even if the debugger did not set the correct start point during the debug session, I see that a power cycle does go to the correct entry point (via the vector table).
  • Christopher Weber said:
    So I can find nothing that tells it to jump to "ResetISR" when the debugger loads.

    The header of the ELF format .out file contains the "Entry point" field which the debugger uses (as opposed to the debugger knowing the symbolic name of the entry point). The readelf program in the GCC ARM installation can display the entry point when the -l option is used.

    Taking your Project0 example for the GCC ARM, before the "Entry(...)" was added to the GCC linker script, the entry point in the ELF header is the address 0x208 which is the start of the .text segment shown in the .map file:

    $ ~/ti/ccs810/ccsv8/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/bin/readelf -l Project0/Debug/Project0.out 
    
    Elf file type is EXEC (Executable file)
    Entry point 0x208
    There are 5 program headers, starting at offset 52
    
    Program Headers:
      Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
      EXIDX          0x020b0c 0x00000b0c 0x00000b0c 0x00008 0x00008 R   0x4
      LOAD           0x010000 0x00000000 0x00000000 0x006d4 0x006d4 R E 0x10000
      LOAD           0x020000 0x20000000 0x000006d4 0x00438 0x00438 RW  0x10000
      LOAD           0x020b0c 0x00000b0c 0x00000b0c 0x00008 0x00008 R   0x10000
      LOAD           0x030438 0x20000438 0x20000438 0x00000 0x00240 RW  0x10000
    
     Section to Segment mapping:
      Segment Sections...
       00     .ARM.exidx 
       01     .intvecs .text .rodata .eh_frame 
       02     .data .jcr 
       03     .ARM.exidx 
       04     .bss 

    Whereas after the "ENTRY(ResetISR)" was added to the linker script the entry point in the ELF header is now 0x2f1 which the map file shows is the address of the ResetISR function:

    $ ~/ti/ccs810/ccsv8/tools/compiler/gcc-arm-none-eabi-6-2017-q1-update/arm-none-eabi/bin/readelf -l Project0/Debug/Project0.out 
    
    Elf file type is EXEC (Executable file)
    Entry point 0x2f1
    There are 5 program headers, starting at offset 52
    
    Program Headers:
      Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
      EXIDX          0x020b0c 0x00000b0c 0x00000b0c 0x00008 0x00008 R   0x4
      LOAD           0x010000 0x00000000 0x00000000 0x006d4 0x006d4 R E 0x10000
      LOAD           0x020000 0x20000000 0x000006d4 0x00438 0x00438 RW  0x10000
      LOAD           0x020b0c 0x00000b0c 0x00000b0c 0x00008 0x00008 R   0x10000
      LOAD           0x030438 0x20000438 0x20000438 0x00000 0x00240 RW  0x10000
    
     Section to Segment mapping:
      Segment Sections...
       00     .ARM.exidx 
       01     .intvecs .text .rodata .eh_frame 
       02     .data .jcr 
       03     .ARM.exidx 
       04     .bss 

    Note that when writing the Program Counter, the least significant bit sets the T bit in the Execution Program Status Register; where 0 = ARM state and 1 = THUMB state. The Cortex-M only support THUMB state, and the incorrect entry point of address 0x208 has the least significant bit clear and will probably cause as INVSTATE exception (hard fault) to occur when the debugger attempts to write the PC of of the incorrect entry point.

    Christopher Weber said:
    And the map files shows the entry point as _c_int00_noargs... Where did it get that from?

    _c_int00_noargs is an entry point in the TI ARM compiler run-time-library. The TI linker defaults to an appropriate entry point in the run-time-library unless overridden.

    Christopher Weber said:
    The vector table reset entry points to ResetISR as I would expect. So on the GNU... even if the debugger did not set the correct start point during the debug session, I see that a power cycle does go to the correct entry point (via the vector table).

    Agree, the flash is programmed with the correct entry point in the vector table; the issue was the debugger being told the incorrect "Entry point" in the ELF header of the .out file.

  • Chester,
    Thanks for writing this up. It is very informative. I know how long it takes to compose a comprehensive answer, and I appreciate it.

    However, my question remains about the TI. How did it set the entry point without the same "ENTRY(...)" that GNU needed? Because it works, and that directive is not in the linker script of the TI.
  • Christopher Weber said:
    However, my question remains about the TI. How did it set the entry point without the same "ENTRY(...)" that GNU needed?

    Sections 3.2 Entry Point and 3.3.1 _c_int00 of the TI ARM Assembly Language Tools User's Guide have some information on this. Basically, the TI linker appears to use a default name.

    If you look at the source code for the TI run time library, E.g. <ccs8_install_dir>ccsv8/tools/compiler/ti-cgt-arm_<compiler_version>/lib/src/boot_cortex_m.c the source code for the entry points can be seen. As of v18.1.3 there are four variants of the _c_int00 function, depending upon if arguments needs to be passed to main and/or C auto-variable initialisation is required. In the source code there are no attributes used to mark them as entry points; as suggested by the TI ARM Assembly Language Tools User's Guide the TI linker must have a built-in assumption of the default name of the entry point in the run time library.

  • Chester,

    Yes, you are correct and thank you for providing the answer. Here is how the linker does its determination: