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.

CCS: memory address changes when the scope moves inside the function

Other Parts Discussed in Thread: TMS320F28335, SYSBIOS

Tool/software: Code Composer Studio

Dear all, 

             I am reading an array (soundtrack_pRowStkd_fa[ 32000]) from from external RAM in TI28335 and calculating max value by using a pointer(extRamDataIn).

float  *extRamDataIn=soundtrack_pRowStkd_fa;

my main function is bool compression_Data_bol(const float *input_fa) where i execute getMaxAbsRowData(const float *var1, float *maxAbsRowData)

The function "static void getMaxAbsRowData(const float *var1, float *maxAbsRowData)" implementation is as follows

The thing to notice here is that - 

when debuggers hits the breakpoint(1st picture), the adress passes to the function is 0x00201200.(extRamDataIn)

but when I steo into the function(2nd picture),adress passes to the function changes to 0x00001200(var1)

why this happens. ?

Looks like this 0x00201200.(extRamDataIn) truncated to 0x00001200(var1). But why..i do not understand

in theory float pointer (2bytes or 32bits in c28x)should be able to hold that addess.

  • There may be an error in the CCS display.  When you run the code through without stopping, does it compute the expected result into the expected addresses?  If the answer is yes, then this is a problem with the CCS display.  If the wrong result is computed, or it is written to the wrong addresses, then for the source file compression.c, please follow the directions in the article How to Submit a Compiler Test Case.

    Thanks and regards,

    -George

  • Thank You George. My answer is No. Here are the things you asked for.

    DSP: TI28335

    CCS Version: 8.3.0.00009 

    Compiler Version: TI v6.4.11

    OPtimization level: 2(Global Optimization)

    Speed Vs Size Trade-Off: 3

    compression.pp.txt

    Build String

    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 8 WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.obj -O 


    Building file: "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c"
    Invoking: C2000 Compiler
    "C:/ti/ti-cgt-c2000_6.4.11/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -O2 --opt_for_speed=3 --

    to varifay your point of ccs, I changed the pointer (extRamDataIn) to point to a different address to 0x0020C800.

    And 0x0020C800(extRamDataIn) truncated to 0x0000C800(var1).  Then it reads the array from wrong location.

  • I don't see anything wrong.  However, I may not be using the same build options.  The options you show ...

    Sourav Sahoo said:
    "C:/ti/ti-cgt-c2000_6.4.11/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -O2 --opt_for_speed=3 --

    ... are incomplete.  Please copy and paste the full invocation of cl2000 on the file compression.c from the Console view in CCS.  Do not use a screen shot.  Be sure every compiler option is part of it.

    Thanks and regards,

    -George


  • **** Build of configuration DebugFlash for project ITK5_DSP_MEM_APPL ****

    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 8 WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.obj -O

    Building file: "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c"
    Invoking: C2000 Compiler
    "C:/ti/ti-cgt-c2000_6.4.11/bin/cl2000" -v28 -ml -mt --float_support=fpu32 -O2 --opt_for_speed=3 --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/stdtyp" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/osal2/targets/SYSBIOS_6_45" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/osal2" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/syswdog" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/measure" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/assertion" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/sysinfo" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/strformat" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/DebugFlash/configPkg/package/cfg" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/generated" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/generated/dbtool_autogen" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/generated/agCode" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/diagnostics" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/parameter" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/periph" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/rtos" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/rtos/SYSBIOS" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/storage" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/storage/FDisk" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/storage/NvMemApi" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/storage/Fifo" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/storage/MemDisk" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/time" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/trace" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/exception" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/hrestime" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/periph" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/utilities" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/TI2833x/source/dma" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/common" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/watchdog" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/source/gencan" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/TI2833x/source/TIperiph" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/TI2833x/source/periph" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/TI2833x/source/storage/NvMemApi" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/communication/eve" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/dastut" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/scheduler" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/cdm" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/eds" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Functions/version" --include_path="C:/tfs_workspaces/ITK5_DSP_MEM_APPL/Common/Targets/TI28x/TI2833x/source/storage" --advice:performance=all -g --c99 --preproc_with_comment --preproc_with_compile --define=BUILD_CFG_NAME="\"DebugFlash\"" --define=CDM_MODULARIZATION --define="FW_PART_NUMBER=0x39714" --define="FW_VERSION=001" --define="FW_VERSION_TYPE=version_TYPE_TC" --super_quiet --diag_warning=225 --display_error_number --printf_support=full --obj_directory="WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source" --cmd_file="configPkg/compiler.opt" "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c"
    "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c", line 291: warning #179-D: variable "clear_u16s" was declared but never referenced
    "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c", line 292: warning #179-D: variable "windows_u16s" was declared but never referenced
    "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c", line 267: warning #179-D: function "getModelInputData" was declared but never referenced
    "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c", line 26: warning #179-D: variable "fitBit_u16sca" was declared but never referenced
    Finished building: "../WD_PL48/Acoustic_ITK5/MN10502321_ITK5_MEMCOM/U43_TMS320F28335_DSP_MEM/N39714FW_APPLIC/source/compression.c"

    **** Build Finished ****

    my Array float soundtrack_pRowStkd_fa[32000] is in external RAM. I am reading the array by pointer extRamDataIn.

    Some how, I am not able to read this array every time starting from the bigining.

  • Thank you for the build options.

    I still don't see any problems in the compiler generated assembly code.

    But I did spot a likely error in your source code.  This line ...

    if(abs(*var1)> maxAbsRowData[i])
    

    ... should probably call fabs instead of abs.  

    Please let me know if this change resolves the problem.

    Thanks and regards,

    -George

  • No. I am programming with debugger. Also having external RAM. That may be causing some problem. I am not sure

  • Did you change that function call from abs to fabs?  If so, what happened?

    Thanks and regards,

    -George