How to create two initialized data sections

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

How to create two initialized data sections

507件の閲覧回数
a8Chcx
Contributor V

Hi,

I am using MCUXpresso V11.5.0 for my FRDM-K66. I have a question:

Here is the part of link file:

.data : AT(__DATA_ROM)
{
. = ALIGN(4);
__DATA_RAM = .;
__data_start__ = .; /* create a global symbol at data start */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
KEEP(*(.jcr*))
. = ALIGN(4);
__data_end__ = .; /* define a global symbol at data end */
} > m_data1

/* Symbol is used by startup for data initialization */
__DATA_END = __DATA_ROM + (__data_end__ - __data_start__) ;

/* Uninitialized data section */
.bss :
{
/* This is used by the startup in order to initialize the .bss section */
. = ALIGN(4);
__START_BSS = .;
__bss_start__ = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end__ = .;
__END_BSS = .;
/* } > m_data1*/
} > m_data2

 

It will put the initialized data into m_data1 SRAM(64K) and works fine...

I want to put some initialized data into m_data2 SRAM(192K)...

I tried several ways and got failed...

Can anybody help me to define two initialized data sections for my project?

Thanks,

Christie

0 件の賞賛
返信
1 返信

475件の閲覧回数
Omar_Anguiano
NXP TechSupport
NXP TechSupport

To place some initialized data into m_data2, you need to:
-Create a new section in your linker script for the initialized data that should go into m_data2.
-Use a section attribute in your source code to place specific variables into that section.

Best regards,
Omar

0 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-2135002%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E2%E3%81%A4%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E4%BD%9C%E6%88%90%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2135002%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%93%E3%82%93%E3%81%AB%E3%81%A1%E3%81%AF%E3%80%81%3C%2FP%3E%3CP%3EFRDM-K66%20%E3%81%AB%20MCUXpresso%20V11.5.0%20%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E8%B3%AA%E5%95%8F%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%EF%BC%9A%3C%2FP%3E%3CP%3E%E3%83%AA%E3%83%B3%E3%82%AF%20%E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB%E3%81%AE%E4%B8%80%E9%83%A8%E3%81%AF%E6%AC%A1%E3%81%AE%E3%81%A8%E3%81%8A%E3%82%8A%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E.data%20%3A%20AT(__DATA_ROM)%3CBR%20%2F%3E%20%7B%3CBR%20%2F%3E%20%E3%80%82%3D%20%E6%95%B4%E5%88%97(4)%3B%3CBR%20%2F%3E%20__DATA_RAM%20%3D%20.%3B%3CBR%20%2F%3E__data_start%20__%20%3D%20.%3B%20%2F*%20create%20a%20global%20symbol%20at%20data%20start%20*%2F%3CBR%20%2F%3E*(.data)%20%2F*%20.data%20sections%20*%2F%3CBR%20%2F%3E*(.data*)%20%2F*%20.data*%20sections%20*%2F%3CBR%20%2F%3EKEEP(*(.jcr*))%3CBR%20%2F%3E.%20%3D%20ALIGN(4)%3B%3CBR%20%2F%3E__%20data_end__%20%3D%20.%3B%2F*%20%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E6%9C%AB%E5%B0%BE%E3%81%AB%E3%82%B0%E3%83%AD%E3%83%BC%E3%83%90%E3%83%AB%E3%82%B7%E3%83%B3%E3%83%9C%E3%83%AB%E3%82%92%E5%AE%9A%E7%BE%A9%E3%81%99%E3%82%8B%20*%2F%3CBR%20%2F%3E%20%7D%20%26gt%3B%20m_data1%3C%2FP%3E%3CP%3E%2F*%20%E3%82%B7%E3%83%B3%E3%83%9C%E3%83%AB%E3%81%AF%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88%E3%82%A2%E3%83%83%E3%83%97%E6%99%82%E3%81%AB%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%AB%E4%BD%BF%E7%94%A8%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%20*%2F%3CBR%20%2F%3E%20__DATA_END%20%3D%20__DATA_ROM%20%2B%20(__data_end%20__%20-%20__%20data_start__)%20%3B%3C%2FP%3E%3CP%3E%2F*%20%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%81%AA%E3%81%84%E3%83%87%E3%83%BC%E3%82%BF%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%20*%2F%3CBR%20%2F%3E%20.bss%3A%3CBR%20%2F%3E%20%7B%3CBR%20%2F%3E%20%2F*%20%E3%81%93%E3%82%8C%E3%81%AF%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88%E3%82%A2%E3%83%83%E3%83%97%E6%99%82%E3%81%AB.bss%E3%82%92%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%99%E3%82%8B%E3%81%9F%E3%82%81%E3%81%AB%E4%BD%BF%E7%94%A8%E3%81%95%E3%82%8C%E3%81%BE%E3%81%99%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%20*%2F%3CBR%20%2F%3E%20%E3%80%82%3D%20%E6%95%B4%E5%88%97(4)%3B%3CBR%20%2F%3E%20__START_BSS%20%3D%20.%3B%3CBR%20%2F%3E__bss_start%20__%20%3D%20.%3B%3CBR%20%2F%3E*(.bss)%3CBR%20%2F%3E*(.bss*)%3CBR%20%2F%3E*(COMMON)%3CBR%20%2F%3E.%20%3D%20ALIGN(4)%3B%3CBR%20%2F%3E__%20bss_end%20__%20%3D%20.%3B%3CBR%20%2F%3E__%20END_BSS%20%3D%20.%3B%3CBR%20%2F%3E%2F*%20%7D%20%26gt%3B%20m_data1*%2F%3CBR%20%2F%3E%20%7D%20%26gt%3B%20m_data2%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AF%20m_data1%20SRAM%20(64K)%20%E3%81%AB%E6%A0%BC%E7%B4%8D%E3%81%95%E3%82%8C%E3%80%81%E6%AD%A3%E5%B8%B8%E3%81%AB%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%BE%E3%81%99...%3C%2FP%3E%3CP%3E%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92m_data2%20SRAM(192K)%E3%81%AB%E6%A0%BC%E7%B4%8D%E3%81%97%E3%81%9F%E3%81%84%E3%81%AE%E3%81%A7%E3%81%99%E3%81%8C...%3C%2FP%3E%3CP%3E%E3%81%84%E3%81%8F%E3%81%A4%E3%81%8B%E3%81%AE%E6%96%B9%E6%B3%95%E3%82%92%E8%A9%A6%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%81%8C%E5%A4%B1%E6%95%97%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F...%3C%2FP%3E%3CP%3E%E7%A7%81%E3%81%AE%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88%E7%94%A8%E3%81%AB%202%20%E3%81%A4%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%20%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E5%AE%9A%E7%BE%A9%E3%81%99%E3%82%8B%E3%81%AE%E3%82%92%E6%89%8B%E4%BC%9D%E3%81%A3%E3%81%A6%E3%81%8F%E3%82%8C%E3%82%8B%E4%BA%BA%E3%81%AF%E3%81%84%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FP%3E%3CP%3E%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%3C%2FP%3E%3CP%3E%E3%82%AF%E3%83%AA%E3%82%B9%E3%83%86%E3%82%A3%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2136762%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20How%20to%20create%20two%20initialized%20data%20sections%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2136762%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%95%E3%82%8C%E3%81%9F%E3%83%87%E3%83%BC%E3%82%BF%E3%82%92%20m_data2%20%E3%81%AB%E9%85%8D%E7%BD%AE%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%80%81%E6%AC%A1%E3%81%AE%E6%93%8D%E4%BD%9C%E3%82%92%E8%A1%8C%E3%81%86%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E%20-%20m_data2%20%E3%81%AB%E6%A0%BC%E7%B4%8D%E3%81%95%E3%82%8C%E3%82%8B%E5%88%9D%E6%9C%9F%E5%8C%96%E3%83%87%E3%83%BC%E3%82%BF%E7%94%A8%E3%81%AE%E6%96%B0%E3%81%97%E3%81%84%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%82%92%E3%83%AA%E3%83%B3%E3%82%AB%E3%83%BC%20%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88%E3%81%AB%E4%BD%9C%E6%88%90%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3CBR%20%2F%3E-%20%E3%82%BD%E3%83%BC%E3%82%B9%20%E3%82%B3%E3%83%BC%E3%83%89%E5%86%85%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E5%B1%9E%E6%80%A7%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81%E7%89%B9%E5%AE%9A%E3%81%AE%E5%A4%89%E6%95%B0%E3%82%92%E3%81%9D%E3%81%AE%E3%82%BB%E3%82%AF%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AB%E9%85%8D%E7%BD%AE%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%0A%3CP%3E%E3%82%88%E3%82%8D%E3%81%97%E3%81%8F%E3%81%8A%E9%A1%98%E3%81%84%E3%81%97%E3%81%BE%E3%81%99%E3%80%81%3CBR%20%2F%3E%E3%82%AA%E3%83%9E%E3%83%BC%E3%83%AB%3C%2FP%3E%3C%2FLINGO-BODY%3E