Skip to content

Commit 9c67656

Browse files
committed
Fix .data section load memory address (LMA) in linker script and disable unaligned access trapping. [AI work: identified and fixed the __const_static_data_load LMA bug in gcc.ld, diagnosed the resulting unaligned write UsageFault, and disabled trap_unaligned_access in configure.hpp; Human work: reviewed and approved the implementation plan and fixes.]
1 parent 2a90405 commit 9c67656

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

configurations/basic/configure.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ constexpr static bool allow_thread_mode_exception_return{false};
9090

9191
/// Enable trapping of unaligned accesses into a Usage Fault.
9292
/// @note Halfword and Word Acceases using LDM, STM, LDRD, and STRD will always fault when this is enabled.
93-
constexpr static bool trap_unaligned_access{true};
93+
constexpr static bool trap_unaligned_access{false};
9494

9595
/// Enable trapping of divide by zero operations into a Usage Fault.
9696
/// @note This only applies to hardware divide instructions (SDIV and UDIV).When disabled, a value of zero is returned.

modules/stm32/linkerscripts/gcc.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ SECTIONS {
6565

6666
/* Initialized Constant Static Storage */
6767
.rodata ALIGN(4) : {
68-
__const_static_data_load = .;
6968
*(.rodata)
7069
*(.rodata.*)
7170
} >REGION_TEXT
7271

7372
/* Initialized Static Storage in RAM (no longer really Constant!)*/
73+
__const_static_data_load = LOADADDR(.data);
7474
.data : {
7575
__const_static_data_start = .;
7676
*(.data)

0 commit comments

Comments
 (0)