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.

TMS320F2800132: Problems debugging from FLASH(RELEASE) and RAM

Part Number: TMS320F2800132
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Good afternoon colleagues,

I am struggling with my DSP TMS320F2800132 that is part of a PCB design. This uC basically obtains ADC conversions from SPI peripheral from an external ADC and it starts to make some calculations relating to that measurement. 

In this calculations I make divisions, multiplications and a natural logarithm. When I tested it debugging in RAM I didn't have any problem, the calculations where perfect and all went as expected. Then, when I tested it in RELEASE (FLASH) and I debug from FLASH, is where the problems happened. Some calculations that where impossible to be infinite are calculated as infinite and so on. What I would like to know I what is going on. I have reviewed the Linker, the compiler, etc... in the properties of the project and is the same in Debug and Release. I don't know if it helps but these calculations are float calculations and using math.h, but I repeat, in RAM debugging are good but in FLASH debugging are not.

Thank you in advance, have a nice day.

Pedro

  • Hi,

    Is there some FLASH configuration necessary for your code? Can you provide a map file for the project?

    Thanks and regards,

    Charles

  • Good morning Charles,

    I attach the map files for both flash (release) and ram configuration. I also attach the linker file for both configurations. I would be very pleased if you could find something in them. The problem we are seeing is only related to the mathematical calculations.

    map_ram.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ******************************************************************************
    TMS320C2000 Linker PC v22.6.1
    ******************************************************************************
    >> Linked Fri Feb 28 08:46:32 2025
    OUTPUT FILE NAME: <tarjeta_temp_igbts.out>
    ENTRY POINT SYMBOL: "_c_int00" address: 00009de5
    MEMORY CONFIGURATION
    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    BEGIN 00000000 00000002 00000002 00000000 RWIX
    BOOT_RSVD 00000002 00000126 00000000 00000126 RWIX
    RAMM0 00000128 000002d8 0000002e 000002aa RWIX
    RAMM1 00000400 000003f8 00000200 000001f8 RWIX
    RAMLS0 00008000 00002000 00001f85 0000007b RWIX
    RAMLS1 0000a000 00001ff8 00000000 00001ff8 RWIX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
     
    map_flash.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    ******************************************************************************
    TMS320C2000 Linker PC v22.6.1
    ******************************************************************************
    >> Linked Thu Feb 27 15:22:03 2025
    OUTPUT FILE NAME: <tarjeta_temp_igbts.out>
    ENTRY POINT SYMBOL: "_c_int00" address: 000835ec
    MEMORY CONFIGURATION
    name origin length used unused attr fill
    ---------------------- -------- --------- -------- -------- ---- --------
    BOOT_RSVD 00000002 00000126 00000000 00000126 RWIX
    RAMM0 00000128 000002d8 00000000 000002d8 RWIX
    RAMM1 00000400 000003f8 00000200 000001f8 RWIX
    RAMLS0 00008000 00002000 0000023c 00001dc4 RWIX
    RAMLS1 0000a000 00001ff8 00000000 00001ff8 RWIX
    BEGIN 00080000 00000002 00000002 00000000 RWIX
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    link_cmd_flash.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    MEMORY
    {
    BEGIN : origin = 0x00080000, length = 0x00000002
    BOOT_RSVD : origin = 0x00000002, length = 0x00000126
    RAMM0 : origin = 0x00000128, length = 0x000002D8
    RAMM1 : origin = 0x00000400, length = 0x000003F8
    // RAMM1_RSVD : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    RAMLS0 : origin = 0x00008000, length = 0x00002000
    RAMLS1 : origin = 0x0000A000, length = 0x00001FF8
    // RAMLS1_RSVD : origin = 0x0000BFF8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    RESET : origin = 0x003FFFC0, length = 0x00000002
    /* Flash sectors */
    FLASH_BANK0_SEC_0_7 : origin = 0x080002, length = 0x1FFE /* on-chip Flash */
    FLASH_BANK0_SEC_8_15 : origin = 0x082000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_16_23 : origin = 0x084000, length = 0x2000 /* on-chip Flash */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    link_cmd_ram.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    MEMORY
    {
    BEGIN : origin = 0x00000000, length = 0x00000002
    BOOT_RSVD : origin = 0x00000002, length = 0x00000126
    RAMM0 : origin = 0x00000128, length = 0x000002D8
    RAMM1 : origin = 0x00000400, length = 0x000003F8
    // RAMM1_RSVD : origin = 0x000007F8, length = 0x00000008 /* Reserve and do not use for code as per the errata advisory "Memory: Prefetching Beyond Valid Memory" */
    RAMLS0 : origin = 0x00008000, length = 0x00002000
    RAMLS1 : origin = 0x0000A000, length = 0x00001FF8
    // RAMLS1_RSVD : origin = 0x0000BFF8, length = 0x00000008
    RESET : origin = 0x003FFFC0, length = 0x00000002
    /* Flash sectors */
    FLASH_BANK0_SEC_0_7 : origin = 0x080002, length = 0x1FFE /* on-chip Flash */
    FLASH_BANK0_SEC_8_15 : origin = 0x082000, length = 0x2000 /* on-chip Flash */
    FLASH_BANK0_SEC_16_23 : origin = 0x084000, length = 0x2000 /* on-chip Flash */
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Thank you in advance,

    Pedro

  • Hi,

    Will need some more time for analysis. Can you also share the list of linker flags you are using for the project settings?

    Thanks,

    Charles

  • Hi Charles,

    For sure, I send it below:

    -v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 -Ooff --advice:performance=all --define=_FLASH --diag_warning=225 --diag_wrap=off --display_error_number --abi=eabi -z -m"tarjeta_temp_igbts.map" --stack_size=0x200 --warn_sections -i"C:/ti/c2000/C2000Ware_5_02_00_00" -i"C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/lib" -i"C:/ti/ccs1250/ccs/tools/compiler/ti-cgt-c2000_22.6.1.LTS/include" --reread_libs --diag_wrap=off --display_error_number --xml_link_info="tarjeta_temp_igbts_linkInfo.xml" --rom_model

    Thank you very much for your time, I will wait for your answer.

    BR,

    Pedro

  • Hi Pedro,

    If you copy your math functions from FLASH to RAM before they execute, do you still have this problem? 

    Thanks,

    Ben Collier

  • Hi Benjamín,

    I don't know what are you referring. Basically what I do is taking ADC conversions and basics float multiplications, divisions, substractions, additions and one natural logarith. First, I tested It in RAM and It worked perfectly, then I tried on Release (FLASH) and It didn't worked and some operations went to infinite (example substraction 293.124-273.15 goes to infinite). I honestly don't know whats going on.

    Any help id well received. Thank you in advancd.

    BR,

    Pedro

  • Hi Peter,

    Apologies for the delay as I was out of office. I think Ben is saying to use something like the MEMCPY function (described in the Device_Init routine) to copy these math functions from FLASH to RAM before execution.

    Thanks and regards,

    Charles