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.

Compiler/TMS320C5515: calling an external function causes infinite loop

Part Number: TMS320C5515

Tool/software: TI C/C++ Compiler

Okay, I'm trying to call a simple SAR setup routine to initialize the ADC on the EVM board I have, so that I can read in voltage levels, perform an FFT on it, then send the results out via UART.  BUT, when I launch the program and it calls the function to initialize the SAR controller, the program just stops responding, it doesn't throw any errors, it just sits and spins, infinitely, there are no loops in my code, so I don't know where it's getting hung up (see below)

Here's the main function(I know it's not all of it, but the first printf is all that's important):

Here's the function it's trying to call (I know it's not all of it, but the first printf is all that's important):

And here's what I get when I run it:

Notice the lack of the "Beginning SAR initialization...\n"

I don't get it, I know it's probably something simple, but I can't figure it out

I've attached the whole project below, the code for this issue is in the DSPFFT project:

DSP FFT Project.zip

Thank you for any of your help,

Aaron

  • Aaron Jencks said:
    I'm trying to call a simple SAR setup routine to initialize the ADC on the EVM board I have

    We in this forum lack the expertise to help with that.  But I can shed some light on one thing.

    Aaron Jencks said:
    but the first printf is all that's important

    The RTS function printf is very expensive.  It uses lots of stack, heap, cycles, etc.  On a hosted system, this is not a concern.  On an embedded system, it is very much a concern.  Please see the article Tips For Using Printf.  The first thing you should check: Are you running out of stack?

    Thanks and regards,

    -George