Skip to content

Commit

Permalink
espressif: Fix build with RTC
Browse files Browse the repository at this point in the history
This commit ensures that RTC data is properly allocated in the RTC
segment in the linker. This fixes the reported problem about using
the legacy bootloader and RTC.
  • Loading branch information
tmedicci authored and xiaoxiang781216 committed Aug 29, 2024
1 parent c8e56ff commit a763ed1
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)
} >rtc_iram_seg

/* This section holds RTC data that should have fixed addresses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)
} >lp_ram_seg

/* This section holds RTC data that should have fixed addresses.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)
} >lp_ram_seg

/* This section holds RTC data that should have fixed addresses.
Expand Down
2 changes: 2 additions & 0 deletions boards/xtensa/esp32/common/scripts/legacy_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
2 changes: 2 additions & 0 deletions boards/xtensa/esp32/common/scripts/mcuboot_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
2 changes: 2 additions & 0 deletions boards/xtensa/esp32/common/scripts/simple_boot_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
2 changes: 2 additions & 0 deletions boards/xtensa/esp32s2/common/scripts/mcuboot_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
2 changes: 2 additions & 0 deletions boards/xtensa/esp32s2/common/scripts/simple_boot_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
10 changes: 10 additions & 0 deletions boards/xtensa/esp32s3/common/scripts/legacy_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,20 @@ SECTIONS
_iram_end = ABSOLUTE(.);
} >iram0_0_seg

/* RTC BSS section. */

.rtc.bss (NOLOAD) :
{
*(.rtc.bss)
} >rtc_slow_seg

.rtc.data :
{
. = ALIGN(4);
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down
2 changes: 2 additions & 0 deletions boards/xtensa/esp32s3/common/scripts/mcuboot_sections.ld
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ SECTIONS
.rtc.data :
{
*(.rtc.data)
*(.rtc.data.*)
*(.rtc.rodata)
*(.rtc.rodata.*)

/* Whatever is left from the RTC memory is used as a special heap. */

Expand Down

0 comments on commit a763ed1

Please sign in to comment.