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.

RTOS/TM4C1290NCZAD: TI-RTOS Hello Example (hello_DK_TM4C129X_TI_TivaTM4C129XNCZAD) crashed right after programming when using SEGGER J-Link

Part Number: TM4C1290NCZAD
Other Parts Discussed in Thread: SEGGER, , EK-TM4C1294XL

Tool/software: TI-RTOS

Hi,

I am having trouble with TI-RTOS Hello Example when I use SEGGER J-Link to program and debug my device. It either crashes immediately after programming the device or right after starting it after programming is finished.

When it crashes right after programming it gives the following output in the CCS console:

se: 0x3aa0146.
 stack size: 0x8f9c1f0.
R0 = 0x760801f1  R8  = 0xbdb00f46
R1 = 0x01f8161c  R9  = 0xc08ff0e8
R2 = 0x0098021c  R10 = 0x756e2846
R3 = 0x01f10029  R11 = 0x00296c6c
R4 = 0x7f900200  R12 = 0x006304c0
R5 = 0x00ae83f4  SP(R13) = 0xfce92d00
R6 = 0x51b10898  LR(R14) = 0x7e460541
R7 = 0x40700146  PC(R15) = 0x754a744c
PSR = 0xb0460f48
ICSR = 0x00000003
MMFSR = 0x00
BFSR = 0x01
UFSR = 0x0000
HFSR = 0x40000000
DFSR = 0x00000001
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000
Terminating execution...

I tried updating J-link drives but it did not help.

I do not see any problems when using XDS100v2 debugger.

I am using CCS 7.2.0.00013 and TI-RTOS 2.16.01.14.

Plase find copy of my project below. This is TI-RTOS Hello Example with one simple task added and device type changed to TM4C1290NCZAD.

hello_DK_TM4C129X_TI_TivaTM4C129XNCZAD.zip

I will be very grateful for any help.

Best regards,

Peter A.

  • Hi Peter,
    I just tried Jlink Ultra+ and I cannot replicate your result. In the console I see "hello world" followed by continuous "Working..." printed to the console. It is working on my EVM board using your program binary.

    Do you have the same problem with other examples? Can you please try a few more TI-RTOS examples and non TI-RTOS TivaWare examples? I don't understand how the emulator can be a cause of the problem though.

    I'm using the same CCS version as you are.
  • Hi Charles,

    Thank you for your response and for trying to replicate my problem.

    The behaviour that you see is the correct one - the one that I see only when I use the XDS100v2 debugger.

    I tried another TI-RTOS example - "Clock Example" (clock_DK_TM4C129X_TI_TivaTM4C129XNCZAD) and I got a similar result when using J-Link.

    When I first try to debug it (after switching from XDS100v2 to J-Link). The program crashes before I even get a chance to start it. After I press the "Debug" button CSS compiles the project, programs the device and stops in a crashed state. Please see the screen shot below:

    On every subsequent attempt after I press the "Debug" button CCS compiles the code, programs the device and stops on the first line in main(), but after I press the "Resume" button the program crashes immediately. Please see the screen shot below:

    I do not see any of those crashes when I use XDS100v2.

    Please find the project that I used attached below. I modified it to use TM4C1290NCZAD and run continuously instead of exiting when second timer times out.

    clock_DK_TM4C129X_TI_TivaTM4C129XNCZAD.zip

    I also tried a non-TI-RTOS project - uart_echo (attached below) and It works fine both with J-Link and XDS100v2.

    1121.uart_echo.zip

    I also find it a bit strange that debugger causes program to crash but I have run out of ideas after using an example project and still seeing the problem.

    I will greatly appreciate any help you could provide.

    Best regards,

    Peter A.

  • Hi Charles,

    I also tried on my colleague's PC and we got the same crash on the first attempt and a different crash on every subsequent attempt:

    We did not see any crashes when we switched to XDS100v2.

    I do not know if that matters but both PCs that I tested on run Windows 10 64b.

    Best regards,

    Peter A.

  • Hi Peter,

      Unfortunately, I still cannot replicate your result after i ran the clock example. It was running fine on my EVM board. Do you have a TM4C129 LaunchPad that you can try? I'm using the LaunchPad to run your project. Also I run on a Windows 7 PC. 

      One thing I will suggest you try but I'm not sure if it will make a difference on you. I do not click on the debug button. What I do is manual steps as follows:

      1. Select View->Target Configurations

      2. From the list of target configurations you have, select the one that corresponds to your project. Look for under either the User Defined or Projects

      3. Once you see your target configuration do right-click and select "Launch Target Configuration"

      4. Select Run->Connect Target

      5. Select Run->Load Program and give the .out file for your project.

      6. Run the program

      Does it make a difference?

  • Hi Charles,

    Unfortunately, I do not have a LaunchPad.

    I tried the procedure you suggested but I got exactly same result: no problems when using XDS100v2 and same crashes when using J-Link.

    I will try to find a win7 machine and test there.

    Best regards,

    Peter A.

  • Hi Charles,

    I managed to get a DK-TM4C129X development board. I tried to program it through JLink and got exactly same results - Program crashes either right after programming or right after starting it.

    When I used in-circuit programmer embedded in the board I did not see any problems.

    I also noticed that if I click the "CPU Reset" button after the initial crash the program starts normally and works as expected.

    Are there any settings in CCS that could cause this?

    Best regards,

    Peter A.

  • Hi Peter,
    I'm currently out of office. I will be back tomorrow and will try to replicate it.
  • Hi Peter,

    Can you check a couple things.

    1. What's the entry point? You need to disable the "run to main" feature in CCS. To do this once you've loaded the image, halt it and do

    - Tools->Debugger Options -> Auto Run and Launch Options

    - uncheck the "On a program load or restart" box.

    - Save ("Remember my Settings"...not sure why it's not just save)

    - CPU Reset (highlighted below)

    - Restart (highlighted below)

    You should be at _c_int00...are you there?

    2. Could the watchdog be going off? The RTOS does not do anything with it.

    Todd

  • H Todd,

    I think it all looks ok.

    1. After following your instructions and starting debug session I was at _c_int00.

    After clicking "resume" program crashed as before:

    after restarting the whole procedure program crashed in the second way(same as before):

    2. I did not add watchdog configuration to the example project that I used, so it should not be enabled. I confirmed that by checking the RCGCWD register in run-time.

    Best regards,

    Peter A.

  • Hi Peter,

    Can you look in Tools->ROV->Hwi->Exception to see the back trace? This should help show what is causing the exception.

    Todd
  • Hi Todd,

    Please see below:

    I also noticed that there is a lot of interrupts listed in the "Detailed" tab. Not sure if that matters but it seems strange.

    After I press the "CPU Reset" button and then "resume" there is only one int listed in the detailed view.

    Best regards,

    Peter A.

  • Did you ever figure this out? I'm having the same problem with my J-Link, while the ICDI interface on the EK-TM4C1294XL works totally fine. Really frustrating.
  • Stepping through with the J-Link, it always crashes as I try to step into this line:

    You can see the console output from the previous crash in the screenshot too.

  • Hi Nick,
    Unfortunately I did not. I was hoping that one of the j-link support updates in CCS would fix it but it never did. I just stopped using J-Link and switched to XDS100v2, which unfortunately is significantly slower.

    Best regards,
    Peter A.
  • Thanks Peter,

    That's bad news for me, as I only own a J-Link. Hopefully someone from TI can shed some light on this.

    Nick

  • Hi Nick,
    It may have something to do with the CCS emulation driver. I will suggest you post your question on the CCS forum and I hope the expert there will be able to assist you better than the TM4C forum.
  • Thanks Charles,

    For anyone who is watching this thread, I made another post in the CCS forum: e2e.ti.com/.../647708

    Cheers,
    Nick
  • Peter Adamus said:
    XDS100v2, which unfortunately is significantly slower.

    The XDS110 is available and has better performance according to the product page.

  • Peter,

    The solution suggested in the other thread seems to be working for me, maybe you'd like to give it a try.

    Nick
  • Hi Nick,
    I just tried it and it works fine. Thank you very much for the information.

    Best regards,
    Peter A.
  • Hi Peter,
    Thank you for the information. It looks like a reasonable alternative. I will give it a try when I get a chance.
    Best regards,
    Peter A.