K02F Linker script contains USB section

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

K02F Linker script contains USB section

ソリューションへジャンプ
1,266件の閲覧回数
MartinHo
Contributor IV

I'm new to Kinetis (but I'm coming from LPC, so I know Cortex and Eclipse), I'm using the MK02FN64VLF10. Building my first Application with FreeRTOS, I noticed that there was very little RAM free for the RTOS HEAP (I'm using heap2.c), so I checked the linker script (MK02FN64xxx10_flash.ld):

 

1) The Linker script contains a section (in .bss)

     . = ALIGN(512);

    USB_RAM_START = .;

    . += USB_RAM_GAP;

with USB_RAM_GAP resulting in 0x800 (__usb_ram_size__ is not defined).

This section is clearly not used for the K02F (there is now USB controller!) so we can free 2K of ram.

 

2) The linker script dived the ram in m_data and m_data_2, I understand that m_data is faster then m_data_2, but in a RTOS environment I prefer to have a HEAP as big as possible, so I think it's preferibile to have only 1 data section, even if this means that I can not decide if specific data is place in the fast RAM or not.

Ar there any problems when I define:

  m_data                (RW)  : ORIGIN = 0x1FFFE000, LENGTH = 0x00004000

And remove the m_data_2 section?

 

thanks

Martin

ラベル(1)
0 件の賞賛
返信
1 解決策
974件の閲覧回数
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Martin,

Answering your questions:

1) You are correct, that section should not be present in the linker file. I have already reported this issue to the developers.

2) You can merge both data sections in one but you have to make sure that the processor will not attempt a misaligned access across the 0x2000_0000 boundary. I think that the following post created by our colleague Erich Styger might be helpful for you, it explains how to use the upper memory area for the RTOS heap:

FreeRTOS Heap with Segmented Kinetis K SRAM | MCU on Eclipse

You can take a look to this document for a detailed explanation of how to relocate data in RAM:

Relocating Code and Data Using the KDS GCC Linker File for Kinetis

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

1 返信
975件の閲覧回数
Carlos_Mendoza
NXP Employee
NXP Employee

Hi Martin,

Answering your questions:

1) You are correct, that section should not be present in the linker file. I have already reported this issue to the developers.

2) You can merge both data sections in one but you have to make sure that the processor will not attempt a misaligned access across the 0x2000_0000 boundary. I think that the following post created by our colleague Erich Styger might be helpful for you, it explains how to use the upper memory area for the RTOS heap:

FreeRTOS Heap with Segmented Kinetis K SRAM | MCU on Eclipse

You can take a look to this document for a detailed explanation of how to relocate data in RAM:

Relocating Code and Data Using the KDS GCC Linker File for Kinetis

Hope it helps!

Best Regards,

Carlos Mendoza

Technical Support Engineer

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------