TC4xx promo banner Banner_Aurix_Competition Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_DevelopmentStudio


+ Reply to Thread
Results 1 to 4 of 4

Thread: Memory Allocation problem

  1. #1
    New Member New Member bernd is on a distinguished road
    Join Date
    May 2021
    Posts
    2
    Points
    35

    Memory Allocation problem

    Hi,
    i am using Tasking Compiler V6,3 for the TC367 and i am trying to move my application to another memory location.
    I read the manuals how to control the tasking linker via lsl-script, but all attempts to move my application to other address fails (ignored).
    The code is always linked to the standard flash address.

    To figure out, how it works i created a test application (hello world) with the eclipse IDE and try to manipulate the generated lsl-file.
    This is my last try:

    derivative my_tc36x extends tc36x
    {
    section_layout mpe:vtc:linear
    {
    group MY_CODE ( ordered, run_addr = 0x80001000 )
    {
    select ".text.*";
    }
    }
    }

    can somebody help me to figure out, why my main() is linked to the standard address 0x80000010 and not to 0x80001000 ???

    My target goal is to link my application to any code-flash area or finally into the RAM area

  2. #2
    Advanced Advanced UC_wrangler will become famous soon enough
    Join Date
    Jun 2019
    Posts
    485
    Points
    10050
    A better question for Tasking, perhaps. Have you exhausted Tasking's resources on the web?

    https://resources.tasking.com/sites/...tricks_WEB.pdf

    https://www.tasking.com/sites/defaul...ol-Program.pdf

    support@tasking.com

    Can you post a zip with your LSL file and map file?

  3. #3
    New Member New Member bernd is on a distinguished road
    Join Date
    May 2021
    Posts
    2
    Points
    35
    Thanks for the reply.
    The lsl file is contained in my original post.
    Only the include of the original standard lsl files is missing, so here the complete lsl:

    And yes: I read all documents regarding linking (including the documents you mentioned).
    But NO of the given examples works (in my case) !!!

    I already contacted the tasking support, and the problem was included in a support case database.
    But no reply for a solution until now, so i thought: lets have a try here ;-)

    #if defined(__PROC_TC36X__)
    #include "tc36x.lsl"
    derivative my_tc36x extends tc36x
    {
    section_layout mpe:vtc:linear
    {
    group HPM_CODE ( ordered, run_addr = 0x80001000 )
    {
    select ".text.HPM_CODE.*";
    }
    }
    }

    and my c-file:
    #include <stdio.h>

    #pragma section code "HPM_CODE"
    int main(void)
    {
    printf( "Hello world\n" );
    }
    #pragma section code restore
    And the parts (snippets) of the map-file for the main function:
    * Symbols (sorted on name)
    | main | 0x8000000e | |
    ********************************** Locate Rules *************
    ...
    | mpe:vtc:linear | unrestricted | | 1 | .text._Exit.libc (493) , table (529) , .text..cocofun_1.libcs_fpu (417) , .text.HPM_CODE (129) , |
    ...

    And the sections list of the map file:
    * Sections
    ===========

    + Space mpe:vtc:linear (MAU = 8bit)

    +------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Chip | Group | Section | Size (MAU) | Space addr | Chip addr | Alignment |
    |================================================= ================================================== ================================================== =|
    | mpeflash0 | | .text._Exit.libc (493) | 0x00000004 | 0x80000000 | 0x0 | 0x00000008 |
    | mpeflash0 | | .text..cocofun_1.libcs_fpu (417) | 0x0000000a | 0x80000004 | 0x00000004 | 0x00000002 |
    | mpeflash0 | | .text.HPM_CODE (129) | 0x00000010 | 0x8000000e | 0x0000000e | 0x00000002 |
    Last edited by bernd; May 4th, 2021 at 10:37 PM.

  4. #4
    Beginner Beginner ulrichk is on a distinguished road
    Join Date
    Sep 2017
    Posts
    36
    Points
    176.5625
    There are two issues I noticed:

    1) The section_layout entry should be outside of the derivative definition. Please use:

    #if defined(__PROC_TC36X__)
    #include "tc36x.lsl"
    #else
    #include <cpu.lsl>
    #endif

    section_layout mpe:vtc:linear
    {
    group MY_CODE ( ordered, run_addr = 0x80001000 )
    {
    select ".text.HPM_CODE";
    }
    }

    instead of:

    ...derivative my_tc36x extends tc36x
    {
    section_layout mpe:vtc:linear
    {
    group HPM_CODE ( ordered, run_addr = 0x80001000 )
    {
    select ".text.HPM_CODE.*";
    }
    }
    }

    2) The select does not match. Using:

    select ".text.HPM_CODE.*";

    will select all sections starting with .text.HPM_CODE. But the section name does not include a tailing dot. So the select needs to be changed to:

    select ".text.HPM_CODE";

    for this use case.

    I enclosed a small example which works as expected. 210506_example.zip

    Best regards,
    Ulrich

    TASKING tools support

+ Reply to Thread
Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.