infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube


+ Reply to Thread
Results 1 to 2 of 2

Thread: ABM header with optimization

  1. #1
    New Member New Member TestJoe is on a distinguished road
    Join Date
    Apr 2017

    ABM header with optimization


    if I use the Bootloader IAP XMC47 example without any optimization it works properly.
    But if I use any optimization level the abm header is no longer available.

    Optimization (-Os / -O1)
    Idx Name          Size      VMA       LMA       File off  Algn
      0 .text         00004744  08000000  0c000000  00008000  2**2
                      CONTENTS, ALLOC, LOAD, READONLY, CODE
      1 Stack         00000800  1ffe8000  1ffe8000  00018000  2**0
      2 .data         000000b8  1ffe8800  0c004744  00010800  2**2
                      CONTENTS, ALLOC, LOAD, DATA
      3 .bss          0000072c  1ffe88b8  0c0047fc  000108b8  2**2
    No optimization
    Idx Name          Size      VMA       LMA       File off  Algn
      0 .text         000076dc  08000000  0c000000  00008000  2**2
                      CONTENTS, ALLOC, LOAD, READONLY, CODE
      1 .abm          00000014  0800ffe0  0c00ffe0  00017fe0  2**2
                      CONTENTS, ALLOC, LOAD, READONLY, DATA
      2 Stack         00000800  1ffe8000  1ffe8000  00018000  2**0
      3 .data         000000b8  1ffe8800  0c0076dc  00010800  2**2
                      CONTENTS, ALLOC, LOAD, DATA
      4 .bss          0000072c  1ffe88b8  0c007794  000108b8  2**2
    These are the intersting defines:

    #define ABM_HEADER_MAGIC_KEY 0xA5C3E10F
    typedef struct ABM_Header {
    	uint32_t MagicKey; /**< Magic key. Always 0xA5C3E10F */
    	uint32_t StartAddress; /**< Start address of the programm to load */
    	uint32_t Length; /**< Length of the programm to load. */
    	uint32_t ApplicationCRC32; /**< CRC32 Sum of the complete application code */
    	uint32_t HeaderCRC32; /**< CRC32 Sum of the four fields before */
    } ABM_Header_t;
    static const ABM_Header_t __attribute__((section(".flash_abm")))
    ABM0_Header = {
        .MagicKey = ABM_HEADER_MAGIC_KEY,
        .StartAddress =   0x08020000,  /* Start Flash Physical Sector 8 */
        .Length = 0xFFFFFFFF,
        .ApplicationCRC32 = 0xFFFFFFFF,
        .HeaderCRC32 =  0xEF423163  
    	FLASH_1_cached(RX) : ORIGIN = 0x08000000, LENGTH = 0x200000
    	FLASH_1_uncached(RX) : ORIGIN = 0x0C000000, LENGTH = 0x200000
    	PSRAM_1(!RX) : ORIGIN = 0x1FFE8000, LENGTH = 0x18000
    	DSRAM_1_system(!RX) : ORIGIN = 0x20000000, LENGTH = 0x20000
    	DSRAM_2_comm(!RX) : ORIGIN = 0x20020000, LENGTH = 0x20000
    	SRAM_combined(!RX) : ORIGIN = 0x1FFE8000, LENGTH = 0x58000
    .abm ABSOLUTE(0x0800FFE0): AT(0x0800FFE0 | 0x04000000)
        } > FLASH_1_cached
    Are there any hints preventing the abm header against optimization?
    Thank you.


  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012

    Please try defining ABM0_Header as:

    static const ABM_Header_t __attribute__((section(".flash_abm"), used))
    ABM0_Header  = {
        .MagicKey = ABM_HEADER_MAGIC_KEY,
        .StartAddress =   0x08010000,  /* Start Flash Physical Sector 1 */
        .Length = 0xFFFFFFFF,
        .ApplicationCRC32 = 0xFFFFFFFF,
        .HeaderCRC32 =  0xE176A4E6
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

+ Reply to Thread

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.