This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Target not created

I keep getting a 'Target not created' error at the end of compile. When I comment out a printf, everything is fine. What is the problem?

Thank you.

Parents
  • "Yes. I tried replacing the printf with a function that uses puts(). The project compiles OK but the program hangs on this function call."

    Calling the same function from an ISR and non-ISR code is a recipe for disaster. printf() may well call puts() internally hence the problem remains. I prefer not to call any functions from the ISR - I usually inline all code.

    "So, you suggest I get rid of the uncalled functions first?"

    Yes. A trick I sometimes use is to create a function containing dummy calls to all uncalled functions (if I plan to use these functions for real later in development). I then put a call to that function in some unreachable code in my main function:

    if(!SP)
    {
    MakeDummyCalls();
    }

    is my favourite.

    "But how can an uncalled function cause an overflow?"

    If the compiler can't see a call to a function it assumes the function must be called via a pointer and excludes it from the overlay map. Local variables in that function then have to be given their own unique storage locations - as though they had been declared static.

    Stefan

Reply
  • "Yes. I tried replacing the printf with a function that uses puts(). The project compiles OK but the program hangs on this function call."

    Calling the same function from an ISR and non-ISR code is a recipe for disaster. printf() may well call puts() internally hence the problem remains. I prefer not to call any functions from the ISR - I usually inline all code.

    "So, you suggest I get rid of the uncalled functions first?"

    Yes. A trick I sometimes use is to create a function containing dummy calls to all uncalled functions (if I plan to use these functions for real later in development). I then put a call to that function in some unreachable code in my main function:

    if(!SP)
    {
    MakeDummyCalls();
    }

    is my favourite.

    "But how can an uncalled function cause an overflow?"

    If the compiler can't see a call to a function it assumes the function must be called via a pointer and excludes it from the overlay map. Local variables in that function then have to be given their own unique storage locations - as though they had been declared static.

    Stefan

Children
No data