[SOLVED] Having Hard Fault in Tiva Launchpad FreeRTOS with J-Link but works fine in ICDI

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Having Hard Fault in Tiva Launchpad FreeRTOS with J-Link but works fine in ICDI

    I'm doing a relatively intermediate FreeRTOS learning exercise with Tiva TM4C123GXL Launchpad from this site especially that Task_SPI_Transfer project.

    forum.43oh.com/topic/9487-my-t…ertos-on-the-tm4c/?page=2

    The problem is that whenever I'm using SEGGER J-Link EDU, I always end up with an undebuggable hard fault once I run it. I followed the setup and wiring for the launchpad to J-link from this website below

    wiki.segger.com/TM4C123G_LaunchPad

    except for the 3.3V and GND which were pointed wrongly in the picture.

    I have tried three test scenarios for that:

    IDE - Eclipse Oxygen with GNU ARM Eclipse plugins; Debugger - J-Link
    Result: Hard fault. The CFSR register points me to bus fault, precise error, but the instruction address is 0x40000 which contains absolutely no code. Other things that I've noticed is that a certain thread disappeared (thread #5) and this message appeared. I am attaching that picture.

    IDE - TI CCS v6.2; Debugger - J-Link
    Result: Hard fault. The CFSR register points me to imprecise error. Tried to reduce clock from 80MHz to 40MHz then to 20MHz. Nothing changed it's still imprecise hard fault.

    IDE - TI CCS v6.2; Debugger - the default ICDI
    Result: It WORKS! It should be since many people said it does (based on the forum). Strange....


    What's wrong with J-Link here? I also want to note that in the first exercise in the webpage, about a LED blinking task, I was able to run it in all THREE CASES above with no problems. But once I insert a semaphore, like xSemaphoreTake() just like in the project I'm having trouble with, that's when the hard faults start to appear.

    I can't settle with just TI ICDI; the reason I bought J-Link is because it's more universal, it has thread-awareness, and I can do a FreeRTOS tracing via SystemView. I can't do those things with ICDI. That's why I need help to fix this.



    EDIT: Oops seems like I placed this in the wrong thread. Please transfer to J-Link forums if needed.
    Images
    • hard_fault.png

      261.49 kB, 1,920×1,080, viewed 565 times
    • before.png

      251.33 kB, 1,920×1,080, viewed 518 times
    • after.png

      240.81 kB, 1,920×1,080, viewed 488 times

    The post was edited 1 time, last by ubermensch ().

  • Hi,

    *Thread has been moved to J-Link/Flasher related*

    Thank you for your inquiry.
    Such an issue is not known to us.
    Generally J-Link will only execute tasks that the IDE tells him to do. So whatever the IDEs tell J-Link to do when you insert the semaphore will cause the hard fault.
    Could you provide a J-Link log file of the session when the error appears?
    wiki.segger.com/Enable_J-Link_log_file
    Please understand that we can only give advice for SEGGER products. Eclipse, FreeRTOS and CCS are all not SEGGER products, so please get in touch with the proper support channels as this is most likely no J-Link issue.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hi Nino,

    Here are the logs as you requested. Hope that this helps. I hope that my suspicion about J-Link is wrong, since in my 3-case experiment the bug appears whenever J-link is present and being used.
    Images
    • stack.png

      235.67 kB, 1,920×1,080, viewed 434 times
    Files
    • log1.txt

      (221.4 kB, downloaded 352 times, last: )
    • log2.txt

      (245.97 kB, downloaded 318 times, last: )
    • log3.txt

      (227.9 kB, downloaded 290 times, last: )
  • Hello,

    this issue has not to do with the J-Link itself but how IDEs are using J-Link.
    Attached is an example project for the eval board created with Embedded Studio using the CPU support package manager: segger.com/products/developmen…o/technology/cpu-support/

    You can also open the Ozone debugger project included in the folder: segger.com/products/development-tools/ozone-j-link-debugger/

    Is the example project working on your hardware?

    Does the issue happen only with FreeRTOS enabled?
    Do generic projects work with the IDEs you try to use?

    Should you still encounter hard faults take a look at our application note regarding hard faults to find out where they are exactly coming from:

    segger.com/downloads/application-notes/AN00016

    Please understand that we can't put more time into this case as generally everything is working from a J-Link perspective.
    Should the issues be realted to FreeRTOS contact the FreeRTOS support forum.

    Best regards,
    Nino
    Files
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks for the reply. I've found the cause of my issue anyway; it was stack overflow on the side of FreeRTOS. I think this thread can be closed as the problem has been resolved and had closure.
    Thanks for the info and files you've sent. These will be very useful in my subsequent debugging.
  • Hello,

    Great to hear that you are up and running again.
    We will consider this case as closed now.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.