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.

Exception when printing a lot of floats

Other Parts Discussed in Thread: SYSBIOS

Hello everyone,

We have been working on a project with a C6678 lately and I ran in some kind of trouble with printing floats.
To print them, we use platform_write. Sometimes, when we print a lot of floats (100+), the DSP throws an exception. The printed floats are all measured values.

Does anyone know how to solve this problem?

Thanks in advance,
Lars Jansen

  • Hi Lars,
    What is exception you are getting? Please share the exception log. Thank you.
  • This show up in my log:
    [C66xx_0] 8=0x0 A9=0x8640ac
    A10=0x0 A11=0x0
    A12=0x80017c A13=0xa
    A14=0xa A15=0x0
    A16=0x8003de A17=0x20
    A18=0x8001e0 A19=0x1f0
    A20=0x0 A21=0x0
    A22=0xff1c4afb A23=0x0
    A24=0x100c0246 A25=0xcdb1b3fc
    A26=0xa06a41d0 A27=0x0
    A28=0x400 A29=0x0
    A30=0x400 A31=0x200
    B0=0x1 B1=[C66xx_0] 0x860f78
    B2=0x0 B3=0x7fffd0
    B4=0x864190 B5=0x864188
    B6=0xc0275d2 B7=0x0
    B8=0x0 B9=0x0
    B10=0x800130 B11=0x58
    B12=0x8003dd B13=0xc02298c
    B14=0x865830 B15=0x800028
    B16=0x30 B17=0x80040c
    B18=0x2ec95a0c B19=0x3fefead6
    B20=0xf22220f6 B21=0x4c19dcc0
    B22=0xd B23=0[C66xx_0] x0
    B24=0x3f2790b1 B25=0xa7d609df
    B26=0xc1f549c0 B27=0xeacdb472
    B28=0x0 B29=0x0
    B30=0x0 B31=0xffffffff
    NTSR=0x1020e
    ITSR=0xd
    IRP=0xc0275d2
    SSR=0x0
    AMR=0x0
    RILC=0x0
    ILC=0x0
    Exception at 0x7fffd0
    EFR=0x2 NRP=0x7fffd0
    Internal exception: IERR=0x1
    Instruction f[C66xx_0] etch exception
    ti.sysbios.family.c64p.Exception: line 248: E_exceptionMin: pc = 0x007fffd0, sp = 0x00800028.
    To see more exception detail, use ROV or set 'ti.sysbios.family.c64p.Exception.ena[C66xx_0] blePrint = true;'
    xdc.runtime.Error.raise: terminating execution
  • Hi Lars,

    please try increasing stack sizes. In case of an stack overflow you'd return to a wrong address and then fetch an undefined op-code ...

    Kind regards,
    one and zero
  • Hi "One and Zero",

    We tried, but it didn't work. Our stack size was (and still is): 65535 Bytes and our Heap memory size was (and still is): 327679 Bytes. So I think that's quite enough.

    Kind regards,
    Lars Jansen
  • Hi Lars,

    your  NRP is 0x7fffd0. That means you were trying to execute code from reserved memory. So at some point a branch must have gone wrong.

    Of course this could be caused by some other kind of memory corruption, but still I'd recommend to have another look at stacks ...

    Here are some good tips:

    Kind regards,

    one and zero

  • So, debugging seems to have worked. We increased the stack size in a different way.

    We were trying to increase "Program.stack" in the cfg file but it turned out that we needed to set "Task.defaultStackSize" and that we also had to set "Memory.defaultHeapSize". 

    Our way to find this:

    Task_Stat statbuf; /* declare buffer */
    Task_stat(Task_self(), &statbuf); /* call func to get status */
    platform_write("%d/%d\n", statbuf.used, statbuf.stackSize);

    This code prints the used and the available stack space on the screen.

    Don't forget to include: #include "ti/sysbios/knl/Task.h"

    Thanks for all your help!

  • Hi Lars,

    thanks for sharing your re-solution.

    Kind regards,
    one and zero