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.

TMDSEVM6678: Unable to run program when memory is loaded with external bin file

Part Number: TMDSEVM6678


Hey,

I am trying to perform FFT on a test data that is externally loaded from a binary file (in 32-bit float format) to the input buffer address. I am using TMDSEVM6678LE EVM with CCSv8. This is my main function:

    gen_twiddle_fft_sp(w_32x32, N);
    /* Call FFT routine */
    DSPF_sp_fftSPxSP_r2c(N, x_ref, w_32x32, y_32x32, brev, 4, 0, N);
    /* Call the test code to seperate the real and imaginary data */
    seperateRealImg ();

I want to load data in the x_ref[] buffer of length 1024. When I go to memory browser to load data at specific address, as I load from bin file the data comes at the address but then error appears which shows:

"Break at address "0x810000" with no debug information available, or outside of program code."

I am attaching a screenshot of the CCS debug window just after data is loaded.

Note that the data loaded at the address is correct. Only due to the error shown below besides the memory view.

Regards,

  • Hi,

    Which Processor SDK RTOS are you using?

    Best Regards,
    Yordan
  • Hi,

    I am using Processor SDK 5.2.

    Regards

  • Hi,

    The error seems related to the way CCS is loading the code to memory. If you are using COFF or ELF (and maybe hex), CCS will position the Program Counter to the beginning of the code loaded. However, if you are loading your code in the other formats (Bin, TI Data, TI Raw Data), then the Program Counter will be left untouched.

    Does that sound like something that could be happening in your case?

    Regards,
    Rafael
  • Hi,

    Though I am unable to catch your though completely, I will try to elaborate what I have done in detailed manner. The output format in which code is loaded is "eabi(ELF)" and endianness is "little". First I ran the "FFT_SP_Example_66_LE_ELF" example project provided in the SDK for a test sine wave. Now, I had some data of a pulse in excel sheet, by which I generated a ".bin" file having 1024 float values in MATLAB. Below is the modified code of the example file to take input externally from a bin file.

    #include <stdint.h>
    #include <math.h>
    #include <ti/dsplib/dsplib.h>
    
    /* Global definitions */
    /* Number of samples for which FFT needs to be calculated */
    #define N 1024
    /* Number of unique sine waves in input data */
    //#define NUM_SIN_WAVES 4
    
    #pragma DATA_ALIGN(x_sp, 8);
    float   x_sp [2*N];
    #pragma DATA_ALIGN(y_sp, 8);
    float   y_sp [2*N];
    #pragma DATA_ALIGN(w_sp, 8);
    float   w_sp [2*N];
    
    unsigned char brev[64] = {
        0x0, 0x20, 0x10, 0x30, 0x8, 0x28, 0x18, 0x38,
        0x4, 0x24, 0x14, 0x34, 0xc, 0x2c, 0x1c, 0x3c,
        0x2, 0x22, 0x12, 0x32, 0xa, 0x2a, 0x1a, 0x3a,
        0x6, 0x26, 0x16, 0x36, 0xe, 0x2e, 0x1e, 0x3e,
        0x1, 0x21, 0x11, 0x31, 0x9, 0x29, 0x19, 0x39,
        0x5, 0x25, 0x15, 0x35, 0xd, 0x2d, 0x1d, 0x3d,
        0x3, 0x23, 0x13, 0x33, 0xb, 0x2b, 0x1b, 0x3b,
        0x7, 0x27, 0x17, 0x37, 0xf, 0x2f, 0x1f, 0x3f
    };
    /*
        The seperateRealImg function seperates the real and imaginary data
        of the FFT output. This is needed so that the data can be plotted
        using the CCS graph feature
    */
    
    float y_real_sp [N];
    float y_imag_sp [N];
    float x_real_sp [N];
    float x_imag_sp [N];
    
    seperateRealImg () {
        int i, j;
    
        for (i = 0, j = 0; j < N; i+=2, j++) {
            y_real_sp[j] = y_sp[i];
            y_imag_sp[j] = y_sp[i + 1];
    //        x_real_sp[j] = x_sp[i];
    //        x_imag_sp[j] = x_sp[i + 1];
    }
    }
    /*
        The main function that implements the example functionality.
        This example demonstrates the usage of the various FFT kernels provided
        with the C6x DSPLIB. The example shows:
            - Twiddle factor generation for the various kernels
            - Needed scaling to get correct output
            - Demonstrates usage of FFT APIs
    */
    
    /* Function for generating Specialized sequence of twiddle factors */
        void gen_twiddle_fft_sp (float *w, int n)
        {
            int i, j, k;
            float x_t, y_t, theta1, theta2, theta3;
            const float PI = 3.141592654;
    
            for (j = 1, k = 0; j <= n >> 2; j = j << 2)
            {
                for (i = 0; i < n >> 2; i += j)
                {
                    theta1 = 2 * PI * i / n;
                    x_t = cos (theta1);
                    y_t = sin (theta1);
                    w[k] = (float) x_t;
                    w[k + 1] = (float) y_t;
    
                    theta2 = 4 * PI * i / n;
                    x_t = cos (theta2);
                    y_t = sin (theta2);
                    w[k + 2] = (float) x_t;
                    w[k + 3] = (float) y_t;
    
                    theta3 = 6 * PI * i / n;
                    x_t = cos (theta3);
                    y_t = sin (theta3);
                    w[k + 4] = (float) x_t;
                    w[k + 5] = (float) y_t;
                    k += 6;
                }
            }
        }
    void main () {
        /* Generate the input data */
    //    generateInput (NUM_SIN_WAVES);
        int i, j;
    //    /* Genarate twiddle factors */
        gen_twiddle_fft_sp(w_sp, N);
    
        for (i = 0, j = 0; j < N; i+=2, j++) {
             x_sp[i] =  x_real_sp[j];
             x_sp[i + 1] = 0;
        }
        /* Call FFT routine */
        DSPF_sp_fftSPxSP(N, x_sp, w_sp, y_sp, brev, 4, 0, N);
    
        /* Call the test code to seperate the real and imaginary data */
        seperateRealImg ();
    }
    
    
    
    
    

    As the input is complex for this FFT function, in the main file, I have initialised the values on odd indices as 0 and even indices as some buffer in which I will load the values from ".bin" file. I also tried putting a breakpoint in the main function and then going to the breakpoint window. Then loading the .bin file at the required address in the breakpoint properties dialoag box. But by this, I was also not able to load data in memory. I am using compiler version TI v8.2.5. I am really stuck here. I can't figure out where the problem is.

    Thanks

    Harshul

  • Harshul,

    Please apologize for the delay and thanks for the additional details. I think we are talking about the same thing, although the outcome seems different as to what I would expect from a simple .bin file load.

    Given I don't see a place in your code that actually performs a file writing operation, I assume you are loading the .bin file via the Memory Browser (or Breakpoint) to the address 0x810000. In this case, can you guarantee the arrays x_sp, y_sp and w_sp are contiguous and actually start at that address? My concern is that the data is overwriting code and (maybe) causing some issues.

    That said, it just occurred to me to confirm one thing: right after you load data, what do you see in the Disassembly view? Do you see the original opcodes/ instructions of your code or corrupt information? You can also hit the small "home" button in this view to display the information at the PC location.

    If the information is correct, the message can be safely ignored as the code should run normally. Otherwise, would you mind attach the generated .bin file to this thread so I could double check its information? Perhaps it may help give me further ideas.

    Hope this helps,
    Rafael
  • Thanks Rafael for the reply.

    Yes I am loading the .bin file via the memory browser at the respective address. I verified that the arrays x_sp, y_sp and w_sp are contiguous and they start at that address. In the mempry browser I can see that 1024 data points from the bin file are shown correctly from 0x0080e000 to 0x0080effc. But in the disassembly, I cant see anything below address 0x0080e40c. I dont understand why this is happening. I am attaching my complete project zip compilable in CCS8 having main file and the .bin file.

    Test_FFT_LE.zip

    Thanks

    Harshul

  • Harshul,

    Thanks for sending the code and data. I was able to reproduce this issue, which to me is a surprise given the binary method (at least how I remember it) was not supposed to reset the Program Counter and clear the Debug Symbols.

    I am still checking if this was supposed to happen or is a bug. In any case, despite the error message, the memory load process does not erase the code running but instead only remove the Debug Symbols (thus giving the impression the previously loaded code simply vanished). 

    You can check the steps in the short clip below to recover the debug to its previous state after the binary load. 

    A more suitable workaround is to simply load the .bin file as "TI Raw Data", which does not remove anything. 

    Hope this helps,

    Rafael

  • Harshul,

    My memory failed; it was confirmed the Binary method always sets the PC to the initial memory address. In this case, use the mode I showed in my second video above.

    However, it was pointed out by the developer that the Debug Symbols should have never been removed. To that effect, I filed the bug report number CCBT-2409. You can check its status in the link SDOWP in my signature below.

    I apologize for the inconvenience,
    Rafael