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.

TMS320F28P659DK-Q1: CLA Math libraries in BOOT ROM

Part Number: TMS320F28P659DK-Q1
Other Parts Discussed in Thread: C2000WARE, TEST2

Hello support,

I cannot understand whether the 28P65 has CLA math tables in BOOT ROM or not.

In the c2000ware 5_00_00_00, there is a folder named "C2000Ware_5_00_00_00\libraries\math\CLAmath\c28\lib" that contains the libraries "datarom".

But if I look at the datasheet, I see that the ROM symbol table seems to not contain CLA tables.

Question:

on 28P65 is it possible to use CLA Math tables in ROM,  and spare RAM space ?

  • Davide, I am checking on this with the BootROM expert.

    Thanks,

    Sira

  • Davide, what I heard is that BootROM does contain CLAMath tables and the documentation needs to be updated to reflect this.

    Thanks,

    Sira

  • Davide, when I look at the F28P65x datasheet, I do see CLAData ROM mentioned. See 8.3.2.

    https://www.ti.com/lit/ds/symlink/tms320f28p659dk-q1.pdf?ts=1690381110606&ref_url=https%253A%252F%252Fwww.google.com%252F

    I don't know which document the pictures you sent correspond to.

    Thanks,

    Sira

  • Hello Sira,

    "I don't know which document the pictures you sent correspond to." --> to the datasheet (SPRSP69 – JULY 2023)

    "when I look at the F28P65x datasheet, I do see CLAData ROM mentioned. See 8.3.2." --> Thanks, I have found this paragraph

    I tried to integrate the CLA math libraries "cla2_math_library_datarom_fpu32_eabi.lib" and "f28P65xCPU1_CLADATAROM_Symbols_fpu32.lib" as explained into the "CLA Math Library User Guide" but the outcome is that the tables are allocated at 32bit addresses, like 0x0101xxxx (consistent with par. 8.3.2)

    This generates a warning because the CLA works on 16bit addresses only.

    How can I fix this ?

    Do I have to make a copy in RAM ?

    CLA Math User Guide states:

    "The lookup tables for the CLA Math library may be present in the CLA Data ROM of the target
    device (check target device TRM to determine which tables have been placed in ROM), and can
    be used by the math routines; this will save the user from having to load the tables to Flash (and
    subsequently copy them over to RAM at runtime)."

  • The ROM is mapped to different addresses on the C28x and on the CLA - on the CLA side it should be accessible.

    See the different Load (32b) and Run (16b) addresses. The runtime addresses are what will be used.

  • Hello,

    I made a couple of tests.

    Test 1. Followed the "CLA Math Library User's Guide" when states:

    "In the event that the symbols library for a given device (known to have the lookup tables in
    CLA data ROM) is not present, it is possible to add the required symbols, and their address,
    directly to the linker command file."

    I therefore have included in the linker only the "cla2_math_library_datarom_fpu32_eabi.lib", and I have added the required symbols directly into the linker file.

    This seems to work: no linker warnings and the map file reports the tables at the proper address.

    Test 2.

    I have linked also the "f28P65xCPU1_CLADATAROM_Symbols_fpu32.lib"

    I have deleted all CLA symbols from linker file.

    I have also added following section in the linker

        CLA1mathTables  : LOAD = BOOTROM_CLAMATH_TABLES,   // CLAMATH
                         RUN = RAMD1_ROMCLAMath,
                         RUN_START(CLA1mathTablesRunStart),
                         LOAD_START(CLA1mathTablesLoadStart),
                         LOAD_SIZE(CLA1mathTablesLoadSize),
                         ALIGN(4)

    where

    BOOTROM_CLAMATH_TABLES   : origin = 0x01011070, length = 0x000F90

    RAMD1_ROMCLAMath    : origin = 0x00F870, length = 0x000790

    But the result is that for each symbol in the library used by my application I have this warning

    #17003-D  relocation from function "Cla1Task1" to symbol "CLAsincosTable_Coef1" overflowed; the 25-bit relocated address 0x1011e56 is too large to encode in the 16-bit unsigned field (type = 'R_CLA_ABS16' (16))

    Could you understand what is wrong on my side ?

  • Davide, 

    For Test2, can you send me your linker cmd file?

    For comparison, please send your linker cmd file for Test1 as well.

    Thanks,

    Sira

  • Hello,

    this is a screenshot of the map file for Test1

    This is for Test2

    I tried to upload also the linker files, but I'm not sure the uoloading was successful. Let me know

  • Here linker files should be available to you

    Test1_lnk.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    //#############################################################################
    //
    // FILE: f28p65x_cla_c_lnk.cmd
    //
    // TITLE: Linker Command File for CLA Math library examples that run
    // on the f28003x platform
    //
    // This file includes all RAM and FLASH blocks present on the
    // f28003x and depending on the active build configuration
    // (RAM or FLASH) the appropriate sections will either be loaded
    // into RAM or FLASH blocks
    //
    //###########################################################################
    //
    //
    // $Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
    // http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Test2_lnk.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    //#############################################################################
    //
    // FILE: f28p65x_cla_c_lnk.cmd
    //
    // TITLE: Linker Command File for CLA Math library examples that run
    // on the f28003x platform
    //
    // This file includes all RAM and FLASH blocks present on the
    // f28003x and depending on the active build configuration
    // (RAM or FLASH) the appropriate sections will either be loaded
    // into RAM or FLASH blocks
    //
    //###########################################################################
    //
    //
    // $Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
    // http://www.ti.com/ ALL RIGHTS RESERVED $
    //###########################################################################
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Davide,

    I looked at this and it's not clear to me what's causing the issue, it seems like what you have is correct. I also compared it against an existing example in the CLAMath library C2000Ware v5.00 -> cla_cfft_256 -> F2837x_RAM_DATAROM_EABI build config. You can refer to that as well.

    The 2 approaches conceptually are fairly straightforward - either you explicitly tell the linker that these are the symbols and their locations (Test1), OR you provide it a Symbols library that contains the necessary information.

    Your earlier message is not clear to me though - these assignments don't seem to be right/consistent, and looks like you changed it in Test2 lnk.cmd.

    BOOTROM_CLAMATH_TABLES   : origin = 0x01011070, length = 0x000F90

    RAMD1_ROMCLAMath    : origin = 0x00F870, length = 0x000790

    Also, which version of the CLAMath library are you using? The user guide also states this:

    "If the user does not use the datarom variant of the library but the standard build instead, it is then essential that the symbols library be placed higher in order than the CLA Math library and the –priority option box be checked"

    The cla_cfft_256 example uses the _datarom_eabi library for that build config.

    Thanks,

    Sira

  • Hello Sira,

    I'm using the following 2 libraries:

    "cla2_math_library_datarom_fpu32_eabi.lib" and "f28P65xCPU1_CLADATAROM_Symbols_fpu32.lib"

    I have tried the cla_cfft_256 example and I did not get any compiling/linking issues.

    So far, for my project, I could not find a project configuration that does not return warnings when using CLA libraries.

  • Davide,

    One thing that isn't clear to me from your linker cmd file is the use of both RAM_LS8LS9CLAPROG and RAMLS8LS9CLALOAD. Could you explain what you're doing there?

    The error you're getting is for Cla1Task1 which should be part of Cla1Prog. For some reason, the compiler is trying to "relocate" that location to a CLA Data ROM location! I'll check with the compiler team if they have any clues.

    #17003-D  relocation from function "Cla1Task1" to symbol "CLAsincosTable_Coef1" overflowed; the 25-bit relocated address 0x1011e56 is too large to encode in the 16-bit unsigned field (type = 'R_CLA_ABS16' (16))

    Thanks,

    Sira

  • Hello,

    with RAMLS8LS9CLALOAD I'm mapping CLA program on LS8/LS9 as indicated by Datasheet.

    CPU loads CLA program starting from 0x22000, and CLA executes it from 0x4000.

    This configuration seems to work because the in map file Cla1ProgFlashLoadStart is in Flash, it is copied at ClaProgRamLoadStart (0x22000) by my project through this statement

    memcpy((uint32_t *)&ClaProgRamLoadStart, (uint32_t *)&Cla1ProgFlashLoadStart, (uint32_t)&Cla1ProgLoadSize);

    and CLATasks are mapped from 0x4000 to 0x6380.

  • Thanks Davide, understood.

    A couple of references that may help you. Looks like other users have run into similar issues.

    1. e2e issues dealing with the 17003 error

    https://e2e.ti.com/search?q=17003&category=forum&group=97

    2. Specifically, the link below which was marked as Resolved.

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/942616/compiler-tms320f28388d-using-cla-with-rom-symbols-gives-warning-17003-d?tisearch=e2e-sitesearch&keymatch=17003#

    - in this case, there was an issue with the symbols library itself where the RevA version had a bug and was using the C28x address for the BootROM, not the CLA address. The user moved to the Rev0 symbols library and the issue was resolved. This was on F28388d.

    - I suspect something similar may be going on here, since your Test1, where you didn't use the symbols library and directly specified the symbols and their addresses in the linker command file worked, whereas Test 2 where you used the symbols library and ended up with this warning. Unfortunately, unlike the F2838x case, there aren't two Revisions of the CLADataROM symbols library present here to try.

    I can check with our BootROM team to check if there's indeed a bug. In the meantime, your Test1 approach is probably the way to move forward.

    Thanks,

    Sira

  • Hello Sira,

    thank you for the feedback.

    This is not a big issue for our project today, but please check with your team.

  • I have reached out to the respective SMEs, I will provide any follow up info when available. For now, I will close this.