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.

Stack error during code execution

Hello,

I'm using Piccolo F28027 LaunchPad board to perform a control loop on a DC-DC converter.

The code was running fine with two loops, one loop of 500Hz to control the DC-DC and another loop of 1Hz just to blink a led and modify some variables.

I added a code to start sending the variable values to serial port inside the 1Hz loop, there is no errors during the compilation but just after the code starts executing the program stops with an error stack regarding the task of 1Hz.

The error is:

0x89c0 stack error, SP = 0x804a.
xdc.runtime.Error.raise: terminating execution


I already checked the tasks stack size and stackpeak size through RTOS Object View (ROV) and everything seems to be fine.

I noticed that, if I try to send to the port a character instead of a float value the code runs without problems.

Does anyone have any idea of what might be the problem?

Thanks in advance.

Mário Silva

  • Mário Silva said:

    I noticed that, if I try to send to the port a character instead of a float value the code runs without problems.

     Hi, how did you sent the float value to what port?

     If you are sending a multibyte may be you are burdening some I/O register or simply overwrite memory getting a fault, if send byte is waiting for an 8 bit value I fear you sent instead a 32/64 bit.

  • Hi Roberto,

    thank you for replying..

    I am sending the float value to the serial port through SCI configuration, I have the communication running in another separated project and I took the code from an example of C28x sample code.

    The issue showed up when I tried to merge the control loop code with the communication code..My guess is that something related to the memory stack of the communication task isn't good..

    Best regards,

    Mário Silva

  • Mário Silva said:

    The issue showed up when I tried to merge the control loop code with the communication code..My guess is that something related to the memory stack of the communication task isn't good..

     just an example....

     Send_SPI( unsigned char x){....}


    char a;

    float b;

    if you call

    Send_SPI(a); all is ok

    when you call

    Send_SPI(b); you get stack error, is similar to this?

     this case stack error stand for (segmentation fault) or stack corruption  writing a larger var than allocated on stack before call...