diff --git a/examples/camera/camera_interleave/bl706_camera.ld b/examples/camera/camera_interleave/bl706_camera.ld index a27fb5db..5c3c4d51 100644 --- a/examples/camera/camera_interleave/bl706_camera.ld +++ b/examples/camera/camera_interleave/bl706_camera.ld @@ -1,9 +1,9 @@ /**************************************************************************************** -* @file map.txt +* @file bl706_camera.ld * * @brief This file is the map file (gnuarm or armgcc). * -* Copyright (C) BouffaloLab 2018 +* Copyright (C) BouffaloLab 2021 * **************************************************************************************** */ @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} diff --git a/examples/camera/camera_interleave_psram/bl706_camera_psram.ld b/examples/camera/camera_interleave_psram/bl706_camera_psram.ld index f92ada87..567452ec 100644 --- a/examples/camera/camera_interleave_psram/bl706_camera_psram.ld +++ b/examples/camera/camera_interleave_psram/bl706_camera_psram.ld @@ -1,9 +1,9 @@ /**************************************************************************************** -* @file map.txt +* @file bl706_camera_psram.ld * * @brief This file is the map file (gnuarm or armgcc). * -* Copyright (C) BouffaloLab 2018 +* Copyright (C) BouffaloLab 2021 * **************************************************************************************** */ @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -28,6 +27,7 @@ MEMORY ram_memory (!rx) : ORIGIN = 0x42019800, LENGTH = 18K } + SECTIONS { PROVIDE(__metal_chicken_bit = 0); @@ -39,11 +39,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -114,22 +119,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +203,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} diff --git a/examples/camera/camera_lcd/bl706_camera_psram.ld b/examples/camera/camera_lcd/bl706_camera_psram.ld index f92ada87..a54fdfbc 100644 --- a/examples/camera/camera_lcd/bl706_camera_psram.ld +++ b/examples/camera/camera_lcd/bl706_camera_psram.ld @@ -1,9 +1,9 @@ /**************************************************************************************** -* @file map.txt +* @file bl706_camera_psram.ld * * @brief This file is the map file (gnuarm or armgcc). * -* Copyright (C) BouffaloLab 2018 +* Copyright (C) BouffaloLab 2021 * **************************************************************************************** */ @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} \ No newline at end of file diff --git a/examples/dac/dac_mono_play_form_flash/bl702_dac_flash.ld b/examples/dac/dac_mono_play_form_flash/bl702_dac_flash.ld index bafdbd02..6d1ec0e8 100644 --- a/examples/dac/dac_mono_play_form_flash/bl702_dac_flash.ld +++ b/examples/dac/dac_mono_play_form_flash/bl702_dac_flash.ld @@ -1,9 +1,9 @@ /**************************************************************************************** -* @file map.txt +* @file bl702_dac_flash.ld * * @brief This file is the map file (gnuarm or armgcc). * -* Copyright (C) BouffaloLab 2018 +* Copyright (C) BouffaloLab 2021 * **************************************************************************************** */ @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x6000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} diff --git a/examples/usb/usb_audio_mouse/usb_audio_mouse.ld b/examples/usb/usb_audio_mouse/usb_audio_mouse.ld index c9d5036a..ae336a27 100644 --- a/examples/usb/usb_audio_mouse/usb_audio_mouse.ld +++ b/examples/usb/usb_audio_mouse/usb_audio_mouse.ld @@ -1,5 +1,5 @@ /**************************************************************************************** -* @file bl702_flash.ld +* @file usb_audio_mouse.ld * * @brief This file is the map file (gnuarm or armgcc). * @@ -18,7 +18,6 @@ OUTPUT_ARCH( "riscv" ) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -70,13 +74,6 @@ SECTIONS *(.srodata) *(.srodata.*) - _bt_gatt_service_static_list_start = .; - KEEP(*(SORT_BY_NAME("._bt_gatt_service_static.static.*"))) - _bt_gatt_service_static_list_end = .; - _bt_l2cap_fixed_chan_list_start = .; - KEEP(*(SORT_BY_NAME("._bt_l2cap_fixed_chan.static.*"))) - _bt_l2cap_fixed_chan_list_end = .; - . = ALIGN(4); __text_code_end__ = .; } > xip_memory @@ -121,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -221,14 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} diff --git a/examples/usb/usb_cdc_msc/usb_cdc_msc.ld b/examples/usb/usb_cdc_msc/usb_cdc_msc.ld index 4a485006..790587e6 100644 --- a/examples/usb/usb_cdc_msc/usb_cdc_msc.ld +++ b/examples/usb/usb_cdc_msc/usb_cdc_msc.ld @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,13 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") + } diff --git a/examples/usb/usb_cdc_video/usb_cdc_video.ld b/examples/usb/usb_cdc_video/usb_cdc_video.ld index 4b301a17..9133cb6d 100644 --- a/examples/usb/usb_cdc_video/usb_cdc_video.ld +++ b/examples/usb/usb_cdc_video/usb_cdc_video.ld @@ -1,9 +1,9 @@ /**************************************************************************************** -* @file map.txt +* @file usb_cdc_video.ld * * @brief This file is the map file (gnuarm or armgcc). * -* Copyright (C) BouffaloLab 2018 +* Copyright (C) BouffaloLab 2021 * **************************************************************************************** */ @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x400; /* 4KB */ -HeapSize = 0x400; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -56,14 +60,14 @@ SECTIONS *(.text.*) /*put .rodata**/ - *(EXCLUDE_FILE( *bl602_glb.o \ - *bl602_pds.o \ - *bl602_common.o \ - *bl602_sf_cfg.o \ - *bl602_sf_ctrl.o \ - *bl602_sflash.o \ - *bl602_xip_sflash.o \ - *bl602_ef_ctrl.o) .rodata*) + *(EXCLUDE_FILE( *bl702_glb.o \ + *bl702_pds.o \ + *bl702_common.o \ + *bl702_sf_cfg.o \ + *bl702_sf_ctrl.o \ + *bl702_sflash.o \ + *bl702_xip_sflash.o \ + *bl702_ef_ctrl.o) .rodata*) *(.rodata) *(.rodata.*) @@ -87,14 +91,14 @@ SECTIONS *(.sclock_rlt_code) *(.sclock_rlt_const) - *bl602_glb.o*(.rodata*) - *bl602_pds.o*(.rodata*) - *bl602_common.o*(.rodata*) - *bl602_sf_cfg.o*(.rodata*) - *bl602_sf_ctrl.o*(.rodata*) - *bl602_sflash.o*(.rodata*) - *bl602_xip_sflash.o*(.rodata*) - *bl602_ef_ctrl.o*(.rodata*) + *bl702_glb.o*(.rodata*) + *bl702_pds.o*(.rodata*) + *bl702_common.o*(.rodata*) + *bl702_sf_cfg.o*(.rodata*) + *bl702_sf_ctrl.o*(.rodata*) + *bl702_sflash.o*(.rodata*) + *bl702_xip_sflash.o*(.rodata*) + *bl702_ef_ctrl.o*(.rodata*) . = ALIGN(4); __tcm_code_end__ = .; @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} diff --git a/examples/usb/usb_cdc_video_psram/usb_cdc_video_psram.ld b/examples/usb/usb_cdc_video_psram/usb_cdc_video_psram.ld index 0b547dcb..60886c48 100644 --- a/examples/usb/usb_cdc_video_psram/usb_cdc_video_psram.ld +++ b/examples/usb/usb_cdc_video_psram/usb_cdc_video_psram.ld @@ -1,9 +1,9 @@ /**************************************************************************************** -* @file map.txt +* @file usb_cdc_video_psram.ld * * @brief This file is the map file (gnuarm or armgcc). * -* Copyright (C) BouffaloLab 2018 +* Copyright (C) BouffaloLab 2021 * **************************************************************************************** */ @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -56,14 +60,14 @@ SECTIONS *(.text.*) /*put .rodata**/ - *(EXCLUDE_FILE( *bl602_glb.o \ - *bl602_pds.o \ - *bl602_common.o \ - *bl602_sf_cfg.o \ - *bl602_sf_ctrl.o \ - *bl602_sflash.o \ - *bl602_xip_sflash.o \ - *bl602_ef_ctrl.o) .rodata*) + *(EXCLUDE_FILE( *bl702_glb.o \ + *bl702_pds.o \ + *bl702_common.o \ + *bl702_sf_cfg.o \ + *bl702_sf_ctrl.o \ + *bl702_sflash.o \ + *bl702_xip_sflash.o \ + *bl702_ef_ctrl.o) .rodata*) *(.rodata) *(.rodata.*) @@ -87,14 +91,14 @@ SECTIONS *(.sclock_rlt_code) *(.sclock_rlt_const) - *bl602_glb.o*(.rodata*) - *bl602_pds.o*(.rodata*) - *bl602_common.o*(.rodata*) - *bl602_sf_cfg.o*(.rodata*) - *bl602_sf_ctrl.o*(.rodata*) - *bl602_sflash.o*(.rodata*) - *bl602_xip_sflash.o*(.rodata*) - *bl602_ef_ctrl.o*(.rodata*) + *bl702_glb.o*(.rodata*) + *bl702_pds.o*(.rodata*) + *bl702_common.o*(.rodata*) + *bl702_sf_cfg.o*(.rodata*) + *bl702_sf_ctrl.o*(.rodata*) + *bl702_sflash.o*(.rodata*) + *bl702_xip_sflash.o*(.rodata*) + *bl702_ef_ctrl.o*(.rodata*) . = ALIGN(4); __tcm_code_end__ = .; @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); -} + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") +} diff --git a/examples/usb/usb_msc_ram/usb_msc_ram.ld b/examples/usb/usb_msc_ram/usb_msc_ram.ld index 4a485006..790587e6 100644 --- a/examples/usb/usb_msc_ram/usb_msc_ram.ld +++ b/examples/usb/usb_msc_ram/usb_msc_ram.ld @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -39,11 +38,16 @@ SECTIONS KEEP (*(.text.metal.init.enter)) KEEP (*(SORT_NONE(.init))) - /* section information for finsh shell */ + /* section information for shell */ . = ALIGN(4); - _shell_command_start = .; - KEEP(*(shellCommand)) - _shell_command_end = .; + __fsymtab_start = .; + KEEP(*(FSymTab)) + __fsymtab_end = .; + + . = ALIGN(4); + __vsymtab_start = .; + KEEP(*(VSymTab)) + __vsymtab_end = .; /* section information for usb desc */ . = ALIGN(4); @@ -114,22 +118,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,13 +202,15 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") + } diff --git a/examples/usb/usb_video/usb_cdc_video_psram.ld b/examples/usb/usb_video/usb_cdc_video_psram.ld index cc137f26..d380e1c6 100644 --- a/examples/usb/usb_video/usb_cdc_video_psram.ld +++ b/examples/usb/usb_video/usb_cdc_video_psram.ld @@ -18,7 +18,6 @@ INPUT(-lgcc) ENTRY(_enter) StackSize = 0x1000; /* 4KB */ -HeapSize = 0x1000; /* 4KB */ MEMORY { @@ -56,14 +55,14 @@ SECTIONS *(.text.*) /*put .rodata**/ - *(EXCLUDE_FILE( *bl602_glb.o \ - *bl602_pds.o \ - *bl602_common.o \ - *bl602_sf_cfg.o \ - *bl602_sf_ctrl.o \ - *bl602_sflash.o \ - *bl602_xip_sflash.o \ - *bl602_ef_ctrl.o) .rodata*) + *(EXCLUDE_FILE( *bl702_glb.o \ + *bl702_pds.o \ + *bl702_common.o \ + *bl702_sf_cfg.o \ + *bl702_sf_ctrl.o \ + *bl702_sflash.o \ + *bl702_xip_sflash.o \ + *bl702_ef_ctrl.o) .rodata*) *(.rodata) *(.rodata.*) @@ -87,14 +86,14 @@ SECTIONS *(.sclock_rlt_code) *(.sclock_rlt_const) - *bl602_glb.o*(.rodata*) - *bl602_pds.o*(.rodata*) - *bl602_common.o*(.rodata*) - *bl602_sf_cfg.o*(.rodata*) - *bl602_sf_ctrl.o*(.rodata*) - *bl602_sflash.o*(.rodata*) - *bl602_xip_sflash.o*(.rodata*) - *bl602_ef_ctrl.o*(.rodata*) + *bl702_glb.o*(.rodata*) + *bl702_pds.o*(.rodata*) + *bl702_common.o*(.rodata*) + *bl702_sf_cfg.o*(.rodata*) + *bl702_sf_ctrl.o*(.rodata*) + *bl702_sflash.o*(.rodata*) + *bl702_xip_sflash.o*(.rodata*) + *bl702_ef_ctrl.o*(.rodata*) . = ALIGN(4); __tcm_code_end__ = .; @@ -114,22 +113,6 @@ SECTIONS __tcm_data_end__ = .; } > dtcm_memory - /* .heap_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of heap sections, and assign - * values to heap symbols later */ - .heap_dummy (NOLOAD): - { - . = ALIGN(0x4); - . = . + HeapSize; - . = ALIGN(0x4); - } > dtcm_memory - - _HeapBase = ORIGIN(dtcm_memory) + LENGTH(dtcm_memory) - StackSize - HeapSize; - _HeapSize = HeapSize; - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(_HeapBase >= __tcm_data_end__, "region RAM overflowed with stack") - /*************************************************************************/ /* .stack_dummy section doesn't contains any symbols. It is only * used for linker to calculate size of stack sections, and assign @@ -214,14 +197,16 @@ SECTIONS . = ALIGN(4); __HeapBase = .; - /*__end__ = .;*/ - /*end = __end__;*/ KEEP(*(.heap*)) . = ALIGN(4); __HeapLimit = .; } > ram_memory + + PROVIDE (__heap_min_size = 0x400); __HeapLimit = ORIGIN(ram_memory) + LENGTH(ram_memory); + ASSERT((__HeapLimit - __HeapBase ) >= __heap_min_size, "heap size is too short.") + }