Banner_AURIX_Security-Solution Banner_AURIX_Safety_Products ShieldBuddy TC275 Banner_AURIX_OnzerOS


infineon4engi@twitter twitter

infineon4engineers Facebook

infineon@linkedin linkedin

infineon@youtube youtube


+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 12 of 12
  1. #11
    New Member New Member rswindell is on a distinguished road
    Join Date
    May 2017
    Posts
    13
    Points
    115
    Success!

    I found this little blurb in the 1200 page TASKING tools manual:

    #pragma section const_init
    Sections with constant data are copied from ROM to RAM at program startup.

    That's the line that was needed. It's not included in any of the Infineon or TASKING sample source code (I've scanned) and apparently there's no linker-script equivalent. But that's the "magic incantation" needed to force the constant data into the RAM rather than Flash (what they're calling "ROM" above) and now the Infineon flashing code consistently works.

    Adding this one line (the #pragma above) before any #includes in FlashDemo.c allows it to work without exception/trapping.

    -Rob

  2. #12
    New Member New Member rswindell is on a distinguished road
    Join Date
    May 2017
    Posts
    13
    Points
    115

    Success!

    I also created an Altium/TASKING support request to see if there is a linker script equivalent and received this helpful response:

    The reason for the trouble you experienced is that you used the 'wrong' section_Layout type for the copy assignment to near addressable sections. You used

    mpe:vtc:linear

    which is used for far addressable sections (.data, .text, .bss) but not for near addressable sections (.zdata, .zbss).

    For near (abs18) addressed sections it needs to be

    mpe:vtc:abs18
    With this adjustment to the linker script, I can use that method of relocating the constant data to the DSPR as well:

    Code:
    #include "cpu.lsl"
    
    section_layout mpe:vtc:abs18
    {
    	group NEAR_CONST_DATA (run_addr = mem:mpe:dspr0, copy ) // tc0 memory dspr0
    	{
    		select ".zrodata.FlashDemo.*"; // select sections for dspr0
    	}
    }
    I also got this helpful tip from TASKING support:

    Hint: Always use a group name e.g.:

    group NEAR_CONST_DATA (run_addr = mem:mpe:dspr0, copy )

    Then it is quite easy to determine whether the linker did what you expect it to do or it ignored your group entry for whatever reason. Just look at the generated map file in the locate result section. Here you can search for the

    .zrodata.FlashDemo.*

    sections and if the 'group' column beneath the entry is empty and does not show the assignment to group NEAR_CONST_DATA you know that the linker simply ignored you group assignment (but it does not complain since it is syntactically correct).
    I hope this information helps other engineers with similar issues with regards to erasing/writing AURIX PFlash.

    -Rob
    Last edited by rswindell; Jul 12th, 2017 at 12:46 PM. Reason: Removed redundant text

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.