Skip to content

Commit

Permalink
linker: esp32: move snippets-section within rom boundary
Browse files Browse the repository at this point in the history
This will guarantee that application snippets will be placed
into ROM section properly.

Signed-off-by: Sylvio Alves <[email protected]>
  • Loading branch information
sylvioalves authored and jhedberg committed Oct 13, 2023
1 parent ac67f24 commit 4b5331b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions soc/riscv/espressif_esp32/esp32c3/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ SECTIONS
#include <zephyr/linker/common-rom/common-rom-bt.ld>
#include <zephyr/linker/common-rom/common-rom-debug.ld>
#include <zephyr/linker/common-rom/common-rom-misc.ld>
#include <snippets-sections.ld>

/* Create an explicit section at the end of all the data that shall be mapped into drom.
* This is used to calculate the size of the _image_drom_size variable */
Expand Down Expand Up @@ -311,8 +312,6 @@ SECTIONS
. = ALIGN(4);
} GROUP_LINK_IN(RAMABLE_REGION)

#include <snippets-sections.ld>

.dram0.data :
{
. = ALIGN(4);
Expand Down
3 changes: 1 addition & 2 deletions soc/xtensa/espressif_esp32/esp32/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ SECTIONS
#include <zephyr/linker/common-rom/common-rom-bt.ld>
#include <zephyr/linker/common-rom/common-rom-debug.ld>
#include <zephyr/linker/common-rom/common-rom-misc.ld>
#include <snippets-sections.ld>

/* Create an explicit section at the end of all the data that shall be mapped into drom.
* This is used to calculate the size of the _image_drom_size variable */
Expand All @@ -234,8 +235,6 @@ SECTIONS
_image_dram_size = LOADADDR(.dram0.end) + SIZEOF(.dram0.end) - _image_dram_start;
_image_dram_vaddr = ADDR(.dram0.data);

#include <snippets-sections.ld>

.dram0.data :
{
__data_start = ABSOLUTE(.);
Expand Down
3 changes: 1 addition & 2 deletions soc/xtensa/espressif_esp32/esp32_net/linker.ld
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ SECTIONS
#include <zephyr/linker/common-rom/common-rom-bt.ld>
#include <zephyr/linker/common-rom/common-rom-debug.ld>
#include <zephyr/linker/common-rom/common-rom-misc.ld>
#include <snippets-sections.ld>

/* Create an explicit section at the end of all the data that shall be mapped into drom.
* This is used to calculate the size of the _image_drom_size variable */
Expand All @@ -225,8 +226,6 @@ SECTIONS
_image_dram_size = LOADADDR(.dram0.end) + SIZEOF(.dram0.end) - _image_dram_start;
_image_dram_vaddr = ADDR(.dram0.data);

#include <snippets-sections.ld>

.dram0.data :
{
__data_start = ABSOLUTE(.);
Expand Down
3 changes: 1 addition & 2 deletions soc/xtensa/espressif_esp32/esp32s2/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ SECTIONS
#include <zephyr/linker/common-rom/common-rom-net.ld>
#include <zephyr/linker/common-rom/common-rom-debug.ld>
#include <zephyr/linker/common-rom/common-rom-misc.ld>
#include <snippets-sections.ld>

/* Create an explicit section at the end of all the data that shall be mapped into drom.
* This is used to calculate the size of the _image_drom_size variable */
Expand Down Expand Up @@ -363,8 +364,6 @@ SECTIONS
. = ALIGN(8);
} GROUP_LINK_IN(RAMABLE_REGION)

#include <snippets-sections.ld>

.dram0.data :
{
. = ALIGN (8);
Expand Down
3 changes: 1 addition & 2 deletions soc/xtensa/espressif_esp32/esp32s3/default.ld
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ SECTIONS
#include <zephyr/linker/common-rom/common-rom-bt.ld>
#include <zephyr/linker/common-rom/common-rom-debug.ld>
#include <zephyr/linker/common-rom/common-rom-misc.ld>
#include <snippets-sections.ld>

/* Create an explicit section at the end of all the data that shall be mapped into drom.
* This is used to calculate the size of the _image_drom_size variable */
Expand Down Expand Up @@ -426,8 +427,6 @@ SECTIONS
. = ALIGN(8) ;
} GROUP_LINK_IN(RAMABLE_REGION)

#include <snippets-sections.ld>

.dram0.data :
{
. = ALIGN (8);
Expand Down

0 comments on commit 4b5331b

Please sign in to comment.