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.

LAUNCHXL-F28379D: Adding PWM Module. Problem with linker command file

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I saw a problem using Sysconfig for adding PWM. It is weird, since it appears on one of my project. But on an other one, which is similar, everything is fine.

I achieved to throw away the content of the application, and only keep the structure of the project. You can find an archive in this post.

Let me explain my problem:

My project has 2 configurations: programm in RAM and programm in FLASH

Let's set active the FLASH configuration.

I use several peripherals in the project, which initializations are managed by SysConfig. For instance I use one PWM Module:

Let's add an other one:

And build the project:

Everything is OK. But if I set the RAM configuration as Active, the building cannot be done:

The message is:

#10099-D program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment/blocking fails for section ".text" size 0x1c00 page 0.  Available memory ranges:

I refers to the command linker file:

It is important for me to understand, because I don t want to have any problem in the future in the real application.

Can somebody help me ?

Thank you

T.Archive4TI.zip

  • Hi,

    The error indicates that the code size has increased and it no longer can fit in the allocated memory region.  You will have to update the linker command file to add more RAM regions in line 80

    Best Regards

    Siddharth

  • Hello,

    Your answer seems accurate. But I am not familiar with the linker command file (I use to work on mIcrochip materials, and it dealed not with such files)

    Can you explain to me how to increase the allocated RAM ?

    Conerning the attached project: it contains nothing. It is normal that the allocated RAM is not large enough ?

    Thank you for your help.

    Vincent 

  • Vincent, 

    If you look at the error message , it mentions that the .text needs  0x1c00 .  

    To increase the size for allocation in the linker command , you can add one more RAM region as shown below.

    .text : >> RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4 | RAMM0, PAGE = 0

    Also, pls check if you are using any code optimization options of the compiler in your project settings. Enabling code optimization might help in reducing the code size and you need not update the linker command file.

    Please refer the following link to learn more about linker command files 

    https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html

    Best Regards

    Siddharth

  • First I want to thank you for the time you spent for this question.

    Shall I ask you a final question, to be sure to not misunderstand ?

    when disassembling the code transfered nto the FLASH memory, I can see that it begins at 0x8 0000 and ends at 0x8 3ccb. So the lengh of the code is 15564words (15.2Kibi words). It exceed th size of the LSRAM (10Kibi words) and the D0RAM (2Kibi words) = 12Kibi words.

    So the .text section cannot defined by " .text            : >> RAMD0 |  RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4" cannot contain the programm.

    But why does the error message mentions "exceed 0x1c00" (7 Kibi words)?

    If I take a look to the code in FLASH, I can see that the code starts at 0x82000 (there is only one word at 0x80000), as specified in the command linker file.

    So, the size of the code is actually 0x1ccb. It is more than 0x1c00, but what 0x1c00 stands for ?

    Why do you inscrease the size of the RAM using RAM M0, instead of GSRAM for instance ?

    Speak you soon

  • Vincent ,

    There are two build configurations - one for RAM and one for Flash.  If you use the RAM configuration , then the code gets loaded to RAM and then executes from RAM itself. If you use the Flash memory, then it gets loaded to Flash and runs from Flash, 

    Would suggest you to swtich the build to Flash configuration and then try to build the project since RAM is not sufficient.

    You can do this by right clicking on the project and then selecting the "Build Configurations" . See snaphot below

    Best Regards

    Siddharth

  • hello. that's what I did to see the size of the code.But that's the reason why I asked this question: why the RAM is not enough, since its size is not 7Kibi words but 12Kibi

  • Hi, 

    In this case, there seems to be a large section which cannot be split across the RAM regions 

    You can combine the ram regions in the linker command file and then compile it again. Pls use the attached linker command file.

    The RAM LS sections 0 to 3 are combined and then this is used to allocate .text section 

    RAMLS0_3 : origin = 0x008000, length = 0x002000

       .text            : >> RAMD0 |  RAMLS0_3,   PAGE = 0

    /cfs-file/__key/communityserver-discussions-components-files/171/2837xD_5F00_RAM_5F00_lnk_5F00_cpu1.cmd

    Best Regards

    Siddharth

  • I knew that, but the current union is

     : >> RAMD0 |  RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4

    It allocates 12Kibi words

    I still don't know why the message deals with 7Kibi, sorry.

    And above all, what is the other RAM that I can combine to this union ? how to combine it if the added RAM is in another page ? (Ex. LS5)

    Thank you

  • Hi, 

    The .text section is 0x1C00 in size .  Each of the RAM sections are of size 0x800. Hence you will have to cobmine the ram regions in the linker command file and then recompile it.

    You can check the size in the linker memory map file (FromPWM.map) that is generated 

    .text.1    0    00008000    00001400  

    .text.2    0    0000b000    00000800  

    Best Regards

    Siddharth

  • Sorry, I feel like an idiot or something like that.

    I understood that I have to combine the RAM regions. But my question is : how do I do ?

    let's tkake an other example:

    The regions combined for .text are DO and LSRAM0..4 (2kibi each)

    But, on a simple example generated by sysconfig; the first object compiled is 2092 words sized. So it cannot fit into a 2Kibi sized RAM.

    If you take a look of it is compiled, you ll see that this is the file generated by SysConfig itself.

    On that example, how do I do to use RAM to hold the programm ? Nothing in PAGE 1 cannot contain this object.

    Thanks a lot for your help

  • edit: the only way I found is to declare a large region in PAGE 0

    And then combine this region into the text section:

    I don't use CPU2. What is the risk of doing that ? Any other idea ?

  • Hi, 

    To combine RAM sections, you can create a new section like this 

    RAMLS0_3 : origin = 0x008000, length = 0x002000 . 

    You will have to comment out or remove the individual RAM sections from RAMLS0 to RAMLS3

    Then to allocate .text , you can use the following line. 

       .text            : >> RAMD0 |  RAMLS0_3,   PAGE = 0

    If you are only using CPU1, then you don't have to bother about allocating anything to CPU2.

    Best Regards

    Siddharth

  • that's was my second option. thank you for your abswer.

    this resolve my issue. Thank you