Linker script section alignment exceeds memory region size (RTD, AR: 4.7.0, SW: 2.0.0)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Linker script section alignment exceeds memory region size (RTD, AR: 4.7.0, SW: 2.0.0)

ソリューションへジャンプ
186件の閲覧回数
M_SCH
Contributor III

Hello,

I have installed the S32DS v3.5.12 together with the latest RTD (AR: 4.7.0, SW: 2.0.0) for an S32k148 MCU.

I have generated the FreeRTOS example project for the S32K148 MCU as shown in the image below.

M_SCH_0-1718797520523.png

I have studied the Linker file linker_flash_s32k148.ld and think I found an error in the generated file. First, examine the memory definition. According to the file 1024 bytes are reserved for the interrupt table inside the flash memory and then additional 16 bytes for the flash configuration flags/bits, etc.

MEMORY
{
    int_flash_interrupts    : ORIGIN = 0x00000000, LENGTH = 0x00000400    /* 1K */    /* Do not change this section */
    int_flash_config        : ORIGIN = 0x00000400, LENGTH = 0x00000010    /* 16bytes */ /* Do not change this section */
    int_flash               : ORIGIN = 0x00000410, LENGTH = 0x0017FBF0    /* ~1.5MB */
    int_sram_results        : ORIGIN = 0x1FFE0000, LENGTH = 0x00000100    /* 256bytes */
    int_sram                : ORIGIN = 0x1FFE0100, LENGTH = 0x0003DF00    /* ~248K */
    int_sram_stack_c0       : ORIGIN = 0x2001E000, LENGTH = 0x00001000    /* 4K  */
    ram_rsvd2               : ORIGIN = 0x2001F000, LENGTH = 0             /* End of SRAM */
}

 If you continue analyzing the section definition at the beginning

SECTIONS
{

    .flash_interrupts :
    {
        . = ALIGN(2048);
        __interrupts_rom_start = .;
        KEEP(*(.intc_vector))
        . = ALIGN(4);
        __interrupts_rom_end = .;
    } > int_flash_interrupts


you see that the memory region int_flash_interrupts, which has an assigned size of 1024 bytes contains a 2048 byte alignment instruction, which exceeds the defined region size.

Am I correct? If not, can you explain, what I am missing here.

Best regards,

M_SCH

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
140件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @M_SCH 

The ALIGN(n) instructs the compiler to align a variable on an n-byte boundary starting from the ORIGIN address. This just limits the location of a memory region to a certain n-byte size, this should not interfere with other memory regions as the memory region size does not exceed the n-byte boundary.

 

B.R.

VaneB

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
141件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @M_SCH 

The ALIGN(n) instructs the compiler to align a variable on an n-byte boundary starting from the ORIGIN address. This just limits the location of a memory region to a certain n-byte size, this should not interfere with other memory regions as the memory region size does not exceed the n-byte boundary.

 

B.R.

VaneB

0 件の賞賛
返信