<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>S32KのトピックRe: region m_data_2 overflowed with stack and heap</title>
    <link>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1811761#M31850</link>
    <description>&lt;P&gt;Hello, i have this same problem with same linker file, is there a solution for it ?&lt;BR /&gt;and yes i have many static variables, and when actually i remove some of them it will not give me the error, but i actually need them all to be static so is there some solution for it ?&lt;BR /&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2024 10:01:21 GMT</pubDate>
    <dc:creator>elb1</dc:creator>
    <dc:date>2024-02-20T10:01:21Z</dc:date>
    <item>
      <title>region m_data_2 overflowed with stack and heap</title>
      <link>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1468948#M15782</link>
      <description>&lt;P&gt;Hi NXP Comumunity&lt;/P&gt;&lt;P&gt;when i build s32k142, I met the problem. See the below.&lt;/P&gt;&lt;P&gt;Please help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;arm-none-eabi-gcc -o "JG_EV_S32K142.elf" "@JG_EV_S32K142.args"&lt;BR /&gt;c:/devtools/nxp/s32ds.3.4/s32ds/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: JG_EV_S32K142.elf section `.bss' will not fit in region `m_data_2'&lt;BR /&gt;c:/devtools/nxp/s32ds.3.4/s32ds/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: region m_data_2 overflowed with stack and heap&lt;BR /&gt;c:/devtools/nxp/s32ds.3.4/s32ds/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: section .stack VMA [20002c00,20002fff] overlaps section .bss VMA [20000000,2000eda3]&lt;BR /&gt;c:/devtools/nxp/s32ds.3.4/s32ds/build_tools/gcc_v6.3/gcc-6.3-arm32-eabi/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/real-ld.exe: region `m_data_2' overflowed by 0 bytes&lt;BR /&gt;collect2.exe: error: ld returned 1 exit status&lt;BR /&gt;make: *** [makefile:61: JG_EV_S32K142.elf] Error 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I am using .ld of the below.&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;** ###################################################################&lt;BR /&gt;** Processor: S32K142 with 32 KB SRAM&lt;BR /&gt;** Compiler: GNU C Compiler&lt;BR /&gt;**&lt;BR /&gt;** Abstract:&lt;BR /&gt;** Linker file for the GNU C Compiler&lt;BR /&gt;**&lt;BR /&gt;** Copyright (c) 2015-2016 Freescale Semiconductor, Inc.&lt;BR /&gt;** Copyright 2017-2018 NXP&lt;BR /&gt;** All rights reserved.&lt;BR /&gt;**&lt;BR /&gt;** NXP Confidential. This software is owned or controlled by NXP and may only be&lt;BR /&gt;** used strictly in accordance with the applicable license terms. By expressly&lt;BR /&gt;** accepting such terms or by downloading, installing, activating and/or otherwise&lt;BR /&gt;** using the software, you are agreeing that you have read, and that you agree to&lt;BR /&gt;** comply with and are bound by, such license terms. If you do not agree to be&lt;BR /&gt;** bound by the applicable license terms, then you may not retain, install,&lt;BR /&gt;** activate or otherwise use the software. The production use license in&lt;BR /&gt;** Section 2.3 is expressly granted for this software.&lt;BR /&gt;**&lt;BR /&gt;** http: &lt;A href="http://www.nxp.com" target="_blank"&gt;www.nxp.com&lt;/A&gt;&lt;BR /&gt;**&lt;BR /&gt;** ###################################################################&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;/* Entry Point */&lt;BR /&gt;ENTRY(Reset_Handler)&lt;/P&gt;&lt;P&gt;HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x00000400;&lt;BR /&gt;STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x00000400;&lt;/P&gt;&lt;P&gt;/* If symbol __flash_vector_table__=1 is defined at link time&lt;BR /&gt;* the interrupt vector will not be copied to RAM.&lt;BR /&gt;* Warning: Using the interrupt vector from Flash will not allow&lt;BR /&gt;* INT_SYS_InstallHandler because the section is Read Only.&lt;BR /&gt;*/&lt;BR /&gt;M_VECTOR_RAM_SIZE = DEFINED(__flash_vector_table__) ? 0x0 : 0x0400;&lt;/P&gt;&lt;P&gt;/* Specify the memory areas */&lt;BR /&gt;MEMORY&lt;BR /&gt;{&lt;BR /&gt;/* Flash */&lt;BR /&gt;m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400&lt;BR /&gt;m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010&lt;BR /&gt;m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0003FBF0&lt;/P&gt;&lt;P&gt;/* SRAM_L */&lt;BR /&gt;m_data (RW) : ORIGIN = 0x1FFFC000, LENGTH = 0x00004000&lt;/P&gt;&lt;P&gt;/* SRAM_U */&lt;BR /&gt;m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00003000&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Define output sections */&lt;BR /&gt;SECTIONS&lt;BR /&gt;{&lt;BR /&gt;/* The startup code goes first into internal flash */&lt;BR /&gt;.interrupts :&lt;BR /&gt;{&lt;BR /&gt;__VECTOR_TABLE = .;&lt;BR /&gt;__interrupts_start__ = .;&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;KEEP(*(.isr_vector)) /* Startup code */&lt;BR /&gt;__interrupts_end__ = .;&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;} &amp;gt; m_interrupts&lt;/P&gt;&lt;P&gt;.flash_config :&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;KEEP(*(.FlashConfig)) /* Flash Configuration Field (FCF) */&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;} &amp;gt; m_flash_config&lt;/P&gt;&lt;P&gt;/* The program code and other data goes into internal flash */&lt;BR /&gt;.text :&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;*(.text) /* .text sections (code) */&lt;BR /&gt;*(.text*) /* .text* sections (code) */&lt;BR /&gt;*(.rodata) /* .rodata sections (constants, strings, etc.) */&lt;BR /&gt;*(.rodata*) /* .rodata* sections (constants, strings, etc.) */&lt;BR /&gt;*(.init) /* section used in crti.o files */&lt;BR /&gt;*(.fini) /* section used in crti.o files */&lt;BR /&gt;*(.eh_frame) /* section used in crtbegin.o files */&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;} &amp;gt; m_text&lt;/P&gt;&lt;P&gt;/* Section used by the libgcc.a library for fvp4 */&lt;BR /&gt;.ARM :&lt;BR /&gt;{&lt;BR /&gt;__exidx_start = .;&lt;BR /&gt;*(.ARM.exidx*)&lt;BR /&gt;__exidx_end = .;&lt;BR /&gt;} &amp;gt; m_text&lt;/P&gt;&lt;P&gt;__etext = .; /* Define a global symbol at end of code. */&lt;BR /&gt;__DATA_ROM = .; /* Symbol is used by startup for data initialization. */&lt;/P&gt;&lt;P&gt;.interrupts_ram :&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__VECTOR_RAM__ = .;&lt;BR /&gt;__RAM_START = .;&lt;BR /&gt;__interrupts_ram_start__ = .; /* Create a global symbol at data start. */&lt;BR /&gt;*(.m_interrupts_ram) /* This is a user defined section. */&lt;BR /&gt;. += M_VECTOR_RAM_SIZE;&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__interrupts_ram_end__ = .; /* Define a global symbol at data end. */&lt;BR /&gt;} &amp;gt; m_data&lt;/P&gt;&lt;P&gt;__VECTOR_RAM = DEFINED(__flash_vector_table__) ? ORIGIN(m_interrupts) : __VECTOR_RAM__ ;&lt;BR /&gt;__RAM_VECTOR_TABLE_SIZE = DEFINED(__flash_vector_table__) ? 0x0 : (__interrupts_ram_end__ - __interrupts_ram_start__) ;&lt;/P&gt;&lt;P&gt;.data : AT(__DATA_ROM)&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__DATA_RAM = .;&lt;BR /&gt;__data_start__ = .; /* Create a global symbol at data start. */&lt;BR /&gt;*(.data) /* .data sections */&lt;BR /&gt;*(.data*) /* .data* sections */&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__data_end__ = .; /* Define a global symbol at data end. */&lt;BR /&gt;} &amp;gt; m_data&lt;/P&gt;&lt;P&gt;__DATA_END = __DATA_ROM + (__data_end__ - __data_start__);&lt;BR /&gt;__CODE_ROM = __DATA_END; /* Symbol is used by code initialization. */&lt;/P&gt;&lt;P&gt;.code : AT(__CODE_ROM)&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__CODE_RAM = .;&lt;BR /&gt;__code_start__ = .; /* Create a global symbol at code start. */&lt;BR /&gt;__code_ram_start__ = .;&lt;BR /&gt;*(.code_ram) /* Custom section for storing code in RAM */&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__code_end__ = .; /* Define a global symbol at code end. */&lt;BR /&gt;__code_ram_end__ = .;&lt;BR /&gt;} &amp;gt; m_data&lt;/P&gt;&lt;P&gt;__CODE_END = __CODE_ROM + (__code_end__ - __code_start__);&lt;BR /&gt;__CUSTOM_ROM = __CODE_END;&lt;/P&gt;&lt;P&gt;/* Custom Section Block that can be used to place data at absolute address. */&lt;BR /&gt;/* Use __attribute__((section (".customSection"))) to place data here. */&lt;BR /&gt;.customSectionBlock ORIGIN(m_data_2) : AT(__CUSTOM_ROM)&lt;BR /&gt;{&lt;BR /&gt;__customSection_start__ = .;&lt;BR /&gt;KEEP(*(.customSection)) /* Keep section even if not referenced. */&lt;BR /&gt;__customSection_end__ = .;&lt;BR /&gt;} &amp;gt; m_data_2&lt;BR /&gt;__CUSTOM_END = __CUSTOM_ROM + (__customSection_end__ - __customSection_start__);&lt;BR /&gt;__rom_end = __CUSTOM_END;&lt;/P&gt;&lt;P&gt;/* Uninitialized data section. */&lt;BR /&gt;.bss :&lt;BR /&gt;{&lt;BR /&gt;/* This is used by the startup in order to initialize the .bss section. */&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__BSS_START = .;&lt;BR /&gt;__bss_start__ = .;&lt;BR /&gt;*(.bss)&lt;BR /&gt;*(.bss*)&lt;BR /&gt;*(COMMON)&lt;BR /&gt;. = ALIGN(4);&lt;BR /&gt;__bss_end__ = .;&lt;BR /&gt;__BSS_END = .;&lt;BR /&gt;} &amp;gt; m_data_2&lt;/P&gt;&lt;P&gt;/* Put heap section after the program data */&lt;BR /&gt;.heap :&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(8);&lt;BR /&gt;__end__ = .;&lt;BR /&gt;__heap_start__ = .;&lt;BR /&gt;PROVIDE(end = .);&lt;BR /&gt;PROVIDE(_end = .);&lt;BR /&gt;PROVIDE(__end = .);&lt;BR /&gt;__HeapBase = .;&lt;BR /&gt;. += HEAP_SIZE;&lt;BR /&gt;__HeapLimit = .;&lt;BR /&gt;__heap_limit = .;&lt;BR /&gt;__heap_end__ = .;&lt;BR /&gt;} &amp;gt; m_data_2&lt;/P&gt;&lt;P&gt;/* Initializes stack on the end of block */&lt;BR /&gt;__StackTop = ORIGIN(m_data_2) + LENGTH(m_data_2);&lt;BR /&gt;__StackLimit = __StackTop - STACK_SIZE;&lt;BR /&gt;PROVIDE(__stack = __StackTop);&lt;BR /&gt;__RAM_END = __StackTop;&lt;/P&gt;&lt;P&gt;.stack __StackLimit :&lt;BR /&gt;{&lt;BR /&gt;. = ALIGN(8);&lt;BR /&gt;__stack_start__ = .;&lt;BR /&gt;. += STACK_SIZE;&lt;BR /&gt;__stack_end__ = .;&lt;BR /&gt;} &amp;gt; m_data_2&lt;/P&gt;&lt;P&gt;.ARM.attributes 0 : { *(.ARM.attributes) }&lt;BR /&gt;&lt;BR /&gt;/* Memory validation */&lt;BR /&gt;ASSERT(__rom_end &amp;lt;= (ORIGIN(m_text) + LENGTH(m_text)), "Region m_text overflowed!")&lt;/P&gt;&lt;P&gt;ASSERT(__StackLimit &amp;gt;= __HeapLimit, "region m_data_2 overflowed with stack and heap")&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2022 07:18:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1468948#M15782</guid>
      <dc:creator>sjryu73</dc:creator>
      <dc:date>2022-06-04T07:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: region m_data_2 overflowed with stack and heap</title>
      <link>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1469846#M15816</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201759"&gt;@sjryu73&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;The error says: "section `.bss' will not fit in region `m_data_2'.&lt;/P&gt;
&lt;P&gt;Do you allocate any sizable static variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 08:25:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1469846#M15816</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2022-06-07T08:25:26Z</dc:date>
    </item>
    <item>
      <title>Re: region m_data_2 overflowed with stack and heap</title>
      <link>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1811761#M31850</link>
      <description>&lt;P&gt;Hello, i have this same problem with same linker file, is there a solution for it ?&lt;BR /&gt;and yes i have many static variables, and when actually i remove some of them it will not give me the error, but i actually need them all to be static so is there some solution for it ?&lt;BR /&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 10:01:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/region-m-data-2-overflowed-with-stack-and-heap/m-p/1811761#M31850</guid>
      <dc:creator>elb1</dc:creator>
      <dc:date>2024-02-20T10:01:21Z</dc:date>
    </item>
  </channel>
</rss>

