Linker script - SRAM_combined region crosses PSRAM and DSRAM1 bondary

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi all,

I have an XMC4400 evaluation board. At some point in my program I declare an array that is big enough to occupy memory space on either side of the PSRAM and DSRAM1 boundary (see image below).

1964.attach


Below is a snippet from the ".map" file that shows that indeed the array has one of its members on the border.

/* Map file snippet */

.bss 0x1fffc898 0x4009 load address 0x0c001eb4
0x1fffc898 . = ALIGN (0x4)
0x1fffc898 __bss_start = .
*(.bss)
*(.bss*)
.bss.resultsArray
0x1fffc898 0x4000 ./main.o
0x1fffc898 resultsArray
.bss.resultsArrayIndex
0x20000898 0x2 ./main.o
0x20000898 resultsArrayIndex
*fill* 0x2000089a 0x2


The linker script defines the following region that crosses the boundary between the regions; this is where the ".bss" data is placed, too, as per linker script.

   /* Linker script snippet */   

SRAM_combined(!RX) : ORIGIN = 0x1FFFC000, LENGTH = 0x14000

/* Some linker script code here */

/* BSS section */
.bss (NOLOAD) :
{
. = ALIGN(4);
__bss_start = .;
* (.bss);
* (.bss*);
* (COMMON);
*(.gnu.linkonce.b*)
__bss_end = .;
} > SRAM_combined
__bss_size = __bss_end - __bss_start;


However, when the array is allocated memory space during the startup, upon crossing the boundary between memory regions (unaligned, too, as the offending address shown in BFAR register is 0x1FFF FFFD), the program generates a Bus Fault. Could you please help me figure out a way to go about this issue?

Thank you!

Regards,
Andrey
0 Likes
2 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi Andrey,

Please add an alignment statement just before the _bss_end symbol definition as shown below.

   
/* BSS section */
.bss (NOLOAD) :
{
. = ALIGN(4);
__bss_start = .;
* (.bss);
* (.bss*);
* (COMMON);
*(.gnu.linkonce.b*)
. = ALIGN(4);
__bss_end = .;
} > SRAM_combined
__bss_size = __bss_end - __bss_start;


Regards,
Jesus
0 Likes
Not applicable
Jesus,

Thank you so much - this has fixed the issue!

Regards,
Andrey
0 Likes